Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'CoreBASIC script to confirm and configure external BT
- 'module
- '
- INSTALL "UART" AS UART
- '
- UART.SPEED = 9600
- UART.DATA = 8 ' 8 data bits
- UART.PARITY = 0 ' no parity
- UART.STOP = 1 ' 1 stop bit
- '
- CLS
- CALL CHECK_BT_MODULE
- '
- END
- '
- DEFPROC CHECK_BT_MODULE()
- UART.PRINT = "AT"
- WAIT UART.LEFT = 0
- TIMER = 0
- REPEAT
- UNTIL(TIMER > 4000) OR (UART.READY >= 2)
- '
- IF TIMER > 4000 THEN
- PRINT "No BT module found!"
- ELSE
- PRINT "BT module found!"
- S = UART.RX(2)
- UART.PRINT = "AT+NAMESOLDERCORE"
- WAIT UART.LEFT = 0
- '
- TIMER = 0
- REPEAT
- UNTIL(TIMER > 4000) OR (UART.READY >= 9)
- '
- IF TIMER > 4000 THEN
- PRINT "No Response...Weird"
- ELSE
- PRINT UART.RX(20)
- ENDIF
- ENDIF ENDPROC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement