Programming the Buggy
Programming the Buggy involves three stages: creating the Redkea app, writing the code and programming the WiFi3 click and finally, programming the Clicker2 board.
The main idea of this project is to have the ESP8266 connect to WiFi and take commands from the redkea app, then send the command code over the serial interface. The PIC32MX microcontroller onboard the clicker2 board receives and parses the commands and then drives the Buggy accordingly. This way I can get over the limited I/O capability of ESP8266.
Developing the Redkea application
I have to admit; I like Redkea a lot. I can create quite complex Android apps without writing a single line of code 🙂 The only thing I miss is that it doesn’t work on iOS devices.
So, this is how my application looks in Redkea.
The application uses five touch buttons for driving the Buggy, two switches to control the lights, and one slider to set the speed.
Each widget triggers an user function, as follows:
- Touch buttons
- gofwd – drives the Buggy forward
- goback – drives the Buggy in reverse
- stopbuggy – slams the brakes
- goleft – left turn
- goright – right turn
- lights – turn on and off the headlights
- main_beam – controls the main beam
- myspeed – sets the Buggy speed in the 0-1023 interval
Below are some screen captures of the widgets, as a reference: