Bluesmirf reading hex value with propeller
Ryoshima
Posts: 34
This does involve a wireless topic but it's more of a propeller issue. When sending an ASCII command to a bluesmirf ('L'), the bluesmirf returns as an example:
RSSI=ff,fa
(the bluesmirf returns the whole line, RSSI= and all, above every time)
where both are hexadecimal values and the ff would be the current RSSI value and fa would be the lowest RSSI value that has been encountered.
Is there a way for me to just grab the bold ff portion?
Thanks
RSSI=ff,fa
(the bluesmirf returns the whole line, RSSI= and all, above every time)
where both are hexadecimal values and the ff would be the current RSSI value and fa would be the lowest RSSI value that has been encountered.
Is there a way for me to just grab the bold ff portion?
Thanks
Comments
RSSI=**,##
where ** is the changing hex value and the value I desire to capture.
I have used the propeller board for a while but haven't had to be to in depth with the coding, can you please elaborate on how your code works line by line?
Thank you!!
Edit: if you want to display the numeric value of A then use the .DEC(), .BIN(), .HEX() methods of your display device.
I assume you have to assign io.rx to a pin, but when I look into FULLSERIALDUPLEX, the rx function isn't setup to have an assigned pin.
See the .start method of the fullduplexserial object for the meanings.
Edit: Also the clock needs to be set up.
I am green at coding this on the prop (this is toddlers play in perl), but if it is a constant length string (is this something that one of the serial IO objects could handle?), I would input it into an array and read back the contents of the two bytes prior the null terminator to get the ascii representation of the hex value. Realize that if you want the actual binary value represented by the two bytes, you will have to add a routine to convert ascii to binary/hex for a true 8 bit single byte value. Bytes are as easy as any other length in spin, a bit more difficult in PASM as it works on 32 bit words.
Yeah, I noted after I hit send that you referenced the fullduplex serial object. I have used that extensively in debugging my ADC capture object. It appears to be able to send a string, but most of the examples and the object look like the receive is limited to bytes as the examples usually build in a string handler for using it as an input.
Frank
@ratronic.
(Not to lazy to try it and code it, just wanted to throw the possibility out there. Finishing wiring up an SOIC op-amp into a .5 wide home-made dip header. My next A/D will be using the TI ADS7229. I expect it will tax the Prop chips speed if I can push it near its rated 1MSPS speed w/ 12 bit serial output. MCP3201 capture object @100ksps already posted.)
Though this isn't working
source: [/B]https://github.com/produceconsumerobot/MindSetArduino/blob/master/CleanProgramBlueSMiRF/CleanProgramBlueSMiRF.pde
P.S. I haven't been to sleep yet
Edit get some sleep!
Can you check what the byte after the first $66 is?
EDIT: I suppose changing those to a usable integer range($66 = 100 ---> $?? = 0)?
EDIT: its a space, but why still?
if char = "b"
what would be returned?
Also, is there a good place I can go to learn about this stuff after we figure out this problem?
Using capital "C" ($43) as an example. $43 | $20 = $63, $63 - $61 + 10 = 12. Twelve decimal is "c" hex.