Connection with PINK
yuxian
Posts: 3
I have a PINK Connected with my BASIC Stamp 2E. PINK and Stamp works fine seperately.
But I can't seem to get both work together.
This is my test program:
Let say my variable 1 for pink's default value is 12345
But nothing ever seem to happen.
Another question.
In this line of code
What does the 8 do?
Sorry but I am kind of new to all these.
But I can't seem to get both work together.
This is my test program:
'{$STAMP BS2e} '{$PBASIC 2.0} '{$PORT COM5} NBVAR VAR Byte SEROUT 8,2400,[noparse][[/noparse]"!NB0R01"] SERIN 7,2400,[noparse][[/noparse]NBVAR] DEBUG DEC NBVAR END
Let say my variable 1 for pink's default value is 12345
But nothing ever seem to happen.
Another question.
In this line of code
SEROUT [b]8[/b],2400,[noparse][[/noparse]"!NB0R01"]
What does the 8 do?
Sorry but I am kind of new to all these.
Comments
This code will let you set the baud mode for 9600bps based on the $Stamp Directive
#SELECT $STAMP························· ' Select Baud constants
· #CASE BS2, BS2E, BS2PE
··· T1200······ CON···· 813
··· T2400······ CON···· 396
··· T4800······ CON···· 188
··· T9600······ CON···· 84
··· T19K2······ CON···· 32
· #CASE BS2SX, BS2P
··· T1200······ CON···· 2063
··· T2400······ CON···· 1021
··· T4800······ CON···· 500
··· T9600······ CON···· 240
··· T19K2······ CON···· 110
· #CASE BS2PX
··· T1200······ CON···· 3313
··· T2400······ CON···· 1646
··· T4800······ CON···· 813
··· T9600······ CON···· 396
··· T19K2······ CON···· 188
#ENDSELECT
Inverted······· CON···· $4000················ 'Value for inverted serial format
Baud··········· CON···· T9600················ ·''8,N,1 not inverted
InvBaud······· CON···· T9600 + Inverted·· '8,N,1 inverted
SEROUT·8,Baud,[noparse][[/noparse]"!NB0R01"]
SERIN·7,Baud,[noparse][[/noparse]NBVAR]
The 8 in Serout instruction is the stamp pin number you have connected to the PINK RX pin, while the 7 in the Serin instruction is the pin you have connected to the PINK TX pin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
·