Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int motorPin = 9;
- void setup() {
- // put your setup code here, to run once:
- pinMode(motorPin, OUTPUT);
- Serial.begin(9600);
- }
- void loop() {
- for(int i = 0; i<255; i++){
- analogWrite(motorPin,i);
- delay(10);
- }
- delay(100);
- for(int i = 255; i>0; i--){
- analogWrite(motorPin,i);
- delay(10);
- }
- delay(100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement