Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MotorSpeed 7
- #define MotorDirection 6
- #define MotorSpeed2 5
- #define MotorDirection2 4
- void setup(){
- pinMode(MotorSpeed, OUTPUT);
- pinMode(MotorDirection, OUTPUT);
- pinMode(MotorSpeed2, OUTPUT);
- pinMode(MotorDirection2, OUTPUT);
- Serial.begin(9600);
- }
- void loop() {
- for(int motorValue = 0 ; motorValue <= 255; motorValue +=10){
- analogWrite(MotorSpeed, motorValue);
- delay(100);
- }
- {
- analogWrite(MotorSpeed, 255);
- delay(1000);
- }
- {
- for(int motorValue = 255 ; motorValue >= 0; motorValue -=10){
- analogWrite(MotorSpeed, motorValue);
- delay(100);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement