Hi!
We just got an Arduino, and got help to set it up on a RC Car. The engine is wired to pin 13, we have a ground and a power cord. The reason I'm posting here is because I've been looking everywhere to find a code that sets the rc car's speed to a desired speed. The only thing that's been working so far is to use the following code, however the car runs with the same speed every time and is not working consistently:
#include <Servo.h>
const int pin = 13;
Servo server ;
void setup() {
pinMode(pin, OUTPUT); // sets the pin as output
server.attach(pin);
}
void loop() {
server.write(180);
delay(4000);
server.detach();
delay(6000);
}
Thanks