Shop OBEX P1 Docs P2 Docs Learn Events
How do monitor for serial data in, instead of prompting for it with debugin? — Parallax Forums

How do monitor for serial data in, instead of prompting for it with debugin?

lordericolorderico Posts: 12
edited 2009-03-09 22:58 in BASIC Stamp
My program runs a motor by turning it on and off in order to vary its speed.· I want my program to change the speed of the motor when it recieves a signal from the computer.· Currently, I use the Debugin in command.· However, this prompts the user and waits for a reply.· I need it to continue running my program while it waits for data from the computer.· How can I do this?

Thanks,

Eric

Comments

  • JomsJoms Posts: 279
    edited 2009-03-09 22:58
    Have a look at the 'serin' command.· The basic stamp can only do one thing at a time.· If you have it 'waiting' it will not do anything but wait.· You could program a time-out on the serin to timeout after just 10ms if no data has been input.· Have a look at the file for the serin command and you will get a much better idea of how to use it by the examples they show...
Sign In or Register to comment.