Hello all! One of things on Team BNS we have been trying to figure out is ways of sending and receiving data on the fly to be able to better debug our robots. Our initial approach to this is to use an HC-05 Bluetooth module that connects into the extra UART port on the cortex. There are a lot of advantages to using the HC-05 module like this, such as many computers and phones have bluetooth built in, so connecting to your robot should be pretty straight forward. Additionally, being able to send data to the robot will allow for quick adjustments for things like tuning PID controllers on the fly. Finally, it’s always fun to learn about UART if you don’t know much about it yet
Now what we’ve written is a small library that does two things.
First, allows you to reprogram your HC-05 module to different names/baudrates using AT Commands. This reduces the need to breakout an additional arduino or usb->uart dongle to change these internal settings.
Second, we have included a few examples on how to send and receive data over the UART port on the Vex Cortex.
Check out the library here : https://github.com/JMarple/BNSBluetooth
NOTE: I have noticed a lot of bugs with the debug stream in RobotC 4.32, it’s recommended that 4.27 is used.
To set the HC-05 into a “reprogrammable” mode, set the key pin to 5V
Here is screenshot from my phone when running the IMEBluetoothDemo.c file.
And the wiring from the HC05 to the cortex: