BS2Function question
PVJohn
Posts: 60
Hi,
I'm trying to convert some of my pbasic code to spin, and I found a "problem"·with SERIN command.
I wasn't able to compile spin code when I tried to use "WAIT"
BS2.SERIN_STR(6,[noparse][[/noparse]WAIT ("OK")],9600,1,8). Is this possible·in spin and how?
I'm trying to communicate with Agilent DVM.
Thanks!·
I'm trying to convert some of my pbasic code to spin, and I found a "problem"·with SERIN command.
I wasn't able to compile spin code when I tried to use "WAIT"
BS2.SERIN_STR(6,[noparse][[/noparse]WAIT ("OK")],9600,1,8). Is this possible·in spin and how?
I'm trying to communicate with Agilent DVM.
Thanks!·
Comments
To wait for "OK", you can do it one of 2 ways, using the SERIN_Wait function:
Or, manually wait ing code using SERIN_Str:
Spin isn't fast enough to totally replicate a true Wait, the above codes will work even if "abcOi am here K get this! is sent". But I have tested sending a file with similar from hyperterminal and 99% of the time it got the data after the K without garbage (I'm still amazed an intepretive language is fast enough to process between bytes in a transmission!).
I'm teaching with the propeller this semester, and maybe a good class project would be to implement these functions BS2 functions in ASM.
I'll send the new file to Parallax this week and get it updated on the objects page.
Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
Southern Illinois University Carbondale - Electronic Systems Technologies
Personal Links with plenty of BASIC Stamp info
StampPlot - Graphical Data Acquisition and Control
Post Edited (Martin Hebel) : 8/27/2006 5:10:11 PM GMT
Sorry for the repost.
Version 1.3.2
-Martin
all I did was just added a repeat to the method.
PUB recData
· x := 0
· text.str(string("Received:· "))
· repeat while byteval<>10
··· Byteval := BS2.Serin_Char(1,9600,BS2#NInv,8)
··· text.out(Byteval)
· text.out(13)
Thanks for the updated post.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
Do you have a Stamp Tester yet?
http://hometown.aol.com/newzed/index.html
·
PVJohn