First you need to download the documentation and base source codes from http://www.elegoo.com website for Elegoo Smart Robot Car.
Note: I use steps instead of continuously moving.
Bluetooth remote control with node.js app by SerialPort package, it use standard input/output for communication.
Arduino sketch: bluetooth.remote.control
Nodejs app: bluetooth.remote.control.nodejs
- Turn on the vehicle,
- Connect the
HC-06
bluetooth device to your Macbook (System Preferences/Bluetooth, Default password: 1234) - Install dependencies -
npm install
- Start the node script by
node index.js
command - Now you can control your car by
W,S,A,D + ENTER
commands.
Arduino software: Sketch -> Include library -> Add .ZIP library -> IRremote.zip
Moving by steps: infrared.remote.control.ino
Linux issue fix:
// avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
$ sudo usermod -a -G dialout <username>
$ sudo chmod a+rw /dev/ttyACM0
Tutorial: Cheap 2 Way Bluetooth Connection Between Arduino and PC
Sketches: /arduino.uno/bluetooth/
Tested with HC-06 bluetooth device on OSX. Follow above instractions from tutorial and when you connected your HC-06 bluetooth device to Arduino Uno and the sketch is uploaded. Open iTerm2 app on OSX.
Check your serial devices: ls /dev/tty.*
611 crw-rw-rw- 1 root wheel 18, 0 28 Dec 11:34 /dev/tty.Bluetooth-Incoming-Port
1273 crw-rw-rw- 1 root wheel 18, 86 28 Dec 16:27 /dev/tty.HC-06-DevB
Connect to Arduino over bluetooth by screen: screen /dev/tty.HC-06-DevB 9600
.
Send data from Arduino to PC
Arduino counter: 1
Arduino counter: 2
Send data to Arduino from PC
Press 1 to turn Arduino pin 13 LED ON or 0 to turn it OFF
Screen help: http://ss64.com/osx/screen.html
- Kill screen:
CTRL+A K
- Detach screen:
CTRL+A D
- List screens:
screen -list
- Reattach to screen:
screen -r tty.HC-06-DevB