PDA

View Full Version : programming output



soyyam
07-25-2005, 10:22 PM
what's the syntax for sending a variable out through an i/o pin?

Bruce Bates
07-25-2005, 10:40 PM
soyyam -

It really depends on what the receiver expects. If the receiving device expects to see an asynchronous serial output (an RS-232 data steam), then the answer to your question is to use the SEROUT command. If the receiving device expects to see a synchronous serial output (data and clock), then you want to use the SHIFTOUT command. Both commands can be found in the PBasic Manual or Pbasic Help file.

There are other commands for output as well, but those two are the main commands usually used for serial data.

General syntax:

SEROUT Tpin {\Fpin}, Baudmode, {Pace,} {Timeout, Tlabel,} [OutputData ]

SHIFTOUT Dpin, Cpin, Mode, [OutputData {\Bits} {,OutputData {\Bits}...}]

Regards,

Bruce Bates