A Space & astronomy forum. SpaceBanter.com

Go Back   Home » SpaceBanter.com forum » Space Science » Technology
Site Map Home Authors List Search Today's Posts Mark Forums Read Web Partners

ASCII to BINARY help needed (Satellite tracker project)



 
 
Thread Tools Display Modes
  #1  
Old February 25th 04, 08:47 AM
Andrew Rich
external usenet poster
 
Posts: n/a
Default ASCII to BINARY help needed (Satellite tracker project)

Howdy,

I have a satellite tracking program that outputs from AZ,1-359,EL,1-90 in
ASCII.

I am just wondering how I can convert this to something meaningfull in the
PIC.

example How would I convert '2' '8' '0' ASCII to a binary equivalent ?

See I want to compare this to the counter in the PIC and then do something.

Work out if the incoming value is higher or lower than the current counter
value.

Ideas ?



--
Andrew Rich (VK4TEC)
www.tech-software.net


space - electronics - radio - aviation


  #2  
Old February 26th 04, 01:57 PM
Me and myself
external usenet poster
 
Posts: n/a
Default ASCII to BINARY help needed (Satellite tracker project)

"Andrew Rich" wrote in message ...
Howdy,

I have a satellite tracking program that outputs from AZ,1-359,EL,1-90 in
ASCII.

I am just wondering how I can convert this to something meaningfull in the
PIC.

example How would I convert '2' '8' '0' ASCII to a binary equivalent ?

See I want to compare this to the counter in the PIC and then do something.

Work out if the incoming value is higher or lower than the current counter
value.

Ideas ?


Hi

What Language are you programming in most languages have a string to
integer function that you would enter only the numeric part into the
function using a mid function.

For example : Say you ASCII string is "ASDA 280 dsfsddas" and you
wanted to convert the 280 to an integer value you'd do something like
this :-

NumberValue = strtoint(mid("ASDA 280 dsfsddas",6,3))

it all depends on what language you are using ....

Another more bacward way is using the Ascii values
Text - Asci Value
0 - 48
1 - 49
2 - 50
3 - 51
4 - 52
5 - 53
6 - 54
7 - 55
8 - 56
9 - 57

You convert each Character to its Ascii value then minus 48 from it
and then times it by it's relavant place in the number.

For Example. 280 = ascii 50,56 and 48 so you take 50 - 48 = 2 and
times it by 100 which is 200 then take 56 - 48 = 8 and times it by 10
= 80 and add it to the number which is 200 + 80 = 280 the last value
is zero so you would not need to do it since it has no effect on the
output.

does any of this help?

Ralph
  #3  
Old February 26th 04, 03:04 PM
Ian Stirling
external usenet poster
 
Posts: n/a
Default ASCII to BINARY help needed (Satellite tracker project)

Andrew Rich wrote:
Howdy,

I have a satellite tracking program that outputs from AZ,1-359,EL,1-90 in
ASCII.

I am just wondering how I can convert this to something meaningfull in the
PIC.

example How would I convert '2' '8' '0' ASCII to a binary equivalent ?

See I want to compare this to the counter in the PIC and then do something.

Work out if the incoming value is higher or lower than the current counter
value.

Ideas ?


Look at an ascii table (google should help)
This gives each charachters code, (2 is 51 for example).
Now just convert from decimal to binary.
  #4  
Old February 26th 04, 05:29 PM
PP
external usenet poster
 
Posts: n/a
Default ASCII to BINARY help needed (Satellite tracker project)

The windows Accessories calculator will convert to binary

Just switch to the binary calculator .



--


"Andrew Rich" wrote in message
...
Howdy,

I have a satellite tracking program that outputs from AZ,1-359,EL,1-90 in
ASCII.

I am just wondering how I can convert this to something meaningfull in the
PIC.

example How would I convert '2' '8' '0' ASCII to a binary equivalent ?

See I want to compare this to the counter in the PIC and then do

something.

Work out if the incoming value is higher or lower than the current counter
value.

Ideas ?



--
Andrew Rich (VK4TEC)
www.tech-software.net


space - electronics - radio - aviation




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
UK Will Build First Satellite To Study Wind From Space Ron Baalke Science 0 November 20th 03 04:05 PM


All times are GMT +1. The time now is 01:30 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 SpaceBanter.com.
The comments are property of their posters.