serial string
bnikkel
Posts: 104
in Propeller 1
I have been sending out commands such as, SEROUT 13, 84, ["t0.txt=", 34, "HELLO", 34,255,255,255] on the BS2 but i am having trouble outputting the same command on the propeller. does anyone have any idea how this may be accomplished? thanks.
Comments
In SimpleIDE, in the menus, choose Help -> Simple Library Reference. From there look under "Text Devices" at simpletext.h
The string you printed above would likely come out like this:
print( "t0.txt= %s", "hello" );
I'm not sure what the 13,84 or (34,255...) bits do.
If you need positioning, the Parallax serial terminal does it with special characters. A screen clear is character zero, for example, so you could do it like this:
print( "%c", 0 );
print( "t0.txt= %s", "hello" );
or like this:
putChar(0);
print( "t0.txt= %s", "hello" );
// SEROUT 13, 84, ["j0.val=",DEC 1, 255,255,255]
// SEROUT 13, 84, ["t0.txt=", 34, "USM.inc", 34,255,255,255]
here are two that work perfect on the BS2. 13 is the pin#, 84 is the baud, "j0.val=" is an identifier, DEC 1 is the actual info, and 255 255 255 is an end code i believe its received as 0xFF 0xFF 0xFF.
i dont know how the propeller actually outputs quoted text compared to BS2.
If you'd like to use the FullDuplexSerial backend, you can try the following code:
There are other options as well, included with PropWare and libpropeller - but I suspect this will be easiest for you.
---- Edit
I've fixed update the call to fdserial_open based on Electrodude's response regarding the special "84" number in the BS2 code.
84 is 9600 baud, not open, non-inverted, and no parity.
Thanks. Sample code updated.