@zoomkat , I have brought at 80A redbrick esc and am attempting to use it with arduino to make and electric skateboard for my school project.
I read your previous discussion and attempted to use your code as the code I made myself ...
#include <Servo.h>
const int pot = A0;
int potval=0;
int escval=0;
Servo ESC; // create servo object to control the ESC
void setup() {
pinMode (pot,INPUT);
Serial.begin(9600);
ESC.attach(5,1000,2000); // (pin, min pulse width, max pulse width in microseconds)
}
void loop() {
potval=analogRead (pot);
escval= map(potval,0,1024,1000,1200);
ESC.write(escval); // Send the signal to the ESC
Serial.println(escval);
}
did not work and simply caused my motor to spin very randomly, I cant seem to find any other help that exists online. I would really appreciate if you could explain how to make your code works. I'm trying to just make the motor spin at variable speeds.
It is not as simple as connecting the ESC and you are done.
Most ESCs have some kind of a calibration method.
Many ESCs have a protection against start running if the throttle-signal is not throttle-off on power-on of the ESC.
So simply explaining the code that works with a certain ESC is not enough.
You should provide the user-manual of your ESC.
The values inside this map-function-call 1000,1200 is odd.
Usually a RC-ESC-signal goes from 1000 to 2000 (not only 1200)
Anyway without knowing how your ESC reacts on what signal on power-on
and
without knowing how to calibrate your ESC you are just experimenting on wild guessings.
So in fact you are building a servo tester. You may want to consider to buy one, so you can calibrate the ESC with it and maybe even don't need the Arduino at all.
yeah i should have explained that. My school doesnt want me using the full power whilst in the building for safety reasons so this was simply a way to limit the output to a small fraction of the max,
either way thank you for your quick replies. I am going to look at the manual today and try and program it using an rc controller before i try and use an arduino to control it (as the manual says). I will let you know how it goes