Hi. So this is my first project with my first arduino and it seemed pretty simple but of course, nothing happened once I put it all together and sketched the board and I have no idea why.
I have a rc motor and the esc to go with it and I just want to make it run with a potentiometer. Nothing crazy, just speed control.
I used this sketch (changed what needed to be changed for my pin selection):
#include<Servo.h>
Servo ESC; //Using the servo library to send out pwm signal for the esc
#define esc_pin 9 // Change your pin connected to esc accordingly here
void setup(){
ESC.attach(esc_pin);
ESC.writeMicroseconds(1000);
Serial.begin(9600);
}
void loop(){
int val;
val = analogRead(6);
val = map(val, 0, 1023, 1000, 2000); // Mapping the input value(0 to 1023) from potentiometer to 1000 to 2000 pwm signal
// Change accordingly if your motor starts spinning even when potentiometer is set at 0
ESC.writeMicroseconds(val);
}
I wired it all up and turn the esc on, fan comes on but no beeps. Turning the pot does nothing, arduino has all three led lights on (one green, near usb and two in the middle of the board orange).
There's 12v power to the esc but only outputting max 6v into the arduino from one of the wires on the esc's reciever. I connected the receiver wires to the arduino. I checked which were which with a voltage meter and I'm pretty certain I have them right.
I'm using an arduino nano every
Any advice, knowledge, help, enlightenment to a glaring mistake, would be greatly appreciated!