Parallax Easy Bluetooth Manual page 8

Table of Contents

Advertisement

' -----[ I/O Definitions ]-------------------------------------------------
BT_RX
PIN
BT_TX
PIN
LED
PIN
' -----[ Constants ]-------------------------------------------------------
BT_SPEED
CON
' -----[ Variables ]-------------------------------------------------------
tLeft
VAR
tRight
VAR
temp
VAR
' Buffer array not declared as buffer VAR Word(5) for SERIN functionality.
' It can still be accessed as buffer(0), buffer(1), etc.
' buffer0, buffer1, etc. should be used in SERIN commands with variations
' of WAIT.
buffer0
VAR
buffer1
VAR
buffer2
VAR
buffer3
VAR
buffer4
VAR
buffer
VAR
msgIndex
VAR
rxc
VAR
' -----[ Initialization ]--------------------------------------------------
Program_Start:
LOW LED
DEBUG CLS
PAUSE 1000
msgIndex = 0
buffer0 = $FF
buffer1 = msgIndex
buffer2 = $CC
buffer3 = 100
buffer4 = 100
GOSUB Set_Servo_Speed
DEBUG CR,"Waiting connection..."
SERIN BT_RX, BT_SPEED, [WAITSTR buffer \ 3, buffer3, buffer4]
' -----[ Program Code ]----------------------------------------------------
DO
SELECT buffer2
CASE $CC
HIGH LED
msgIndex = 0
DEBUG CR,"Connected"
GOSUB Reply
Copyright © Parallax Inc.
2
' RX of the Easy Bluetooth
0
' TX of the Easy Bluetooth
5
' Indicator LED for Bluetooth Connection
84
' baud 9600 true UART
Word
' Left Servo control pulse durations
Word
' Right Servo control pulse durations
Word
' Temp variable
Byte
' Buffer - Start char = $ff
Byte
' Message Index value
Byte
' Command
Byte
' Argument 1 (return data 1)
Byte
' Argument 2 (return data 2)
buffer0
' For standard array indexing
Byte
' message index
Byte
' Receive Clear
' Wait for the RBT-001 radio to be ready.
' Connection packet
' wait for connection request
' Connect
Easy Bluetooth (#30085)
However,
v1.3 4/14/2010 Page 8 of 9

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Easy Bluetooth and is the answer not in the manual?

This manual is also suitable for:

30085

Table of Contents