0
#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 – chrisl Mar 26 at 20:49
  • For which board are you compiling the code? And provide a link to the smartinventory library – chrisl Mar 26 at 20:49
  • The SmartInventor library is only for the Rokit Smart board. Why are you trying to use it with an Arduino Mega? – Majenko Mar 26 at 21:00
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.

| improve this answer | |
  • Ok so what board can I use for Rokit smart – user64079 Mar 26 at 21:24
  • 1
    The Rokit Smart. – Majenko Mar 26 at 21:40
  • 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 – user64079 Mar 26 at 22:49
  • That all depends what it is you are trying to do, and what you are trying to do it to. – Majenko Mar 26 at 23:03
  • 1
    No 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. – Majenko Mar 26 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.