Extended Duplex help
im just getting into propeller and trying to understand the full duplex object,could someone give me an example code of how to send the series of bytes (0xFF 0x55 0x03 0x00 0x01 0x04 0xF8) at 9800 buad? Help would be greatly appriciated
Thankyou


Comments
2) For each byte you want to transmit, use SER.tx(value). In your case, you'd use something like SER.tx($FF), then SER.tx($55), etc.
3) If you're sending a sequence of constant values not including zero, you could use SER.str(stringAddress). That won't work here because you want to transmit a zero byte. Just use a sequence of calls to SER.tx, one per line.
It has a portion that writes some bytes to the serial port and then waits for 1 of 4 characters to be sent from hyperterminal.
Check it out!
Here are the important lines:
VAr byte : KBcode OBJ Serial : "FullDuplexSerial" PUB start Serial.start(31, 30, 0, 9600) ' HyperTerminal 9600, None, 1, no flow control ' send some data Serial.str(string(13,10,13,10,13,10,13,10)) Serial.str(string(" *** Propeller Color Code Tester for your TV ***",13,10,13,10)) Serial.str(string(" Use the I,J,K,M keys to navigate on your TV screen",13,10,13,10)) Serial.str(string(" I I=Increase the current color value",13,10)) Serial.str(string(" J K Change which code we are examining",13,10)) Serial.str(string(" M M=Decrease the current color value",13,10,13,10)) ' rx some data KBcode := Serial.rxcheck Case KBcode 107: ' lower case K CMD_Code := CMD_Right 106: ' lower case J CMD_Code := CMD_Left 105: ' lower case I CMD_Code := CMD_Up 109: ' lower case M CMD_Code := CMD_Down
Grab a copy of PropCOMM from this thread:
http://forums.parallax.com/showthread.php?p=675748
Here's the core, it's another example...
PUB start | i, a, b, TimeCnt key.start(keyPins) ' Start keyboard driver text.start(12) ' Start terminal screen ser.start(serRecv,serXmit,%0000,9600) ' Control link via prop-plug PRI terminal | local,remote,duplex duplex := 0 repeat local := key.key if local <> 0 if duplex == 1 text.out(local) ser.tx(local) remote := ser.rxtime(20) if remote == 8 text.str(string(backspace," ",backspace)) remote := 0 if remote > 10 text.out(remote)
Oldbitcollector
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Buttons . . . check. Dials . . . check. Switches . . . check. Little colored lights . . . check.
— Calvin, of 'Calvin and Hobbes.