#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);
}
-
A different user asked the same question a few days ago. Are you this user? As written in the comments for these questions, you should always include the full error message into the question. "There are no errors" is just wrong, simce you mention the error right before that– chrislCommented Mar 26, 2020 at 20:49
-
For which board are you compiling the code? And provide a link to the smartinventory library– chrislCommented Mar 26, 2020 at 20:49
-
The SmartInventor library is only for the Rokit Smart board. Why are you trying to use it with an Arduino Mega?– MajenkoCommented Mar 26, 2020 at 21:00
Add a comment
|
1 Answer
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.
-
-
1
-
Im just gonna write a new code for the mega2560 Arduino board. Can you guys tell me how to write the same code that I did with Rokit smart but in the Arduino language Commented Mar 26, 2020 at 22:49
-
That all depends what it is you are trying to do, and what you are trying to do it to.– MajenkoCommented Mar 26, 2020 at 23:03
-
1No clue. How are you connecting the motors? You must have since kind of motor shield. I suggest you start by looking at the examples given by the manufacturer of that shield.– MajenkoCommented Mar 26, 2020 at 23:45