O'Reilly logo

Arduino: Building exciting LED based projects and espionage devices by Marco Schwartz, Utsav Shah, Samarth Shah, Adith Jagdish Boloor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up the motor control

We are now going to set up the different parts of the project, starting with configuring the Arduino Uno, which will control the motors via Wi-Fi. For this, we'll use the aREST Arduino library, which makes it really easy to control Arduino projects via Wi-Fi.

Here is the complete code for this part:

// Robot test via aREST + WiFi #define NUMBER_VARIABLES 1 #define NUMBER_FUNCTIONS 5 // Libraries #include <Adafruit_CC3000.h> #include <SPI.h> #include <aREST.h> #include <avr/wdt.h> // CC3000 pins #define ADAFRUIT_CC3000_IRQ 3 #define ADAFRUIT_CC3000_VBAT 8 #define ADAFRUIT_CC3000_CS 10 // Robot speed #define FULL_SPEED 100 #define TURN_SPEED 50 // Motor pins int speed_motor1 = 6; int speed_motor2 = 5; int direction_motor1 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required