Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 2.31 KB

README.md

File metadata and controls

50 lines (30 loc) · 2.31 KB

Robot

Model: UCTRONICS K0070

Bluetooth module: HC-06

Dependencies

Build

  1. Assemble the robot according to the instructions in the manuals directory.
  2. Follow the instructions in Chapter 7.2 of K0070.pdf to set up the Smart Robot Car libraries and connect to the Arduino Uno's serial port.

⚠️ Take note - you cannot program the Arduino while the Bluetooth module is connected.

  1. Open the robot car Scratch in the Arduino IDE.

  2. Upload the sketch onto the Arduino.

Run

  1. Disconnect the robot car from your machine.
  2. Attach the Bluetooth module.
  3. Turn on the robot car.
  4. Pair your computer with the robot car's Bluetooth module. Out of the factory, the module appears with the name HC-06.

⚠️ If you have just as bad luck as us, fully connecting to the Bluetooth module on macOS after pairing will cause this whole thing to break. Completely remove the module from your Bluetooth settings and re-pair. Leave the module paired but not connected. Don't ask us why this is required.

  1. Start or finish setting up the Erlang server.

Troubleshooting

Re-programming the HC-06

Glad to see you've got the same headache we did. There's a good chance your HC-06 is operating at a different baud rate than you specified to the Erlang app.

You can use the set-baud-rate sketch to try and reset the baud rate.

  1. Read the sketch and make changes as fit.
  2. Program the Arduino using the sketch.
  3. Disconnect the robot.
  4. Reconnect the Bluetooth module.
  5. See if the new name appears in your machine's Bluetooth settings, indicating that the changes took effect.

Misc

  • bt-test.c is based on rfcomm-serial-setname.c and was used for testing communication with the BT module/Arduino while the Erlang app was under development. At this point, it might just be easier to use the Erlang code.