How to Control Motor With the Tactigon - Part II
by The Tactigon in Circuits > Arduino
215 Views, 4 Favorites, 0 Comments
How to Control Motor With the Tactigon - Part II
![How to Control DC Motors With The Tactigon](/proxy/?url=https://content.instructables.com/F8S/ICYS/JA8JEQI4/F8SICYSJA8JEQI4.jpg&filename=How to Control DC Motors With The Tactigon)
As we saw in the previous article (Tutorial – How to control motor with The Tactigon – Part I – Hardware), The Tactigon can be connected to a serial motor control board. In this article we’ll look at how to handle it via software. The Tactigon will receive commands sent by the controller connected in BLE, and will communicate to the motor control board motor speeds.
Sketch
![2017-11-22 16_16_34-Tutorial - How to control motor with The Tactigon - Part II - Sketch - The Tacti.png](/proxy/?url=https://content.instructables.com/FRL/68FJ/JA8JEQRW/FRL68FJJA8JEQRW.png&filename=2017-11-22 16_16_34-Tutorial - How to control motor with The Tactigon - Part II - Sketch - The Tacti.png)
Serial Transmission
![1_libs.png](/proxy/?url=https://content.instructables.com/FL2/1IMK/JA8JEQRH/FL21IMKJA8JEQRH.png&filename=1_libs.png)
![2_var.png](/proxy/?url=https://content.instructables.com/F24/396K/JA8JEQRI/F24396KJA8JEQRI.png&filename=2_var.png)
![3_callback.png](/proxy/?url=https://content.instructables.com/FGP/D954/JA8JEQRK/FGPD954JA8JEQRK.png&filename=3_callback.png)
![4_setup.png](/proxy/?url=https://content.instructables.com/FER/NYOM/JA8JEQRL/FERNYOMJA8JEQRL.png&filename=4_setup.png)
![5_loop.png](/proxy/?url=https://content.instructables.com/FIF/OH3U/JA8JEQRV/FIFOH3UJA8JEQRV.png&filename=5_loop.png)
The Tactigon UART library exposes a function to send chars. We use this library to communicate with the motor control board.
We prepare a callback to be triggered when the BLE Characteristic receives something:
In the setup() we initialize LEDs and turn them off, initialize the BLE Peripheral Mode, create the BLE Characteristic and its UUID, and assign the callbacks created.
Since callbacks handle serial communication, loop() will only cycle LEDs.
Conclusion
The Tactigon UART library gave us the ability to control a tracked rover, but everything with an UART interface can be connected to The Tactigon. Remember to download the source code!