Skip to content

Instantly share code, notes, and snippets.

@sebadima
Last active December 5, 2022 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebadima/cf418c42cd9f90387c242b468ea3af1c to your computer and use it in GitHub Desktop.
Save sebadima/cf418c42cd9f90387c242b468ea3af1c to your computer and use it in GitHub Desktop.
/*
Driver per motore elettrico brushed
- pin 9 di Arduino collegato alla base del TIP120
*/
int pinMotorino = 9;
void setup() {
Serial.begin(9600);
pinMode(pinMotorino, OUTPUT);
}
void loop() {
Serial.print("LOOP\n");
// accelerazione progressiva del motore
for(int x = 0; x <= 255; x++)
analogWrite(pinMotorino, x); delay(10);
delay(10);
}
delay(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment