guys i cant do my beetle bot 3 in 1 it says 'servopulse' was not declared in this scope
hers the code

4 Replies
oh i will put the code
int servoPin = 9; //Define the pins of the steering gear
void setup() {
pinMode(servoPin, OUTPUT); //steering pin is set to output
servopulse(servoPin, 90); //Turn it to 90 degrees
delay(300); //delay 0.3S
}
void loop(){
void servopulse(int pin, int myangle) { //Impulse function
int pulsewidth = map(myangle, 0, 180, 500, 2500); //Map Angle to pulse width
for (int i = 0; i < 5; i++) { //Output a few more pulses
digitalWrite(pin, HIGH);//Set the steering gear interface level to high
delayMicroseconds(pulsewidth);//Number of microseconds of delayed pulse width value
digitalWrite(pin, LOW);//Lower the level of steering gear interface
delay(20 - pulsewidth / 1000);
digitalWrite(pin, LOW);//Lower the level of steering gear interface delay(20 - pulsewidth / 1000); }
} here so can you fi xit?
digitalWrite(pin, LOW);//Lower the level of steering gear interface delay(20 - pulsewidth / 1000); }
} here so can you fi xit?
:PostOnlyInOneChannel:
oh so can i dm them
oh ok
š
so its good?
the board is a keyestudio
nano
oh ok
ty so much
I have no idea what you are trying to do but as nis said you have syntax errors. This code will at least compile: