Hello everyone, i got a hoverboard motor as a gift from a friend and i was thinking of putting to use. it has a common lead + the 3 wires, i was thinking of putting that common lead to a + source and drive the rest with 3 MOSFETs with this code, do i need anything else ? Do i need something between the coil and the power source ? is 1 second "on" too much ? any other ideea is welcome
Code:
void setup() {
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(80, OUTPUT);
pinMode(A0, INPUT);
}
void loop() {
int value = analogRead(A0);
digitalWrite(8, HIGH);
delay(value);
digitalWrite(8, LOW);
delay(value);
digitalWrite(9, HIGH);
delay(value);
digitalWrite(9, LOW);
delay(value);
digitalWrite(10, HIGH);
delay(value);
digitalWrite(10, LOW);
delay(value);
}