If someone has a free moment, maybe you could give me a little push...
I'm on the road, and the Stamp is at home, but I thought I would see about writing some programming
and then when I get home I can see what actually works.
Simply put, I just need to read the status of the individual digital input pins (0 through 7). (I presume I would set up a loop to scan the inputs.)
Then if an input goes high, output a character, e.g., input 1 High = "A" sent to the serial port (terminating with an ASCII LF (ASCII 13)). When input goes low, output a "B" and a LF
I need to monitor some relay contacts and put something on the screen to indicate when any relay is fired. Timing? Not an issue. The shortest cycle would be
over 5 seconds.
In good ol' GW Basic, it would be
Scan inputs - 0 through 7
if input 0 =1 then print chr$(65) (And CHR$(13)) else print chr$(66)
(Insert code to ignore the pin until it goes low)
if input 1 =1 then print chr$(67) (And CHR$(13)) else print chr$(68)
Rinse, repeat until all pins scanned then start the scan again...
Each pin would then be scanned, if it is high, a unique character would be sent to the serial port. (Once)
If it is low, then a another unique character would be sent to the serial port. (Once)
IIRC my Basic Stamp 2 is a serial (rs-232) output. That would make things easier. If it is a USB out,
then I can deal with that later.
I admit this is pretty simple, but its been awhile since I have had time to play with my BS2, and if anyone
likes to noodle around with this kind of stuff, a little code would be appreciated. I admit I am not a structured
programmer, I still depend on GOTOS and stuff liek that, to the derision of my more advance cohorts.
Anyway, thanks for listening, and my appreciation to anyone who would like to chime in.