newby noob (serial com & 433trainsceiver help)
DestinedtoFall12
Posts: 4
Good morning, can someone help me better understand serial communication with basic stamp? Ive gone through whats a microcontroller, robotics with boe bot and read a ton of articles including serin & serout demystified in Nuts and Volts. Im having a tough time locking it down. Im trying to control a bot bots speed direction with 2 10k potentiometers via 433RF transceivers. Im familiar with how to use potentiometers ,however , i dont seem to understand how to transmit that data. Any help or push in the right direction also any reading recommendations would be much appreciated.
thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My brain hurts
Post Edited (DestinedtoFall12) : 2/27/2009 4:22:11 PM GMT
thanks,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My brain hurts
Post Edited (DestinedtoFall12) : 2/27/2009 4:22:11 PM GMT
Comments
I would recommend using the pencil icon to edit your message to provide a desriptive subject of what your message is about. This will enable other members to know what you need help with, and if they can provide it. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
1) You have two numbers representing the position of the pots, say that they're approximately in percent so the values range from 0 to 127. You can transmit the values as 8 bit bytes using some kind of microcontroller and a standard asynchronous serial format that a Stamp can receive using the SERIN statement. If you use the 8th (sign) bit to indicate which pot value is which, that would help in decoding at the receiving end.
2) You could transmit two pulses of variable length proportional to the value of the pot(s), just like what's used for control of servo motors (see the Robotics with the BoeBot tutorial for a more detailed description). You'd need some kind of synchronization method because you have two pots. You could use a pulse shorter than the minimum to mark the beginning of the two values or you could bias one pot's value, perhaps with one pot causing pulses from 1 to 2ms in length and the other pot causing pulses from 3ms to 4ms in length with the 1ms width range representing the pot value from 0 to 10K. This scheme could be done using 555 timers with the pots determining the pulse width. You'd need some external logic to trigger the timers in sequence and "or" the outputs together to drive the transmitter.
Post Edited (Mike Green) : 2/27/2009 4:29:43 PM GMT
' Transmitter
xtime VAR Word
DO
HIGH 15
PAUSE 5
RCTIME 15, 1, xtime
PAUSE 100
DEBUG HOME, DEC3 xtime
SEROUT 0, 16780, [noparse][[/noparse] "!", xtime.HIGHBYTE, xtime.LOWBYTE ]
LOOP
' Receiver
xtime VAR Word
FREQOUT 4, 2000, 3000
DO
SERIN 11, 16780, [noparse][[/noparse] WAIT("!"),
xtime.HIGHBYTE, xtime.LOWBYTE ]
DEBUG HOME, DEC3 xtime
LOOP
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My brain hurts
Jeff T.