FUN WITH COOL KIT. Kit Purpose Have fun assembling and programming a simple robot – Includes...

download FUN WITH COOL KIT. Kit Purpose Have fun assembling and programming a simple robot – Includes chassis, wheels, motors, motor driver, IR sensor and arduino.

If you can't read please download the document

Transcript of FUN WITH COOL KIT. Kit Purpose Have fun assembling and programming a simple robot – Includes...

  • Slide 1
  • FUN WITH COOL KIT
  • Slide 2
  • Kit Purpose Have fun assembling and programming a simple robot Includes chassis, wheels, motors, motor driver, IR sensor and arduino micro controller Batteries and breadboard not included. Will Program the robot to use two motors to move, and use an IR sensor to detect the environment and adjust accordingly. You are limited only by your own imagination and tools.
  • Slide 3
  • STEPS 1)READ and follow these INSTRUCTIONS. 2)OPEN THE KIT. 1)ASSIDE FROM THE ROBO BATTERIES AND BREADBOARD NOT INCLUDED YOU WILL NEED TO BUY AT LEAST 4xAA BATTERIES
  • Slide 4
  • 3)ASSEMBLE THE ROBO, USING THE INSTRUCTIONS PROVIDED IN THE KIT. (Fairly easy 5-10min) WILL LOOK LIKE THIS
  • Slide 5
  • 4)TEST THE MOTORS USING BATTERIES DONT WORRY POLARITY DOES NOT MATTER, YOU SHOULD SEE THE MOTOR SPIN.
  • Slide 6
  • 5) Electrical Connections Connect Arduino, motor driver and motors to the breadboard..
  • Slide 7
  • Left side only
  • Slide 8
  • Right side only
  • Slide 9
  • Program Arduino 1. Install Arduino environment at arduino.cc Downloads Tab, download Arduino 1.0.5 for your OS. 2. Connect the Arduino Board to the cpu, let it install the hardware. 3. Select the tools tab Board, Select your board 4. Tool tab Serial Port, Select your Port. 5. Upload the example program provided next pg.
  • Slide 10
  • Example program (will only work if you connected everything exactly as stated in the slides) after you upload, robo will go forward, then spin right, spin left, reverse, then repeats. int pwA = 5; int pwB = 6; int motoroneAR = 7; //Right Motor //Ain1 int motoroneAL = 4; int motortwoBR = 8; int motortwoBL = 9; //Left Motor int stby = 11; void setup() { pinMode(pwA, OUTPUT); pinMode(pwB, OUTPUT); pinMode(motoroneAR, OUTPUT); pinMode(motoroneAL, OUTPUT); pinMode(motortwoBR, OUTPUT); pinMode(motortwoBL, OUTPUT); pinMode(stby, OUTPUT); Serial.begin(9600); } void loop() { digitalWrite(stby, HIGH); for(int i = 0; i < 4; i++) { Serial.println(i); delay(10); //Forward if(i=1 & i =2 & i =3) { analogWrite(pwA,150); analogWrite(pwB,150); digitalWrite(motoroneAR, HIGH); digitalWrite(motoroneAL, LOW); digitalWrite(motortwoBR, HIGH); digitalWrite(motortwoBL, LOW); delay(500); } delay(1500); }