This repository was archived by the owner on Aug 27, 2021. It is now read-only.
forked from aanon4/BlueBasic
-
Notifications
You must be signed in to change notification settings - Fork 2
Example: Simple Bluetooth controlled LED
JBtje edited this page Jun 5, 2015
·
2 revisions
5 //
6 // "Simple BLE service to turn an LED on/off"
7 //
10 ADVERT GENERAL
20 ADVERT "25FB9E91-1616-448D-B5A3-F70A64BDA73A"
30 ADVERT END
40 GATT SERVICE "25FB9E91-1616-448D-B5A3-F70A64BDA73A"
50 GATT CHARACTERISTIC "D8ABBBE7-F10B-4EC3-B781-DBCBD2334400" "On/Off"
60 GATT READ WRITE A ONWRITE GOSUB 200
70 GATT END
80 PINMODE P0(0) OUTPUT
90 GOSUB 200
100 RETURN
200 P0(0) = A
210 RETURN
More info here (ADVERT) and here (GATT) and here (PINMODE)
FOR
IF
GOSUB
DIM
LIST
MEM -
NEW
RUN
END
GOTO
REM
PRINT
REBOOT
RETURN
AUTORUN
CONFIG -
ABS
LEN !
RND
+
-
*
/
%
&
|
^
>
>=
<
<=
=
==
!=
<<
>>
//
TIMER
MILLIS -
DELAY
PINMODE
RISING -
FALLING -
INTERRUPT -
ATTACH -
DETACH -
SERIAL
SPI
ANALOG
I2C
WIRE
TIMEOUT -
WAIT -
PULSE -
BATTERY
GATT
WRITENORSP -
NOTIFY -
INDICATE -
GATT ONREAD -
GATT ONWRITE -
GATT ONCONNECT
GATT ONDISCOVER -
ADVERT
SCAN
ACTIVE -
DUPLICATES -
BTPOKE
BTPEEK