Just to make my previous post clearer, I have created a new button in the example BLE app provided by Lerg dedicated for turning an LED on. My Arduino has been programmed to accept a non zero serial value to turn the LED on or a zero value to turn the LED off. I have tested this with a pre-built Evothings app and it works fine.
I just have no idea of how to enable the example BLE app to send a value of 1 or 0 to the HM10 ble module that I using for my project.
Here is the code for the button, not sure what to add to the onRelease section:
local ledOn = widget.newButton
{ width = 250,
height = 40,
defaultFile = “buttonbackground.png”,
overFile = “buttonbackground1.png”,
shape = “roundedRect”,
labelColor = { default={ 0, 0, 0 }, over={ 0, 0, 0 } },
font = native.systemFontBold,
fillColor = { default={ 1, 1, 1, 1 }, over={ 0.65, 0.65, 0.65, 1 } },
label = ‘LED ON’,
– onRelease
NEED HELP WITH THIS SECTION TO ALLOW FOR 1 TO BE SENT OVER THE BLE CONNECTION, PLEASE.
}
ledOn.x = display.contentCenterX
ledOn.y = display.contentHeight- 20