#include <SmartInventor.h>
void setup() {
SmartInventor.DCMotorUse();
}
void loop() {
// M1, M2, M3
// CW, CCW, STOP
// 0-100
// 0-360
SmartInventor.DCMotor(M1, CW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0);
delay(5000);
SmartInventor.DCMotor(M1, CCW, 10); //Music starts //0:00:06
delay(2000);
SmartInventor.DCMotor(M1, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0);
delay(11000);
SmartInventor.DCMotor(M1, CW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0); //Music stops //0:00:32
delay(10000);
SmartInventor.DCMotor(M1, CW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0);
delay(5000);
SmartInventor.DCMotor(M1, CCW, 10);
delay(1000);
SmartInventor.DCMotor(M1, CW, 10); //Music starts back up //0:00:44
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0);
delay(18000);
SmartInventor.DCMotor(M1, CCW, 10);
delay(3000);
SmartInventor.DCMotor(M1, CW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 10);
delay(8000);
SmartInventor.DCMotor(M1, CW, 10); //Music stops //0:01:15
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0);
delay(5000);
SmartInventor.DCMotor(M1, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M1, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0);
delay(3000);
SmartInventor.DCMotor(M1, CW, 10);
delay(2000);
SmartInventor.DCMotor(M1, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0); //Music starts up agian //0:01:31
delay(11000);
SmartInventor.DCMotor(M1, CW, 10);
delay(2000);
SmartInventor.DCMotor(M1, CW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0); //Music stops //0:02:03
delay(23000);
SmartInventor.DCMotor(M1, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0); //Music starts up agian //0:02:14
delay(12000);
SmartInventor.DCMotor(M1, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0);
delay(6000);
SmartInventor.DCMotor(M1, CW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0);
delay(6000);
SmartInventor.DCMotor(M1, CCW, 10); //Music Ends //0:02:40
delay(2000);
SmartInventor.DCMotor(M1, CW, 10);
delay(2000);
SmartInventor.DCMotor(M1, STOP, 0);
delay(3000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(5000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000)
;SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(13000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(13000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(13000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000)
;SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CCW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(2000);
SmartInventor.DCMotor(M2, CW, 10);
delay(2000);
SmartInventor.DCMotor(M2, STOP, 0);
delay(7000);
}
Asked
Active
Viewed 418 times
0
1 Answers
1
The SmartInventor library is to be used with the Rokit Smart board. That board is based around the ATMega32.
The Arduino Mega is not a Rokit Smart board, so the library will not work, since the Arduino Mega us based around the ATMega2560. The two chips are different, and have different sets of internal peripherals. So the registers have different names accordingly.
Majenko
- 105,851
- 5
- 82
- 139