Cool!..... Yes,
Then I could write a book and title it "Picing up the PC"![]()
Cool!..... Yes,
Then I could write a book and title it "Picing up the PC"![]()
Well, you place those limitation yourself. You could still use 2 Words... some basic maths around that. But will this worth if you could do most of the job on your PC side? It's up to you.But how do do it in a PIC where your greatest mathmatic result is limited to <= 65535?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi,
I don't want to pretend I know the answer but may have an idea....
What do you intend to with the value once (if) you have it?
/Henrik Olsson.
Not exactly a Brain Teaser - more a trick question.I have 4 (8 bit) bytes being sent to me in a serial string.
Byte_1 is to be multiplied by 16777216
Byte_2 is to be multiplied by 65536
Byte_3 is to be multiplied by 256
Byte_4 is to be multiplied by 1
Byte_1 is the MSB of a 32-bit variable, Byte_4 is the LSB of your 32-bit variable... no maths needed... so what you're really asking for is a routine to output a 32-bit (four byte) variable in human readable decimal...
Hi Melanie,
I thought I posted this the other day, but perhaps the system kicked me out for not posting fast enough.
The 4 bytes represent a value from 0 - 30,000.000
So fortunatly for me, the highest Byte will only be a 1 or 0.
The numbers represent radio frequency.
I have a radio that is sending me the 4 bytes to indicate what its current frequency is.
I have a number of frequency windows to play in.
I split each one of these windows up into 8 slices.
The frequency value then gets matched to one of these slices.
I use this info to control a remote antenna tuner box I made last winter.
I would bet you call this one simple.
But its over my head
Thanks
Duane
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
how the data is sent? Did you tried to attach your radio directly to a PC? Maybe he just send you ASCII string or HEX value?
in fact it could make sense... let's assume it send you 4 Bytes...
30,000.000
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Yes, the device is setup to talk to a PC.
The PC queries the device for its set frequency, and the device returns the 4 bytes.
I know I should push the 4 bytes into 2 seperate 16 bit words.
Then I need to figure out what the decimal part is for:
Millions
Thousands
Hundreds
This seem pretty straight forward for a 1 byte word, but no so easy for me to get my head around doing it for 2 bytes, due to the carry effect.
Bookmarks