edge lab LIVE! starts Tuesday in Munich. Grab a workshop seat and take home the board you build on. Code FRIEND-HACKSTER saves 20%. () Learn more!
Tracey Winey
Published © CC BY

Iron Camel

Our car can turn with the Arduino servo and Redboard and drive with Lego MindStorms.

IntermediateWork in progress5 hours822
Iron Camel

Things used in this project

Story

Read more

Code

Code

Arduino
Control the car
#include <Servo.h>
Servo myservo;
int potpin = 0; 
int val; 
void setup()
{
myservo.attach(9);
}
void loop()
{
val = analogRead(potpin);
// 0 and 1023)
val = map(val, 0, 1023, 0, 179);
// 180)
myservo.write(val);
delay(15);
}


  

Credits

Tracey Winey
1 project • 0 followers
Thanks to Mason, Isaiah, Johnny.

Comments