Everytime I try somthing it fails miserably. I have been reading but I'm just not getting it.
I have been trying to control a Arduino app over BLE using the Adafruit nRF8001 breakout board.
I need to have a total of 4 sliders to control Speed, 4 Switches for direction, 1 switch for Mode control, 1 Switch for Delay control 30 or 60 seconds, 1 switch to control lighting.
This is for a model train setup with 4 trains, the 4th can be a trolley so the mode control sets train/trolley mode. and in trolley mode the delay switch is read.
Attached is my current working code (arduino) that works with the hardwired switches and sliders.
I need this to work from either hardwired controls or over BLE from a android device.
Can anyone look at the working code and please help me get this working? I just keep failing at every attempt I make. Really frustrated and close to giving up.
I have read the serial pages a bunch of times but just am not getting how to do this.
A program written for Arduino needs populated by variables over ble. I have written the program to work with hardwired contols but need to have it receive variables to control the trains over ble as well as the hardwired controls. whichever is used last.
Wazhere:
A program written for Arduino needs populated by variables over ble. I have written the program to work with hardwired contols but need to have it receive variables to control the trains over ble as well as the hardwired controls. whichever is used last.
Are you expecting someone to re-write your program for you?
If I want to do this over BLE using the Adafruit nRF8001 breakout board. What would the best way be to read the data in to parse. Would I change the example code as follows....
Assuming I load the right libraries...... Is it that simple? or more complex when using BLE instead of serial console?
// Example 2 - Receive with an end-marker
const byte numChars = 32;
char receivedChars[numChars]; // an array to store the received data