FullDuplex serial over bluetooth
raptor313
Posts: 4
I have a spin stamp attached to a boe-bot which I am using for my test platform. I'm trying to connect the spin stamp to my pc using a Sparkfun BlueSmirf adaptor. I'm currently using RealTerm to check the data going back and forth. The short term goal of this project is to be able to send control signals to the boe-bot while it is sending data, ping, accelerometer, etc... back. I would like it if I could use one Cog for input and one for ouput, however I'm currently using fullduplex serial.
I want it to change the value of speed if I send it a message, otherwise I want the value of speed to be the same. Ideally I would like it so that it would not have to wait. I tried using Serial.RxCheck, however it can never pick up when I send it information. This current setup works, but it only works when the delay for Serial.RxTime(100) is 100ms or more, I need to do this a LOT faster.
Does anyone have any suggestions on how to change this code so that it will quickly change the value of speed and send it back without interrupting the flow of data back from the prop. Thanks for any help in advance.
I want it to change the value of speed if I send it a message, otherwise I want the value of speed to be the same. Ideally I would like it so that it would not have to wait. I tried using Serial.RxCheck, however it can never pick up when I send it information. This current setup works, but it only works when the delay for Serial.RxTime(100) is 100ms or more, I need to do this a LOT faster.
Does anyone have any suggestions on how to change this code so that it will quickly change the value of speed and send it back without interrupting the flow of data back from the prop. Thanks for any help in advance.
CON _xinfreq = 10_000_000 _clkmode = xtal1 + pll8x debugTX = 1 '16 debugRX = 0 '17 len =8 baud = 9600 PING_Pin = 4 VAR long Stack[noparse][[/noparse]1000] word values[noparse][[/noparse]10] word buffer[noparse][[/noparse]8] byte buffer2[noparse][[/noparse]6] byte speed byte counter byte Cog 'Hold ID of cog in use, if any byte start_sending OBJ BS2 : "BS2_Functions" ' Create BS2 Object Serial : "Extended_FDSerial" PUB Start Serial.start(debugRx,debugTx,0,9600) ' Rx,Tx, Mode, Baud speed := "x" repeat if((counter := Serial.RxTime(100))+1) byte[noparse][[/noparse]@speed] := counter Serial.tx(speed)
Comments