Serial communication
SAN
Posts: 29
I want to send data to the Basic Stamp through serial port.
when i tried with SERIN() command i wouldn't receive any data.
can you help me to connect by Basic Stamp with PC through serial port using any of I/O pins?
Help me with the connection and codes.
I am sending the data using RoboRealm serial option.
when i tried with SERIN() command i wouldn't receive any data.
can you help me to connect by Basic Stamp with PC through serial port using any of I/O pins?
Help me with the connection and codes.
I am sending the data using RoboRealm serial option.
Comments
If you still have problems, you will need to post a schematic showing how you're connecting the Stamp and your PC and a listing of your program
(both as attachments to your reply).
my basic stamp code is -
' {$STAMP BS2}
' {$PBASIC 2.5}
x VAR Byte
DO
SERIN 0,16780,[noparse][[/noparse]DEC2 x]
IF x=10 THEN
HIGH 15
ELSE
LOW 15
ENDIF
LOOP
and in the RoboRealm vb-script code is -
width = GetVariable("IMAGE_WIDTH")
center = width / 2
size = GetVariable("COG_BOX_SIZE")
'if size <> "" then
cogx = GetVariable("COG_X")
if cogx < center-5 then
testx = 10
elseif cogx > center+5 then
testx = 20
end if
SetVariable "LEFT_MOTOR", CInt(testx)
in serial module i am sending the variable -
[noparse][[/noparse]LFT_MOTOR]
in baudmode 9600
I am using laptop with Windows vista and USB to Serial converter
I am using the same connection shown in the Basic Stamp Manual pg- 395 [noparse][[/noparse]I/P = pin 3, pin 1,4,6 shorted and pin 5 = VSS]
RoboRealm sending the variable but the basic stamp does not response.
Sir please help me.
but where,I mean which port I should connect the TX pin (Pin 3) of the RS232 port.
However, it would be easier to just use "DEBUG" and "DEBUGIN" to do what you're doing, I think. With those, you don't have to worry about Baud or which pin to use - just leave the Stamp connected as you do when programming it. You should definitely read those sections of the Stamp manual.
It is working.