Scripting in RN4020 Bluetooth low energy chip

Thread Starter

iqbalpalemad

Joined Nov 4, 2016
1
hai

i am looking for programming nr4020 on microchip pictail board. Now i am trying to do a scripting.But i dont know how to do it . i have gone through the user guide of nr4020 . i found the following demonstration

+ // Echo on
SF,1 // Factory Reset
SS,00000001 // Enable private service
SR,00000000 // Set as Peripheral
PZ // Clean private Service
PS,123456789012345678901234567890FF // Set private service UUID
PC,12345678901234567890123456789011,12,02 // Set private
// characteristic to be readable, notifiable and 2 bytes
// in length
PC,12345678901234567890123456789022,02,02 // Set private
// characteristic to be readable and 2 bytes in length
R,1 // Reboot



its all working fine


then i have done these steps'

WC // Clean script
WW // Enter script input mode


after that i want to input these lines

@PW_ON
# start advertisement
A
# define range of variable $VAR1
$VAR1 < “0300”
# associate handle 0x000E to reading of AIO2
%000E = @I,2
@CONN
# set timer 1 to be around 5 seconds
SM,1,00500000
@TMR1
# read AIO0
$VAR1 = @I,0
# set handle 0x000B to the AIO0 value
SHW,000B,$VAR1
# restart timer
SM,1,00500000


but here i dont know how to input line by line so i used enter after each line and finally Esc then these steps

SR,01000000 // Run script after power on
R,1 // Reboot


but after reboot which doesn't show any ble signal

i am using ble scanner on android to detect the ble and Tera Term as the terminal


thank you
 
Top