Skip to content
Controlling your ARCobot
- Your ARCobot’s ESP8266 microcontroller is
- a NodeMCU DevKit v2
- mounted on a NodeMCU Motor Shield
- running custom firmware
- connected via WiFi
- running an internal web server
- controlled using HTTP commands
- Send commands to the bot’s web server. In examples following, bot address is 192.168.1.101. For example:
192.168.1.101/ returns "Hello" message
192.168.1.101/motor?m=500,1,500,1
tells motor 1 go at speed 500 in direction 1, motor 2 go at speed 500 in direction 1
192.168.1.101/motor?m=500,1,900,0
tells motor 1 go at speed 500 in direction 1, motor 2 go at speed 900 in direction 0
192.168.1.101/digitalWrite?d=14,1
turns on pin 14 (which is 5 on the motor board)
192.168.1.101/digitalWrite?d=14,0
turns off pin 14
192.168.1.101/analogWrite?d=14,150
turns on pin 14 to value 150
192.168.1.101/analogread?
reports the value of the analog input
- Supported commands:
- /
- returns “Hello” message from bot
- /motor
- commands motor
- speeds are 0-1023
- /timedMove:
- format: motor 1 speed, motor 1 direction, motor 2 speed, motor 2 direction, time in milliseconds
- /digitalWrite
- /lineFollow:
- enable=1/disable=0,side 0=right/1=left, motor speed, time or distance-t or d, time value millisec or distance value cm
- /analogWrite
- Valid values are 0-1023 for analog
- /analogRead
- /distanceWait
- /distance
- /tempHumRead:
- Reading temperature or humidity takes about 250 milliseconds!
- Sensor readings may also be up to 2 seconds ‘old’ (is a very slow sensor)
- We will control our bots using Snap! These templates and sprites get us started (right-click to download. Choose “Save link as…“):