Hi,
So I am trying to use a 08M2 with a Sparkfun Blue smirf gold, https://www.sparkfun.com/products/retired/12582, so that I can control a project of mine over bluetooth. I have had success with the 08M2 sending text to the serial terminal app on my phone, but when I send the characters "0" or "1" from the terminal app to the 08M2, they are never received correctly. Instead of getting ASCII 48 or 49, I almost always get 248, 230, 152, 24, or 6. Does anybody have any idea what might be going on? Attached is a simplified schematic of my test setup and my code
Thanks
So I am trying to use a 08M2 with a Sparkfun Blue smirf gold, https://www.sparkfun.com/products/retired/12582, so that I can control a project of mine over bluetooth. I have had success with the 08M2 sending text to the serial terminal app on my phone, but when I send the characters "0" or "1" from the terminal app to the 08M2, they are never received correctly. Instead of getting ASCII 48 or 49, I almost always get 248, 230, 152, 24, or 6. Does anybody have any idea what might be going on? Attached is a simplified schematic of my test setup and my code
Thanks
Code:
let b0 = 0 ; Fog machine ready input
let b1 = "0" ;Recieving serial buffer
HSERSETUP OFF
Mainloop:
if pinc.3 = 0 AND b0 = 1 then ;Check if fog machine has gone into the not ready state from previous
let b0 = 0 ;ready state and notify user if so
LOW c.4
serout c.2, T4800_4, ("Fog not ready")
serout c.2, T4800_4, (13)
pause 250
serout c.2, T4800_4, ("Fog off")
serout c.2, T4800_4, (13)
HSERSETUP OFF
endif
if pin3 = 1 AND b0 = 0 then ;Check if fog machine has gone into ready state from previous not ready
let b0 = 1 ;state and notify user if so
serout c.2, T4800_4, ("Fog ready")
serout c.2, T4800_4, (13)
HSERSETUP B4800_4, 8
endif
if b0 = 1 then ;If fog machine is ready then read serial buffer
hserin b1
if b1 = "0" then ;If "0" is received then turn off fog
LOW c.4
serout c.2, T4800_4, ("Fog off")
serout c.2, T4800_4, (13)
let b1 = 0
endif
if b1 = "1" then ;If "1" is received then turn on fog
HIGH c.4
serout c.2, T4800_4, ("Fog on")
serout c.2, T4800_4, (13)
let b1 = 0
endif
endif
debug
goto Mainloop
Last edited: