├── MMKIT ├── doc │ ├── bc_s.png │ ├── bdwn.png │ ├── doc.png │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── open.png │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ ├── closed.png │ ├── doxygen.png │ ├── sync_on.png │ ├── arrowdown.png │ ├── arrowright.png │ ├── folderopen.png │ ├── mmkit_logo.png │ ├── splitbar.png │ ├── sync_off.png │ ├── folderclosed.png │ ├── tabs.css │ ├── index.html │ ├── dir_d28a4824dc47e487b107a5db32ef43c4.html │ ├── dir_9fd43cbf431ad4345d64cbab9841c2b6.html │ ├── dir_9691a6dd1b06df846066475a1be4cf0b.html │ ├── dir_570753ad8877dea1987cf40b0d7f5691.html │ ├── dir_6c401e1c6837dca0adcc3b899b7ea8f1.html │ ├── dir_2281310147e0fac8c8cf0985ec60de65.html │ ├── dir_93c0f6084947c07eb7b438496d1cfde6.html │ ├── dir_dbb79cb84dde56bb04f2d47dfbfaeb94.html │ ├── dir_e95d46c41705e2e75f2dcb6c6d7c71ef.html │ ├── annotated.html │ ├── classes.html │ ├── BluetoothCom_2robotMove_8ino.html │ ├── Basic_2MoveFoward_2Acceleration_8ino.html │ ├── MMkitSeqMotion_2robotMove_8ino.html │ ├── RightWallFollow_2robotMove_8ino.html │ ├── Advanced_2TestUART1_2Acceleration_8ino.html │ ├── Advanced_2BluetoothCom_2Acceleration_8ino.html │ ├── BluetoothCom_2nextMove_8ino.html │ ├── FloodFillAlgorithm_2robotMove_8ino.html │ ├── FloodFillAlgorithm_2nextMove_8ino.html │ ├── MMkitSeqMotion_2nextMove_8ino.html │ ├── Advanced_2MMkitSeqMotion_2Acceleration_8ino.html │ ├── Advanced_2RandomNextMove_2Acceleration_8ino.html │ ├── Advanced_2RightWallFollow_2Acceleration_8ino.html │ ├── Advanced_2TesteMicromouse_2Acceleration_8ino.html │ ├── RightWallFollow_2nextMove_8ino.html │ ├── odometry_8ino.html │ ├── Advanced_2FloodFillAlgorithm_2Acceleration_8ino.html │ ├── dir_97206bf5efc8a056e59b25e67411479c.html │ ├── dynsections.js │ ├── dir_8e882013ad34d926fe87124bd6638b00.html │ ├── dir_83ae17484a6bf3bb38cfccb0fdab562b.html │ ├── dir_8d38b807a6e3e45699ecf424d534bc3d.html │ ├── Test__Button_8ino.html │ ├── structMMkit_1_1cell-members.html │ ├── dir_6a1f418063e6d5990bbad65b4484ba91.html │ ├── dir_592569b4388661b9b54987c21ff28f23.html │ ├── dir_49c0c3b1034d927ad83ff3370afdee52.html │ ├── Button__switch_8ino.html │ ├── Button__switch__Bin_8ino.html │ └── dir_86087c4770309f08313423a25610c00b.html ├── examples │ ├── Advanced │ │ ├── TestUART1 │ │ │ ├── Acceleration.ino │ │ │ └── TesteUART1.ino │ │ ├── MMkitSeqMotion │ │ │ ├── Acceleration.ino │ │ │ ├── robotMove.ino │ │ │ ├── nextMove.ino │ │ │ └── MMkitSeqMotion.ino │ │ ├── RandomNextMove │ │ │ ├── Acceleration.ino │ │ │ └── RandomNextMove.ino │ │ ├── FloodFillAlgorithm │ │ │ ├── Acceleration.ino │ │ │ └── robotMove.ino │ │ ├── RightWallFollow │ │ │ ├── Acceleration.ino │ │ │ ├── nextMove.ino │ │ │ ├── robotMove.ino │ │ │ ├── odometry.ino │ │ │ └── RightWallFollow.ino │ │ ├── TesteMicromouse │ │ │ ├── Acceleration.ino │ │ │ └── TesteMicromouse.ino │ │ └── BluetoothCom │ │ │ ├── Acceleration.ino │ │ │ ├── robotMove.ino │ │ │ ├── nextMove.ino │ │ │ └── BluetoothCom__new.ino │ └── Basic │ │ ├── MoveFoward │ │ ├── Acceleration.ino │ │ └── MoveFoward.ino │ │ ├── TurnLeft │ │ └── TurnLeft.ino │ │ ├── TurnRight │ │ └── TurnRight.ino │ │ ├── Test_Button │ │ └── Test_Button.ino │ │ ├── Button_switch │ │ └── Button_switch.ino │ │ ├── Button_switch_Bin │ │ └── Button_switch_Bin.ino │ │ └── TesteIRSensors │ │ └── TesteIRSensors.ino ├── .gitattributes ├── .gitignore ├── README.md └── keywords.txt ├── AccelStepper ├── doc │ ├── tab_b.gif │ ├── tab_l.gif │ ├── tab_r.gif │ ├── doxygen.png │ ├── tabs.css │ ├── files.html │ └── annotated.html ├── examples │ ├── ConstantSpeed │ │ └── ConstantSpeed.pde │ ├── Bounce │ │ └── Bounce.pde │ ├── Blocking │ │ └── Blocking.pde │ ├── Random │ │ └── Random.pde │ ├── Overshoot │ │ └── Overshoot.pde │ ├── AFMotor_ConstantSpeed │ │ └── AFMotor_ConstantSpeed.pde │ ├── ProportionalControl │ │ └── ProportionalControl.pde │ ├── Quickstop │ │ └── Quickstop.pde │ ├── MultiStepper │ │ └── MultiStepper.pde │ ├── DualMotorShield │ │ └── DualMotorShield.pde │ ├── AFMotor_MultiStepper │ │ └── AFMotor_MultiStepper.pde │ └── MotorShield │ │ └── MotorShield.pde ├── Makefile ├── LICENSE ├── keywords.txt └── MANIFEST └── README.md /MMKIT/doc/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/bc_s.png -------------------------------------------------------------------------------- /MMKIT/doc/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/bdwn.png -------------------------------------------------------------------------------- /MMKIT/doc/doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/doc.png -------------------------------------------------------------------------------- /MMKIT/doc/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/nav_f.png -------------------------------------------------------------------------------- /MMKIT/doc/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/nav_g.png -------------------------------------------------------------------------------- /MMKIT/doc/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/nav_h.png -------------------------------------------------------------------------------- /MMKIT/doc/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/open.png -------------------------------------------------------------------------------- /MMKIT/doc/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/tab_a.png -------------------------------------------------------------------------------- /MMKIT/doc/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/tab_b.png -------------------------------------------------------------------------------- /MMKIT/doc/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/tab_h.png -------------------------------------------------------------------------------- /MMKIT/doc/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/tab_s.png -------------------------------------------------------------------------------- /MMKIT/doc/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/closed.png -------------------------------------------------------------------------------- /MMKIT/doc/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/doxygen.png -------------------------------------------------------------------------------- /MMKIT/doc/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/sync_on.png -------------------------------------------------------------------------------- /MMKIT/doc/arrowdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/arrowdown.png -------------------------------------------------------------------------------- /MMKIT/doc/arrowright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/arrowright.png -------------------------------------------------------------------------------- /MMKIT/doc/folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/folderopen.png -------------------------------------------------------------------------------- /MMKIT/doc/mmkit_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/mmkit_logo.png -------------------------------------------------------------------------------- /MMKIT/doc/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/splitbar.png -------------------------------------------------------------------------------- /MMKIT/doc/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/sync_off.png -------------------------------------------------------------------------------- /AccelStepper/doc/tab_b.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/AccelStepper/doc/tab_b.gif -------------------------------------------------------------------------------- /AccelStepper/doc/tab_l.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/AccelStepper/doc/tab_l.gif -------------------------------------------------------------------------------- /AccelStepper/doc/tab_r.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/AccelStepper/doc/tab_r.gif -------------------------------------------------------------------------------- /MMKIT/doc/folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/MMKIT/doc/folderclosed.png -------------------------------------------------------------------------------- /AccelStepper/doc/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sergiosilvaglobaltronic/MMkit/HEAD/AccelStepper/doc/doxygen.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | It provides an object-oriented interface for Micromouse Kit Robot 2 | 3 | Micromouse Kit library For information on installing libraries, see: http://arduino.cc/en/Guide/Libraries The MMkit is a library that helps you to program the MMKit There are several examples: 4 | 5 | Basic: MoveFoward TurnLeft TurnRight TesteIRSensors 6 | 7 | Advanced: FloodFillAlgorithm RandomNextMove RightWallFollow 8 | 9 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/TestUART1/Acceleration.ino: -------------------------------------------------------------------------------- 1 | /**@file acceleration.ino*/ 2 | void acceleration(void) 3 | { 4 | unsigned long currentMicros = micros(); 5 | if (currentMicros>= previousMicros + 900) { 6 | previousMicros = currentMicros; 7 | if (aceleration <= velocidade) { 8 | Grigoras.setForwardMotionSpeed((int) aceleration); 9 | aceleration = aceleration + aceleration / 100; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /MMKIT/examples/Basic/MoveFoward/Acceleration.ino: -------------------------------------------------------------------------------- 1 | /**@file acceleration.ino*/ 2 | void acceleration(void) 3 | { 4 | unsigned long currentMicros = micros(); 5 | if (currentMicros>= previousMicros + 900) { 6 | previousMicros = currentMicros; 7 | if (aceleration <= velocidade) { 8 | Grigoras.setForwardMotionSpeed((int) aceleration); 9 | aceleration = aceleration + aceleration / 100; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/MMkitSeqMotion/Acceleration.ino: -------------------------------------------------------------------------------- 1 | /**@file acceleration.ino*/ 2 | void acceleration(void) 3 | { 4 | unsigned long currentMicros = micros(); 5 | if (currentMicros>= previousMicros + 900) { 6 | previousMicros = currentMicros; 7 | if (aceleration <= velocidade) { 8 | Grigoras.setForwardMotionSpeed((int) aceleration); 9 | aceleration = aceleration + aceleration / 100; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/RandomNextMove/Acceleration.ino: -------------------------------------------------------------------------------- 1 | /**@file acceleration.ino*/ 2 | void acceleration(void) 3 | { 4 | unsigned long currentMicros = micros(); 5 | if (currentMicros>= previousMicros + 900) { 6 | previousMicros = currentMicros; 7 | if (aceleration <= velocidade) { 8 | Grigoras.setForwardMotionSpeed((int) aceleration); 9 | aceleration = aceleration + aceleration / 100; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/FloodFillAlgorithm/Acceleration.ino: -------------------------------------------------------------------------------- 1 | /**@file acceleration.ino*/ 2 | void acceleration(void) 3 | { 4 | unsigned long currentMicros = micros(); 5 | if (currentMicros>= previousMicros + 900) { 6 | previousMicros = currentMicros; 7 | if (aceleration <= velocidade) { 8 | Grigoras.setForwardMotionSpeed((int) aceleration); 9 | aceleration = aceleration + aceleration / 100; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/RightWallFollow/Acceleration.ino: -------------------------------------------------------------------------------- 1 | /**@file acceleration.ino*/ 2 | void acceleration(void) 3 | { 4 | unsigned long currentMicros = micros(); 5 | if (currentMicros>= previousMicros + 900) { 6 | previousMicros = currentMicros; 7 | if (aceleration <= velocidade) { 8 | Grigoras.setForwardMotionSpeed((int) aceleration); 9 | aceleration = aceleration + aceleration / 100; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/TesteMicromouse/Acceleration.ino: -------------------------------------------------------------------------------- 1 | /**@file acceleration.ino*/ 2 | void acceleration(void) 3 | { 4 | unsigned long currentMicros = micros(); 5 | if (currentMicros>= previousMicros + 900) { 6 | previousMicros = currentMicros; 7 | if (aceleration <= velocidade) { 8 | Grigoras.setForwardMotionSpeed((int) aceleration); 9 | aceleration = aceleration + aceleration / 100; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /MMKIT/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/BluetoothCom/Acceleration.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | void acceleration(void) 3 | { 4 | if (aceleration<=velocidade){ 5 | Grigoras.setForwardMotionSpeed((int) aceleration); 6 | aceleration=aceleration+aceleration/100; 7 | //Serial.println((int) aceleration); 8 | delayMicroseconds(900); 9 | }else{ 10 | //Serial.println((int) aceleration); 11 | //delayMicroseconds(900); 12 | delayMicroseconds(900); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/MMkitSeqMotion/robotMove.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | void robotMove(void) 3 | { 4 | a=a+1; 5 | switch (a) { 6 | case STATE_MOV_IDLE: 7 | Grigoras.stop(); 8 | delay(2000); 9 | break; 10 | 11 | case STATE_MOV_FRONT: 12 | turn=false; 13 | Grigoras.goForward(18.0); 14 | break; 15 | case STATE_MOV_RIGHT: 16 | turn=true; 17 | Grigoras.rotate(90); 18 | break; 19 | case STATE_MOV_LEFT: 20 | turn=true; 21 | Grigoras.rotate(-90); 22 | break; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/MMkitSeqMotion/nextMove.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | unsigned char nextMove(unsigned char State) 3 | { 4 | unsigned char nMove=State; 5 | switch (nMove) { 6 | case STATE_MOV_FRONT: //se andou em frente 7 | nMove=STATE_MOV_RIGHT; //choose a random move Left or Right 8 | return nMove; 9 | break; 10 | case STATE_MOV_RIGHT: 11 | return STATE_MOV_FRONT; 12 | break; 13 | case STATE_MOV_LEFT: 14 | return STATE_MOV_FRONT; 15 | break; 16 | default: 17 | digitalWrite(13,LOW); 18 | return STATE_MOV_FRONT; 19 | break; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MMKIT/examples/Basic/TurnLeft/TurnLeft.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | #include 3 | #include 4 | AccelStepper motorLeft(AccelStepper::DRIVER, 9, 8); 5 | AccelStepper motorRight(AccelStepper::DRIVER, 11, 10); 6 | MMkit MMKIT(motorLeft, motorRight); 7 | 8 | void setup(){ 9 | Serial.begin(9600); 10 | MMKIT.setupMMkit(); 11 | MMKIT.rotateLeft(90); // or use MMKIT.rotate(-90); 12 | MMKIT.setForwardMotionSpeed(500); 13 | delay(2000); 14 | } 15 | 16 | void loop(){ 17 | if(MMKIT.running()==true) { 18 | MMKIT.run(); 19 | }else{ 20 | MMKIT.stop(); 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /MMKIT/examples/Basic/TurnRight/TurnRight.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | #include 3 | #include 4 | AccelStepper motorLeft(AccelStepper::DRIVER, 9, 8); 5 | AccelStepper motorRight(AccelStepper::DRIVER, 11, 10); 6 | MMkit MMKIT(motorLeft, motorRight); 7 | 8 | void setup(){ 9 | Serial.begin(9600); 10 | MMKIT.setupMMkit(); 11 | MMKIT.rotateRight(90); // or use MMKIT.rotate(90); 12 | MMKIT.setForwardMotionSpeed(500); 13 | delay(2000); 14 | } 15 | 16 | void loop(){ 17 | if(MMKIT.running()==true) { 18 | MMKIT.run(); 19 | }else{ 20 | MMKIT.stop(); 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /MMKIT/examples/Basic/Test_Button/Test_Button.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | /* 3 | This example was created by Sérgio Silva 4 | on the 20th April 2015 5 | 6 | This code example is in the public domain. 7 | 8 | Description: 9 | The LED on pin 13 RED LED turns ON when one of the switch is ON 10 | 11 | */ 12 | void setup() { 13 | pinMode(2, INPUT); 14 | pinMode(3, INPUT); 15 | pinMode(13, OUTPUT); 16 | 17 | } 18 | 19 | void loop() { 20 | //read the pushbutton value and light RED led 21 | if (digitalRead(3)||digitalRead(2)) { 22 | digitalWrite(13, HIGH); 23 | } else{ 24 | digitalWrite(13, LOW); 25 | } 26 | } 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /AccelStepper/examples/ConstantSpeed/ConstantSpeed.pde: -------------------------------------------------------------------------------- 1 | // ConstantSpeed.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Shows how to run AccelStepper in the simplest, 5 | // fixed speed mode with no accelerations 6 | /// \author Mike McCauley (mikem@airspayce.com) 7 | // Copyright (C) 2009 Mike McCauley 8 | // $Id: ConstantSpeed.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ 9 | 10 | #include 11 | 12 | AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 13 | 14 | void setup() 15 | { 16 | stepper.setMaxSpeed(1000); 17 | stepper.setSpeed(50); 18 | } 19 | 20 | void loop() 21 | { 22 | stepper.runSpeed(); 23 | } 24 | -------------------------------------------------------------------------------- /MMKIT/.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdisk 44 | -------------------------------------------------------------------------------- /MMKIT/README.md: -------------------------------------------------------------------------------- 1 | # MMKit 2 | Micromouse Kit library 3 | For information on installing libraries, see: http://arduino.cc/en/Guide/Libraries 4 | The MMkit is a library that helps you to program the MMKit 5 | There are several examples: 6 | Basic: 7 | MoveFoward 8 | TurnLeft 9 | TurnRight 10 | TesteIRSensors 11 | Advanced: 12 | FloodFillAlgorithm 13 | RandomNextMove 14 | RightWallFollow 15 | 16 | Added cm/s on MoveFoward so if the value used on function is bellow 40cm/s the MMkit assumes that velocity else he assumes the velocity with the following formula (Value/158) cm/s, 17 | also added a new odometry function receives current_cell.theta and move 18 | updates next_theta 19 | current_cell.theta=next_theta 20 | The search speed is optimized for 9 cm/s 21 | -------------------------------------------------------------------------------- /AccelStepper/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | # 3 | # Makefile for the Arduino AccelStepper project 4 | # 5 | # Author: Mike McCauley (mikem@airspayce.com) 6 | # Copyright (C) 2010 Mike McCauley 7 | # $Id: Makefile,v 1.4 2013/03/21 21:48:27 mikem Exp mikem $ 8 | 9 | PROJNAME = AccelStepper 10 | VERSION_MAJOR = 1 11 | VERSION_MINOR = 46 12 | 13 | DISTFILE = $(PROJNAME)-$(VERSION_MAJOR).$(VERSION_MINOR).zip 14 | 15 | all: versioning doxygen dist upload 16 | 17 | versioning: 18 | sed -i.bak -e 's/AccelStepper-.*\.zip/$(DISTFILE)/' AccelStepper.h 19 | 20 | doxygen: 21 | doxygen project.cfg 22 | 23 | ci: 24 | (cd ..;ci -l `cat $(PROJNAME)/MANIFEST`) 25 | 26 | dist: 27 | (cd ..; zip $(PROJNAME)/$(DISTFILE) `cat $(PROJNAME)/MANIFEST`) 28 | 29 | upload: 30 | rsync -avz $(DISTFILE) doc/ www.airspayce.com:public_html/mikem/arduino/$(PROJNAME) 31 | -------------------------------------------------------------------------------- /AccelStepper/examples/Bounce/Bounce.pde: -------------------------------------------------------------------------------- 1 | // Bounce.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Make a single stepper bounce from one limit to another 5 | // 6 | // Copyright (C) 2012 Mike McCauley 7 | // $Id: Random.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ 8 | 9 | #include 10 | 11 | // Define a stepper and the pins it will use 12 | AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 13 | 14 | void setup() 15 | { 16 | // Change these to suit your stepper if you want 17 | stepper.setMaxSpeed(100); 18 | stepper.setAcceleration(20); 19 | stepper.moveTo(500); 20 | } 21 | 22 | void loop() 23 | { 24 | // If at the end of travel go to the other end 25 | if (stepper.distanceToGo() == 0) 26 | stepper.moveTo(-stepper.currentPosition()); 27 | 28 | stepper.run(); 29 | } 30 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/BluetoothCom/robotMove.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | void robotMove(void) 3 | { 4 | switch (stateMovement) { 5 | case STATE_MOV_IDLE: 6 | digitalWrite(13,HIGH); 7 | break; 8 | case STATE_MOV_STOP: 9 | Grigoras.stop(); 10 | delay(2000); 11 | break; 12 | case STATE_MOV_FRONT: 13 | turn = false; 14 | aceleration=1; 15 | Grigoras.goForward(18.0); 16 | break; 17 | case STATE_MOV_RIGHT: 18 | turn = true; 19 | aceleration=1; 20 | Grigoras.rotate(90); 21 | break; 22 | case STATE_MOV_UTURN: 23 | turn = true; 24 | aceleration=1; 25 | Grigoras.rotate(180); 26 | break; 27 | case STATE_MOV_LEFT: 28 | turn = true; 29 | aceleration=1; 30 | Grigoras.rotate(-90); 31 | break; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /AccelStepper/examples/Blocking/Blocking.pde: -------------------------------------------------------------------------------- 1 | // Blocking.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Shows how to use the blocking call runToNewPosition 5 | // Which sets a new target position and then waits until the stepper has 6 | // achieved it. 7 | // 8 | // Copyright (C) 2009 Mike McCauley 9 | // $Id: Blocking.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ 10 | 11 | #include 12 | 13 | // Define a stepper and the pins it will use 14 | AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 15 | 16 | void setup() 17 | { 18 | stepper.setMaxSpeed(200.0); 19 | stepper.setAcceleration(100.0); 20 | } 21 | 22 | void loop() 23 | { 24 | stepper.runToNewPosition(0); 25 | stepper.runToNewPosition(500); 26 | stepper.runToNewPosition(100); 27 | stepper.runToNewPosition(120); 28 | } 29 | -------------------------------------------------------------------------------- /AccelStepper/examples/Random/Random.pde: -------------------------------------------------------------------------------- 1 | // Random.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Make a single stepper perform random changes in speed, position and acceleration 5 | // 6 | // Copyright (C) 2009 Mike McCauley 7 | // $Id: Random.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ 8 | 9 | #include 10 | 11 | // Define a stepper and the pins it will use 12 | AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 13 | 14 | void setup() 15 | { 16 | } 17 | 18 | void loop() 19 | { 20 | if (stepper.distanceToGo() == 0) 21 | { 22 | // Random change to speed, position and acceleration 23 | // Make sure we dont get 0 speed or accelerations 24 | delay(1000); 25 | stepper.moveTo(rand() % 200); 26 | stepper.setMaxSpeed((rand() % 200) + 1); 27 | stepper.setAcceleration((rand() % 200) + 1); 28 | } 29 | stepper.run(); 30 | } 31 | -------------------------------------------------------------------------------- /AccelStepper/examples/Overshoot/Overshoot.pde: -------------------------------------------------------------------------------- 1 | // Overshoot.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Check overshoot handling 5 | // which sets a new target position and then waits until the stepper has 6 | // achieved it. This is used for testing the handling of overshoots 7 | // 8 | // Copyright (C) 2009 Mike McCauley 9 | // $Id: Overshoot.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ 10 | 11 | #include 12 | 13 | // Define a stepper and the pins it will use 14 | AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 15 | 16 | void setup() 17 | { 18 | stepper.setMaxSpeed(150); 19 | stepper.setAcceleration(100); 20 | } 21 | 22 | void loop() 23 | { 24 | stepper.moveTo(500); 25 | while (stepper.currentPosition() != 300) // Full speed up to 300 26 | stepper.run(); 27 | stepper.runToNewPosition(0); // Cause an overshoot then back to 0 28 | } 29 | -------------------------------------------------------------------------------- /AccelStepper/LICENSE: -------------------------------------------------------------------------------- 1 | This software is Copyright (C) 2008 Mike McCauley. Use is subject to license 2 | conditions. The main licensing options available are GPL V2 or Commercial: 3 | 4 | Open Source Licensing GPL V2 5 | 6 | This is the appropriate option if you want to share the source code of your 7 | application with everyone you distribute it to, and you also want to give them 8 | the right to share who uses it. If you wish to use this software under Open 9 | Source Licensing, you must contribute all your source code to the open source 10 | community in accordance with the GPL Version 2 when your application is 11 | distributed. See http://www.gnu.org/copyleft/gpl.html 12 | 13 | Commercial Licensing 14 | 15 | This is the appropriate option if you are creating proprietary applications 16 | and you are not prepared to distribute and share the source code of your 17 | application. Contact info@open.com.au for details. 18 | -------------------------------------------------------------------------------- /AccelStepper/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde: -------------------------------------------------------------------------------- 1 | // AFMotor_ConstantSpeed.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Shows how to run AccelStepper in the simplest, 5 | // fixed speed mode with no accelerations 6 | // Requires the AFMotor library (https://github.com/adafruit/Adafruit-Motor-Shield-library) 7 | 8 | #include 9 | #include 10 | 11 | AF_Stepper motor1(200, 1); 12 | 13 | 14 | // you can change these to DOUBLE or INTERLEAVE or MICROSTEP! 15 | void forwardstep() { 16 | motor1.onestep(FORWARD, SINGLE); 17 | } 18 | void backwardstep() { 19 | motor1.onestep(BACKWARD, SINGLE); 20 | } 21 | 22 | AccelStepper stepper(forwardstep, backwardstep); // use functions to step 23 | 24 | void setup() 25 | { 26 | Serial.begin(9600); // set up Serial library at 9600 bps 27 | Serial.println("Stepper test!"); 28 | 29 | stepper.setMaxSpeed(50); 30 | stepper.setSpeed(50); 31 | } 32 | 33 | void loop() 34 | { 35 | stepper.runSpeed(); 36 | } 37 | -------------------------------------------------------------------------------- /AccelStepper/examples/ProportionalControl/ProportionalControl.pde: -------------------------------------------------------------------------------- 1 | // ProportionalControl.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Make a single stepper follow the analog value read from a pot or whatever 5 | // The stepper will move at a constant speed to each newly set posiiton, 6 | // depending on the value of the pot. 7 | // 8 | // Copyright (C) 2012 Mike McCauley 9 | // $Id: ProportionalControl.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ 10 | 11 | #include 12 | 13 | // Define a stepper and the pins it will use 14 | AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 15 | 16 | // This defines the analog input pin for reading the control voltage 17 | // Tested with a 10k linear pot between 5v and GND 18 | #define ANALOG_IN A0 19 | 20 | void setup() 21 | { 22 | stepper.setMaxSpeed(1000); 23 | } 24 | 25 | void loop() 26 | { 27 | // Read new position 28 | int analog_in = analogRead(ANALOG_IN); 29 | stepper.moveTo(analog_in); 30 | stepper.setSpeed(100); 31 | stepper.runSpeedToPosition(); 32 | } 33 | -------------------------------------------------------------------------------- /MMKIT/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SD 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | MMkit KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | goForward KEYWORD2 15 | rotateLeft KEYWORD2 16 | rotateRight KEYWORD2 17 | rotate KEYWORD2 18 | testIRSensors KEYWORD2 19 | setIR_LEFT KEYWORD2 20 | setIR_RIGHT KEYWORD2 21 | waitForStart KEYWORD2 22 | setupMMkit KEYWORD2 23 | running KEYWORD2 24 | setForwardMotionSpeed KEYWORD2 25 | move KEYWORD2 26 | stop KEYWORD2 27 | ####################################### 28 | # Instances (KEYWORD2) 29 | ####################################### 30 | Grigoras KEYWORD2 31 | robot KEYWORD2 32 | MMKIT KEYWORD2 33 | robo KEYWORD2 34 | ####################################### 35 | # Constants (LITERAL1) 36 | ####################################### 37 | COMMAND_FIRMWARE LITERAL1 38 | 39 | -------------------------------------------------------------------------------- /AccelStepper/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For AccelStepper 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | AccelStepper KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | moveTo KEYWORD2 16 | move KEYWORD2 17 | run KEYWORD2 18 | runSpeed KEYWORD2 19 | setMaxSpeed KEYWORD2 20 | setAcceleration KEYWORD2 21 | setSpeed KEYWORD2 22 | speed KEYWORD2 23 | distanceToGo KEYWORD2 24 | targetPosition KEYWORD2 25 | currentPosition KEYWORD2 26 | setCurrentPosition KEYWORD2 27 | runToPosition KEYWORD2 28 | runSpeedToPosition KEYWORD2 29 | runToNewPosition KEYWORD2 30 | stop KEYWORD2 31 | disableOutputs KEYWORD2 32 | enableOutputs KEYWORD2 33 | setMinPulseWidth KEYWORD2 34 | setEnablePin KEYWORD2 35 | setPinsInverted KEYWORD2 36 | 37 | ####################################### 38 | # Constants (LITERAL1) 39 | ####################################### 40 | 41 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/RightWallFollow/nextMove.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | unsigned char nextMove(unsigned char State) 3 | { 4 | unsigned char nMove=State; 5 | // middle of maze found 6 | if (((Grigoras.current_cell.x == 7) || (Grigoras.current_cell.x == 8)) && ((Grigoras.current_cell.y == 7) || (Grigoras.current_cell.y == 8))) { 7 | if ((Grigoras.current_cell.x == 8)&&(Grigoras.current_cell.y == 8))digitalWrite(13,HIGH); 8 | return STATE_MOV_STOP; 9 | } 10 | switch (Grigoras.current_cell.wall) { 11 | //LRF 12 | case B00000000: 13 | return STATE_MOV_RIGHT; 14 | break; //LRF 15 | case B00000100: 16 | return STATE_MOV_RIGHT; 17 | break; //LRF 18 | case B00000101: 19 | return STATE_MOV_RIGHT; 20 | break; //LRF 21 | case B00000111: 22 | return STATE_MOV_UTURN; 23 | break; //LRF 24 | case B00000001: 25 | return STATE_MOV_RIGHT; 26 | break; //LRF 27 | case B00000110: 28 | return STATE_MOV_FRONT; 29 | break; //LRF 30 | case B00000010: 31 | return STATE_MOV_FRONT; 32 | break; //LRF 33 | case B00000011: 34 | return STATE_MOV_LEFT; 35 | break; 36 | default: 37 | analogWrite(13,75); 38 | return STATE_MOV_FRONT; 39 | break; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /AccelStepper/examples/Quickstop/Quickstop.pde: -------------------------------------------------------------------------------- 1 | // Quickstop.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Check stop handling. 5 | // Calls stop() while the stepper is travelling at full speed, causing 6 | // the stepper to stop as quickly as possible, within the constraints of the 7 | // current acceleration. 8 | // 9 | // Copyright (C) 2012 Mike McCauley 10 | // $Id: $ 11 | 12 | #include 13 | 14 | // Define a stepper and the pins it will use 15 | AccelStepper stepper; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 16 | 17 | void setup() 18 | { 19 | stepper.setMaxSpeed(150); 20 | stepper.setAcceleration(100); 21 | } 22 | 23 | void loop() 24 | { 25 | stepper.moveTo(500); 26 | while (stepper.currentPosition() != 300) // Full speed up to 300 27 | stepper.run(); 28 | stepper.stop(); // Stop as fast as possible: sets new target 29 | stepper.runToPosition(); 30 | // Now stopped after quickstop 31 | 32 | // Now go backwards 33 | stepper.moveTo(-500); 34 | while (stepper.currentPosition() != 0) // Full speed basck to 0 35 | stepper.run(); 36 | stepper.stop(); // Stop as fast as possible: sets new target 37 | stepper.runToPosition(); 38 | // Now stopped after quickstop 39 | 40 | } 41 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/BluetoothCom/nextMove.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | unsigned char nextMove(unsigned char State) 3 | { 4 | if (Serial1.available()) //verifica se tem dados diponível para leitura 5 | { 6 | byteRead = Serial1.read(); //le bytwe mais recente no buffer da serial 7 | if (byteRead != '4') { 8 | Serial1.write(byteRead); 9 | if (byteRead == '1') { 10 | return STATE_MOV_FRONT; 11 | digitalWrite(13, HIGH); 12 | Serial.write(byteRead); 13 | } 14 | if (byteRead == '0') { 15 | digitalWrite(13, LOW); 16 | return STATE_MOV_STOP; 17 | Serial.write(byteRead); 18 | } 19 | if (byteRead == '3') { 20 | digitalWrite(13, HIGH); 21 | return STATE_MOV_RIGHT; 22 | Serial.write(byteRead); 23 | } 24 | if (byteRead == '2') { 25 | digitalWrite(13, LOW); 26 | return STATE_MOV_LEFT; 27 | Serial.write(byteRead); 28 | } 29 | if (byteRead == '5') { 30 | digitalWrite(13, LOW); 31 | return STATE_MOV_UTURN; 32 | Serial.write(byteRead); 33 | } 34 | Serial.write(byteRead);//reenvia para o computador o dado recebido 35 | } 36 | } else { 37 | return STATE_MOV_IDLE; 38 | 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /AccelStepper/examples/MultiStepper/MultiStepper.pde: -------------------------------------------------------------------------------- 1 | // MultiStepper.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Shows how to multiple simultaneous steppers 5 | // Runs one stepper forwards and backwards, accelerating and decelerating 6 | // at the limits. Runs other steppers at the same time 7 | // 8 | // Copyright (C) 2009 Mike McCauley 9 | // $Id: MultiStepper.pde,v 1.1 2011/01/05 01:51:01 mikem Exp mikem $ 10 | 11 | #include 12 | 13 | // Define some steppers and the pins the will use 14 | AccelStepper stepper1; // Defaults to AccelStepper::FULL4WIRE (4 pins) on 2, 3, 4, 5 15 | AccelStepper stepper2(AccelStepper::FULL4WIRE, 6, 7, 8, 9); 16 | AccelStepper stepper3(AccelStepper::FULL2WIRE, 10, 11); 17 | 18 | void setup() 19 | { 20 | stepper1.setMaxSpeed(200.0); 21 | stepper1.setAcceleration(100.0); 22 | stepper1.moveTo(24); 23 | 24 | stepper2.setMaxSpeed(300.0); 25 | stepper2.setAcceleration(100.0); 26 | stepper2.moveTo(1000000); 27 | 28 | stepper3.setMaxSpeed(300.0); 29 | stepper3.setAcceleration(100.0); 30 | stepper3.moveTo(1000000); 31 | } 32 | 33 | void loop() 34 | { 35 | // Change direction at the limits 36 | if (stepper1.distanceToGo() == 0) 37 | stepper1.moveTo(-stepper1.currentPosition()); 38 | stepper1.run(); 39 | stepper2.run(); 40 | stepper3.run(); 41 | } 42 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/RightWallFollow/robotMove.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | void robotMove(void) 3 | { 4 | switch (stateMovement) { 5 | case STATE_MOV_IDLE: 6 | Grigoras.stop(); 7 | // delay(200); 8 | stateMovement = toMove; 9 | break; 10 | case STATE_MOV_FRONT: 11 | if (Grigoras.current_cell.theta == ANGLE_90)Grigoras.current_cell.y--; 12 | if (Grigoras.current_cell.theta == ANGLE_0) Grigoras.current_cell.x++; 13 | if (Grigoras.current_cell.theta == ANGLE_180) Grigoras.current_cell.x--; 14 | if (Grigoras.current_cell.theta == ANGLE_270) Grigoras.current_cell.y++; 15 | turn=false; 16 | Grigoras.goForward(18.0); 17 | stateMovement = STATE_MOV_IDLE; 18 | break; 19 | case STATE_MOV_RIGHT: 20 | turn=true; 21 | aceleration=1; 22 | Grigoras.rotate(90); 23 | odometry(Grigoras.current_cell.theta,STATE_MOV_RIGHT); 24 | stateMovement =STATE_MOV_FRONT; 25 | break; 26 | case STATE_MOV_LEFT: 27 | turn=true; 28 | Grigoras.rotate(-90); 29 | aceleration=1; 30 | odometry(Grigoras.current_cell.theta,STATE_MOV_LEFT); 31 | stateMovement =STATE_MOV_FRONT; 32 | break; 33 | case STATE_MOV_UTURN: 34 | turn=true; 35 | aceleration=1; 36 | Grigoras.rotate(180); 37 | odometry(Grigoras.current_cell.theta,STATE_MOV_UTURN); 38 | stateMovement =STATE_MOV_FRONT; 39 | break; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /MMKIT/examples/Basic/Button_switch/Button_switch.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | /* 3 | This example was created by Sérgio Silva 4 | on the 20th April 2015 5 | 6 | This code example is in the public domain. 7 | 8 | Description: 9 | The LED on pin 13 RED LED turns ON when one of the switch is ON 10 | Makes 4 blinking combination switch 11 | | switchs| pin 12 | |Position| value 13 | | |I 0| | PIN2 0 14 | | |I 0| | PIN3 0 15 | ------------------ 16 | | |0 I| | PIN2 1 17 | | |I 0| | PIN3 0 18 | ------------------ 19 | | |I 0| | PIN2 0 20 | | |0 I| | PIN3 1 21 | ------------------ 22 | | |0 I| | PIN2 1 23 | | |0 I| | PIN3 1 24 | 25 | */ 26 | int value=0; 27 | void setup() { 28 | pinMode(2, INPUT); 29 | pinMode(3, INPUT); 30 | pinMode(13, OUTPUT); 31 | 32 | } 33 | 34 | void loop() { 35 | //read the pushbutton value and blink RED led 36 | value=digitalRead(2)+digitalRead(3); 37 | switch (value) { 38 | case 0: 39 | digitalWrite(13, HIGH); 40 | delay(1000); 41 | digitalWrite(13, LOW); 42 | delay(1000); 43 | break; 44 | case 1: 45 | digitalWrite(13, HIGH); 46 | delay(500); 47 | digitalWrite(13, LOW); 48 | delay(500); 49 | break; 50 | case 2: 51 | digitalWrite(13, HIGH); 52 | delay(100); 53 | digitalWrite(13, LOW); 54 | delay(100); 55 | break; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /MMKIT/doc/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 7 | } 8 | 9 | .tabs2 { 10 | font-size: 10px; 11 | } 12 | .tabs3 { 13 | font-size: 9px; 14 | } 15 | 16 | .tablist { 17 | margin: 0; 18 | padding: 0; 19 | display: table; 20 | } 21 | 22 | .tablist li { 23 | float: left; 24 | display: table-cell; 25 | background-image: url('tab_b.png'); 26 | line-height: 36px; 27 | list-style: none; 28 | } 29 | 30 | .tablist a { 31 | display: block; 32 | padding: 0 20px; 33 | font-weight: bold; 34 | background-image:url('tab_s.png'); 35 | background-repeat:no-repeat; 36 | background-position:right; 37 | color: #283A5D; 38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 39 | text-decoration: none; 40 | outline: none; 41 | } 42 | 43 | .tabs3 .tablist a { 44 | padding: 0 10px; 45 | } 46 | 47 | .tablist a:hover { 48 | background-image: url('tab_h.png'); 49 | background-repeat:repeat-x; 50 | color: #fff; 51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 52 | text-decoration: none; 53 | } 54 | 55 | .tablist li.current a { 56 | background-image: url('tab_a.png'); 57 | background-repeat:repeat-x; 58 | color: #fff; 59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 60 | } 61 | -------------------------------------------------------------------------------- /AccelStepper/doc/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 7 | } 8 | 9 | .tabs2 { 10 | font-size: 10px; 11 | } 12 | .tabs3 { 13 | font-size: 9px; 14 | } 15 | 16 | .tablist { 17 | margin: 0; 18 | padding: 0; 19 | display: table; 20 | } 21 | 22 | .tablist li { 23 | float: left; 24 | display: table-cell; 25 | background-image: url('tab_b.png'); 26 | line-height: 36px; 27 | list-style: none; 28 | } 29 | 30 | .tablist a { 31 | display: block; 32 | padding: 0 20px; 33 | font-weight: bold; 34 | background-image:url('tab_s.png'); 35 | background-repeat:no-repeat; 36 | background-position:right; 37 | color: #283A5D; 38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 39 | text-decoration: none; 40 | outline: none; 41 | } 42 | 43 | .tabs3 .tablist a { 44 | padding: 0 10px; 45 | } 46 | 47 | .tablist a:hover { 48 | background-image: url('tab_h.png'); 49 | background-repeat:repeat-x; 50 | color: #fff; 51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 52 | text-decoration: none; 53 | } 54 | 55 | .tablist li.current a { 56 | background-image: url('tab_a.png'); 57 | background-repeat:repeat-x; 58 | color: #fff; 59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 60 | } 61 | -------------------------------------------------------------------------------- /AccelStepper/MANIFEST: -------------------------------------------------------------------------------- 1 | AccelStepper/Makefile 2 | AccelStepper/AccelStepper.h 3 | AccelStepper/AccelStepper.cpp 4 | AccelStepper/MANIFEST 5 | AccelStepper/LICENSE 6 | AccelStepper/project.cfg 7 | AccelStepper/keywords.txt 8 | AccelStepper/doc 9 | AccelStepper/examples/Blocking/Blocking.pde 10 | AccelStepper/examples/MultiStepper/MultiStepper.pde 11 | AccelStepper/examples/Overshoot/Overshoot.pde 12 | AccelStepper/examples/ConstantSpeed/ConstantSpeed.pde 13 | AccelStepper/examples/Random/Random.pde 14 | AccelStepper/examples/AFMotor_ConstantSpeed/AFMotor_ConstantSpeed.pde 15 | AccelStepper/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde 16 | AccelStepper/examples/ProportionalControl/ProportionalControl.pde 17 | AccelStepper/examples/Bounce/Bounce.pde 18 | AccelStepper/examples/Quickstop/Quickstop.pde 19 | AccelStepper/examples/MotorShield/MotorShield.pde 20 | AccelStepper/examples/DualMotorShield/DualMotorShield.pde 21 | AccelStepper/doc 22 | AccelStepper/doc/index.html 23 | AccelStepper/doc/functions.html 24 | AccelStepper/doc/annotated.html 25 | AccelStepper/doc/tab_l.gif 26 | AccelStepper/doc/tabs.css 27 | AccelStepper/doc/files.html 28 | AccelStepper/doc/classAccelStepper-members.html 29 | AccelStepper/doc/doxygen.css 30 | AccelStepper/doc/AccelStepper_8h-source.html 31 | AccelStepper/doc/tab_r.gif 32 | AccelStepper/doc/doxygen.png 33 | AccelStepper/doc/tab_b.gif 34 | AccelStepper/doc/functions_func.html 35 | AccelStepper/doc/classAccelStepper.html 36 | -------------------------------------------------------------------------------- /AccelStepper/examples/DualMotorShield/DualMotorShield.pde: -------------------------------------------------------------------------------- 1 | // DualMotorShield.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Shows how to run 2 simultaneous steppers 5 | // using the Itead Studio Arduino Dual Stepper Motor Driver Shield 6 | // model IM120417015 7 | // This shield is capable of driving 2 steppers at 8 | // currents of up to 750mA 9 | // and voltages up to 30V 10 | // Runs both steppers forwards and backwards, accelerating and decelerating 11 | // at the limits. 12 | // 13 | // Copyright (C) 2014 Mike McCauley 14 | // $Id: $ 15 | 16 | #include 17 | 18 | // The X Stepper pins 19 | #define STEPPER1_DIR_PIN 3 20 | #define STEPPER1_STEP_PIN 2 21 | // The Y stepper pins 22 | #define STEPPER2_DIR_PIN 7 23 | #define STEPPER2_STEP_PIN 6 24 | 25 | // Define some steppers and the pins the will use 26 | AccelStepper stepper1(AccelStepper::DRIVER, STEPPER1_STEP_PIN, STEPPER1_DIR_PIN); 27 | AccelStepper stepper2(AccelStepper::DRIVER, STEPPER2_STEP_PIN, STEPPER2_DIR_PIN); 28 | 29 | void setup() 30 | { 31 | stepper1.setMaxSpeed(200.0); 32 | stepper1.setAcceleration(200.0); 33 | stepper1.moveTo(100); 34 | 35 | stepper2.setMaxSpeed(100.0); 36 | stepper2.setAcceleration(100.0); 37 | stepper2.moveTo(100); 38 | } 39 | 40 | void loop() 41 | { 42 | // Change direction at the limits 43 | if (stepper1.distanceToGo() == 0) 44 | stepper1.moveTo(-stepper1.currentPosition()); 45 | if (stepper2.distanceToGo() == 0) 46 | stepper2.moveTo(-stepper2.currentPosition()); 47 | stepper1.run(); 48 | stepper2.run(); 49 | } 50 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/RightWallFollow/odometry.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | unsigned char odometry(unsigned char THETA, unsigned char MOVE){ 3 | //Grigoras.current_cell.theta 4 | switch (MOVE){ 5 | case STATE_MOV_RIGHT: 6 | switch (THETA) { 7 | case ANGLE_90: 8 | Grigoras.current_cell.theta = ANGLE_0; 9 | break; 10 | case ANGLE_0: 11 | Grigoras.current_cell.theta = ANGLE_270; 12 | break; 13 | case ANGLE_270: 14 | Grigoras.current_cell.theta = ANGLE_180; 15 | break; 16 | case ANGLE_180: 17 | Grigoras.current_cell.theta = ANGLE_90; 18 | break; 19 | } 20 | break; 21 | case STATE_MOV_LEFT: 22 | switch (THETA) { 23 | case ANGLE_90: 24 | Grigoras.current_cell.theta = ANGLE_180; 25 | break; 26 | case ANGLE_0: 27 | Grigoras.current_cell.theta = ANGLE_90; 28 | break; 29 | case ANGLE_270: 30 | Grigoras.current_cell.theta = ANGLE_0; 31 | break; 32 | case ANGLE_180: 33 | Grigoras.current_cell.theta = ANGLE_270; 34 | break; 35 | } 36 | break; 37 | case STATE_MOV_UTURN: 38 | switch (THETA) { 39 | case ANGLE_90: 40 | Grigoras.current_cell.theta = ANGLE_270; 41 | break; 42 | case ANGLE_0: 43 | Grigoras.current_cell.theta = ANGLE_180; 44 | break; 45 | case ANGLE_270: 46 | Grigoras.current_cell.theta = ANGLE_90; 47 | break; 48 | case ANGLE_180: 49 | Grigoras.current_cell.theta = ANGLE_0; 50 | break; 51 | } 52 | break; 53 | } 54 | } 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /MMKIT/examples/Basic/Button_switch_Bin/Button_switch_Bin.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | /* 3 | This example was created by Sérgio Silva 4 | on the 20th April 2015 5 | 6 | This code example is in the public domain. 7 | 8 | Description: 9 | The LED on pin 13 RED LED turns ON when one of the switch is ON 10 | Makes 4 blinking combination switch 11 | | switchs| pin 12 | |Position| value 13 | | |I 0| | PIN2 0 14 | | |I 0| | PIN3 0 15 | ------------------ 16 | | |0 I| | PIN2 1 17 | | |I 0| | PIN3 0 18 | ------------------ 19 | | |I 0| | PIN2 0 20 | | |0 I| | PIN3 1 21 | ------------------ 22 | | |0 I| | PIN2 1 23 | | |0 I| | PIN3 1 24 | 25 | */ 26 | char value=B00; 27 | void setup() { 28 | pinMode(2, INPUT); 29 | pinMode(3, INPUT); 30 | pinMode(13, OUTPUT); 31 | 32 | } 33 | 34 | void loop() { 35 | value=B00; 36 | if (digitalRead(3) == 1) { 37 | value = value | B01; 38 | } 39 | if (digitalRead(2) == 1) { 40 | value = value | B10; 41 | } 42 | value=digitalRead(2)+digitalRead(3); 43 | switch (value) { 44 | case B11: 45 | digitalWrite(13, HIGH); 46 | delay(1000); 47 | digitalWrite(13, LOW); 48 | delay(1000); 49 | break; 50 | case B10: 51 | digitalWrite(13, HIGH); 52 | delay(500); 53 | digitalWrite(13, LOW); 54 | delay(500); 55 | break; 56 | case B01: 57 | digitalWrite(13, HIGH); 58 | delay(100); 59 | digitalWrite(13, LOW); 60 | delay(100); 61 | break; 62 | case B00: 63 | digitalWrite(13, LOW); 64 | break; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /AccelStepper/examples/AFMotor_MultiStepper/AFMotor_MultiStepper.pde: -------------------------------------------------------------------------------- 1 | // AFMotor_MultiStepper.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Control both Stepper motors at the same time with different speeds 5 | // and accelerations. 6 | // Requires the AFMotor library (https://github.com/adafruit/Adafruit-Motor-Shield-library) 7 | 8 | #include 9 | #include 10 | 11 | // two stepper motors one on each port 12 | AF_Stepper motor1(200, 1); 13 | AF_Stepper motor2(200, 2); 14 | 15 | // you can change these to DOUBLE or INTERLEAVE or MICROSTEP! 16 | // wrappers for the first motor! 17 | void forwardstep1() { 18 | motor1.onestep(FORWARD, SINGLE); 19 | } 20 | void backwardstep1() { 21 | motor1.onestep(BACKWARD, SINGLE); 22 | } 23 | // wrappers for the second motor! 24 | void forwardstep2() { 25 | motor2.onestep(FORWARD, SINGLE); 26 | } 27 | void backwardstep2() { 28 | motor2.onestep(BACKWARD, SINGLE); 29 | } 30 | 31 | // Motor shield has two motor ports, now we'll wrap them in an AccelStepper object 32 | AccelStepper stepper1(forwardstep1, backwardstep1); 33 | AccelStepper stepper2(forwardstep2, backwardstep2); 34 | 35 | void setup() 36 | { 37 | stepper1.setMaxSpeed(200.0); 38 | stepper1.setAcceleration(100.0); 39 | stepper1.moveTo(24); 40 | 41 | stepper2.setMaxSpeed(300.0); 42 | stepper2.setAcceleration(100.0); 43 | stepper2.moveTo(1000000); 44 | 45 | } 46 | 47 | void loop() 48 | { 49 | // Change direction at the limits 50 | if (stepper1.distanceToGo() == 0) 51 | stepper1.moveTo(-stepper1.currentPosition()); 52 | stepper1.run(); 53 | stepper2.run(); 54 | } 55 | -------------------------------------------------------------------------------- /MMKIT/examples/Basic/MoveFoward/MoveFoward.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | /* 3 | This example was created by Sérgio Silva 4 | on the 20th April 2015 5 | 6 | This code example is in the public domain. 7 | 8 | Description: 9 | The robot moves forward the desired distance in cm 10 | 11 | */ 12 | #include // Accelaration library 13 | #include // MMkit library 14 | 15 | AccelStepper motorLeft(AccelStepper::DRIVER, 9, 8); // declaration of motorLeft to control the MMkit 16 | AccelStepper motorRight(AccelStepper::DRIVER, 11, 10); // declaration of motorRight to control the MMkit 17 | 18 | MMkit Grigoras(motorLeft, motorRight); // declaration of object variable to control the MMkit 19 | 20 | enum statesRobotMovements { 21 | STATE_MOV_IDLE, 22 | STATE_MOV_FRONT, 23 | STATE_MOV_RIGHT, 24 | STATE_MOV_LEFT, 25 | STATE_MOV_UTURN, 26 | STATE_MOV_STOP 27 | }; 28 | 29 | unsigned char stateMovement = STATE_MOV_FRONT; 30 | unsigned char toMove = STATE_MOV_FRONT; 31 | unsigned int velocidade=10; 32 | double aceleration=1; //usada para chegar a velocidade 33 | unsigned long previousMicros=0; 34 | void setup(){ 35 | Grigoras.setupMMkit(); // Starts the MMkit 36 | Grigoras.goForward(20.0); //distance to go forward in cm (18.0) means 18.0cm 37 | Grigoras.setForwardMotionSpeed(velocidade); //sets forward speed if value < 40 = cm/s 38 | Grigoras.waitForStart(); // waits for hand passing front right sensors 39 | } 40 | 41 | void loop(){ 42 | if(Grigoras.running()==true) { 43 | acceleration(); 44 | Grigoras.runSpeed(); //moves at the desired speed 45 | } 46 | else{ 47 | Grigoras.stop(); 48 | } 49 | } 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /MMKIT/examples/Basic/TesteIRSensors/TesteIRSensors.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | /* 3 | This example was created by Sérgio Silva 4 | on the 20th April 2015 5 | 6 | This code example is in the public domain. 7 | 8 | Description: 9 | The robot moves forward the desired distance in cm 10 | 11 | */ 12 | #include // Accelaration library 13 | #include // MMkit library 14 | 15 | AccelStepper motorLeft(AccelStepper::DRIVER, 9, 8); // declaration of motorLeft to control the MMkit 16 | AccelStepper motorRight(AccelStepper::DRIVER, 11, 10); // declaration of motorRight to control the MMkit 17 | 18 | MMkit Grigoras(motorLeft, motorRight); // declaration of object variable to control the MMkit 19 | 20 | enum statesRobotMovements { 21 | STATE_MOV_IDLE, 22 | STATE_MOV_FRONT, 23 | STATE_MOV_RIGHT, 24 | STATE_MOV_LEFT, 25 | STATE_MOV_UTURN, 26 | STATE_MOV_STOP 27 | }; 28 | 29 | unsigned char stateMovement = STATE_MOV_FRONT; 30 | unsigned char toMove = STATE_MOV_FRONT; 31 | 32 | void setup(){ 33 | Grigoras.setupMMkit(); // Starts the MMkit 34 | } 35 | 36 | void loop(){ 37 | Grigoras.testIRSensors(); 38 | Grigoras.current_cell.wall = B00000000; // clears cell values 39 | if ( Grigoras.isWallLeft() == 1) { // wall 0000 0 LRF checks if there is a left wall 40 | Grigoras.current_cell.wall = Grigoras.current_cell.wall | B00000100; 41 | } 42 | if ( Grigoras.isWallFront() == 1) { // wall 0000 0 LRF checks if there is a front wall 43 | Grigoras.current_cell.wall = Grigoras.current_cell.wall | B00000001; 44 | } 45 | if ( Grigoras.isWallRight() == 1) { // wall 0000 0 LRF checks if there is a right wall 46 | Grigoras.current_cell.wall = Grigoras.current_cell.wall | B00000010; 47 | } 48 | Serial.println(Grigoras.current_cell.wall,BIN); 49 | delay(1000); 50 | } 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/MMkitSeqMotion/MMkitSeqMotion.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | /* 3 | This example was created by Sérgio Silva 4 | on the 20th April 2015 5 | 6 | This code example is in the public domain. 7 | 8 | Description: 9 | The robot moves forward the desired distance in cm 10 | 11 | */ 12 | #include // Accelaration library 13 | #include // MMkit library 14 | 15 | AccelStepper motorLeft(AccelStepper::DRIVER, 9, 8); // declaration of motorLeft to control the MMkit 16 | AccelStepper motorRight(AccelStepper::DRIVER, 11, 10); // declaration of motorRight to control the MMkit 17 | 18 | MMkit Grigoras(motorLeft, motorRight); // declaration of object variable to control the MMkit 19 | 20 | enum statesRobotMovements { 21 | STATE_MOV_IDLE, 22 | STATE_MOV_FRONT, 23 | STATE_MOV_RIGHT, 24 | STATE_MOV_LEFT, 25 | STATE_MOV_UTURN, 26 | STATE_MOV_STOP 27 | }; 28 | 29 | unsigned char stateMovement = STATE_MOV_FRONT; 30 | unsigned char toMove = STATE_MOV_FRONT; 31 | boolean turn=false; 32 | unsigned int velocidade=10; 33 | double aceleration=1; //usada para chegar a velocidade 34 | unsigned long previousMicros=0; 35 | int a=0; 36 | void setup(){ 37 | Grigoras.setupMMkit(); // Starts the MMkit 38 | Grigoras.goForward(18.0); //distance to go forward in cm (18.0) means 18.0cm 39 | Grigoras.setForwardMotionSpeed(1); //sets forward speed 40 | Grigoras.waitForStart(); // waits for hand passing front right sensors 41 | } 42 | 43 | 44 | void loop() { 45 | if(Grigoras.running()==true) { 46 | if(turn==false){ 47 | acceleration(); 48 | Grigoras.runSpeed(); //moves at the desired speed 49 | } 50 | else{ 51 | Grigoras.run(); 52 | } 53 | } 54 | else{ 55 | turn=false; 56 | Grigoras.readIRSensors(); 57 | stateMovement = nextMove(stateMovement); 58 | robotMove(); 59 | 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/TestUART1/TesteUART1.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | /* 3 | This example was created by Sérgio Silva 4 | Globaltronic 5 | on the 2nd Feb 2016 6 | 7 | Description: 8 | Just connect your bluetooth module to the front available pins. 9 | From left to right the pinout is Vcc Gnd Rx TX. 10 | The schematic bellow shows the connections (remenber that Rx from MMkit Connects to Tx of Bluetooth module 11 | and Tx from MMkit Connects to Rx of Bluetooth module 12 | 13 | __ __ 14 | __2 1__ 15 | | | o o o o | | 16 | - 3 V G RxTx 0 - | 17 | |00| | MMKIT | |00| (150) | W 18 | |00|motorLeft motorRight|00| <-------> | A 19 | |00| ! | |00| | L 20 | | | | L 21 | _________________ | 22 | 23 | This code example is in the public domain. 24 | 25 | */ 26 | 27 | #include // Accelaration library 28 | #include // MMkit library 29 | 30 | AccelStepper motorLeft(AccelStepper::DRIVER, 9, 8); // declaration of motorLeft to control the MMkit 31 | AccelStepper motorRight(AccelStepper::DRIVER, 11, 10); // declaration of motorRight to control the MMkit 32 | unsigned long previousMicros=0; 33 | 34 | MMkit Grigoras(motorLeft, motorRight); // declaration of object variable to control the MMkit 35 | 36 | void setup(){ 37 | Grigoras.setupMMkit(); // Starts the MMkit 38 | motorLeft.disableOutputs(); // To turn off motors use: motorLeft.enableOutputs(); //to enable motors 39 | motorRight.disableOutputs(); // To turn off motors use: motorRight.enableOutputs(); //to enable motors // 40 | Serial1.begin(9600); // Enable UART1 41 | } 42 | 43 | void loop(){ 44 | delay(50); //increase to see in serial port decrease to see in led 45 | Serial1.println("MMKIT"); 46 | } 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/BluetoothCom/BluetoothCom__new.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | /* 3 | This example was created by Sérgio Silva 4 | on the 20th April 2015 5 | 6 | This code example is in the public domain. 7 | 8 | Description: 9 | The robot moves forward the desired distance in cm 10 | 11 | */ 12 | #include // Accelaration library 13 | #include // MMkit library 14 | 15 | AccelStepper motorLeft(AccelStepper::DRIVER, 9, 8); // declaration of motorLeft to control the MMkit 16 | AccelStepper motorRight(AccelStepper::DRIVER, 11, 10); // declaration of motorRight to control the MMkit 17 | 18 | MMkit Grigoras(motorLeft, motorRight); // declaration of object variable to control the MMkit 19 | 20 | enum statesRobotMovements { 21 | STATE_MOV_IDLE, 22 | STATE_MOV_FRONT, 23 | STATE_MOV_RIGHT, 24 | STATE_MOV_LEFT, 25 | STATE_MOV_UTURN, 26 | STATE_MOV_STOP 27 | }; 28 | 29 | 30 | byte byteRead; 31 | unsigned char stateMovement = STATE_MOV_FRONT; 32 | unsigned char toMove = STATE_MOV_FRONT; 33 | boolean turn=false; 34 | unsigned int velocidade=10; 35 | double aceleration=1; //usada para chegar a velocidade 36 | // usadas para comunicação 37 | unsigned int integerValue=0; // valor máximo 65535 38 | char incomingByte; 39 | void setup(){ 40 | Serial1.begin(9600); 41 | Grigoras.setupMMkit(); // Starts the MMkit 42 | Grigoras.goForward(18.0); //distance to go forward in cm (18.0) means 18.0cm 43 | Grigoras.setForwardMotionSpeed(1); //sets forward speed 44 | Grigoras.waitForStart(); // waits for hand passing front right sensors 45 | } 46 | 47 | 48 | void loop() { 49 | if(Grigoras.running()==true) { 50 | if(turn==false){ 51 | acceleration(); 52 | Grigoras.runSpeed(); //moves at the desired speed 53 | } 54 | else{ 55 | Grigoras.run(); 56 | } 57 | } 58 | else{ 59 | turn=false; 60 | stateMovement = nextMove(stateMovement); 61 | robotMove(); 62 | 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /MMKIT/doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: MMkit library for Arduino 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 |
40 |
41 |
42 |
MMkit library for Arduino
43 |
44 |
45 |

This is the Arduino MMkit library. It provides an object-oriented interface for Micromouse Kit Robot.

46 |

MMKIT version in development V1.0 1 june 2016

47 |
48 | 49 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/RightWallFollow/RightWallFollow.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | /* 3 | This example was created by Sérgio Silva 4 | on the 20th April 2015 5 | 6 | This code example is in the public domain. 7 | 8 | Description: 9 | The robot moves forward the desired distance in cm 10 | 11 | */ 12 | #include // Accelaration library 13 | #include // MMkit library 14 | 15 | #define ANGLE_0 0x01 16 | #define ANGLE_90 0x02 17 | #define ANGLE_180 0x04 18 | #define ANGLE_270 0x08 19 | 20 | AccelStepper motorLeft(AccelStepper::DRIVER, 9, 8); // declaration of motorLeft to control the MMkit 21 | AccelStepper motorRight(AccelStepper::DRIVER, 11, 10); // declaration of motorRight to control the MMkit 22 | 23 | MMkit Grigoras(motorLeft, motorRight); // declaration of object variable to control the MMkit 24 | 25 | enum statesRobotMovements { 26 | STATE_MOV_IDLE, 27 | STATE_MOV_FRONT, 28 | STATE_MOV_RIGHT, 29 | STATE_MOV_LEFT, 30 | STATE_MOV_UTURN, 31 | STATE_MOV_STOP 32 | }; 33 | 34 | unsigned char stateMovement = STATE_MOV_FRONT; 35 | unsigned char toMove = STATE_MOV_FRONT; 36 | boolean turn=false; 37 | unsigned int velocidade=10; 38 | double aceleration=1; //usada para chegar a velocidade 39 | unsigned long previousMicros=0; 40 | 41 | void setup(){ //start maze size 16;14;12;10; 8; 6; 4 42 | Grigoras.current_cell.x = 5; // Start x position 0; 1; 2; 3; 4; 5; 6 43 | Grigoras.current_cell.y =10; // Start y position 15;14;13;12;11;10; 9 44 | Grigoras.current_cell.theta = ANGLE_90; // Starts pointing up 45 | Grigoras.setupMMkit(); // Starts the MMkit 46 | Grigoras.goForward(18.0); //distance to go forward in cm (18.0) means 18.0cm 47 | Grigoras.current_cell.y--; //goes forward one cell 48 | Grigoras.setForwardMotionSpeed(velocidade); //sets forward speed 49 | Grigoras.waitForStart(); // waits for hand passing front right sensors 50 | } 51 | 52 | void loop(){ 53 | 54 | if(Grigoras.running()==true) { 55 | if(turn==false){ 56 | acceleration(); 57 | Grigoras.runSpeed(); //moves at the desired speed 58 | } 59 | else{ 60 | Grigoras.run(); 61 | } 62 | } 63 | else{ 64 | digitalWrite(13,LOW); 65 | turn=false; 66 | Grigoras.readIRSensors(); 67 | toMove = nextMove(stateMovement); 68 | robotMove(); 69 | } 70 | } 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /AccelStepper/doc/files.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | AccelStepper: File List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
AccelStepper 21 |
22 |
26 |
27 | 28 | 29 | 37 | 42 |
43 |
44 |
45 |
File List
46 |
47 |
48 |
Here is a list of all documented files with brief descriptions:
49 | 50 | 51 |
\*AccelStepper.h
52 |
53 |
54 | 55 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_d28a4824dc47e487b107a5db32ef43c4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
examples Directory Reference
52 |
53 |
54 | 55 | 57 |

56 | Directories

58 |
59 | 60 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /AccelStepper/doc/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | AccelStepper: Class List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 23 | 24 | 25 |
20 |
AccelStepper 21 |
22 |
26 |
27 | 28 | 29 | 37 | 43 |
44 |
45 |
46 |
Class List
47 |
48 |
49 |
Here are the classes, structs, unions and interfaces with brief descriptions:
50 | 51 | 52 |
\CAccelStepperSupport for stepper motors with acceleration etc
53 |
54 |
55 | 56 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_9fd43cbf431ad4345d64cbab9841c2b6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
Basic Directory Reference
52 |
53 |
54 | 55 | 57 |

56 | Directories

58 |
59 | 60 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_9691a6dd1b06df846066475a1be4cf0b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
Advanced Directory Reference
52 |
53 |
54 | 55 | 57 |

56 | Directories

58 |
59 | 60 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/FloodFillAlgorithm/robotMove.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | void robotMove(void) 3 | { 4 | switch (stateMovement) { 5 | case STATE_MOV_IDLE: 6 | stateMovement = toMove; 7 | break; 8 | 9 | case STATE_MOV_FRONT: 10 | turn=false; 11 | Grigoras.track[Step].wall = Grigoras.current_cell.wall; 12 | Grigoras.goForward(18.0); 13 | Step++; 14 | if (Grigoras.current_cell.theta == ANGLE_90)Grigoras.current_cell.y--; 15 | if (Grigoras.current_cell.theta == ANGLE_0) Grigoras.current_cell.x++; 16 | if (Grigoras.current_cell.theta == ANGLE_180) Grigoras.current_cell.x--; 17 | if (Grigoras.current_cell.theta == ANGLE_270) Grigoras.current_cell.y++; 18 | Grigoras.current_cell.weight = Map[Grigoras.current_cell.y][Grigoras.current_cell.x]; //Updates the weight of the new cell 19 | Grigoras.track[Step].x = Grigoras.current_cell.x; 20 | Grigoras.track[Step].y = Grigoras.current_cell.y; 21 | Grigoras.track[Step].weight = Grigoras.current_cell.weight; 22 | stateMovement = STATE_MOV_IDLE; 23 | checkTrack(); // Checks for robot movement in same cells 24 | break; 25 | case STATE_MOV_RIGHT: 26 | turn=true; 27 | aceleration=1; 28 | Grigoras.rotate(90.0); 29 | switch (Grigoras.current_cell.theta) { 30 | case ANGLE_90: 31 | Grigoras.current_cell.theta = ANGLE_0; 32 | break; 33 | case ANGLE_0: 34 | Grigoras.current_cell.theta = ANGLE_270; 35 | break; 36 | case ANGLE_270: 37 | Grigoras.current_cell.theta = ANGLE_180; 38 | break; 39 | case ANGLE_180: 40 | Grigoras.current_cell.theta = ANGLE_90; 41 | break; 42 | } 43 | stateMovement = STATE_MOV_FRONT; 44 | break; 45 | case STATE_MOV_LEFT: 46 | turn=true; 47 | aceleration=1; 48 | Grigoras.rotate(-90.0); 49 | // odometry 50 | switch (Grigoras.current_cell.theta) { 51 | case ANGLE_180: 52 | Grigoras.current_cell.theta = ANGLE_270; 53 | break; 54 | case ANGLE_270: 55 | Grigoras.current_cell.theta = ANGLE_0; 56 | break; 57 | case ANGLE_0: 58 | Grigoras.current_cell.theta = ANGLE_90; 59 | break; 60 | case ANGLE_90: 61 | Grigoras.current_cell.theta = ANGLE_180; 62 | break; 63 | } 64 | stateMovement = STATE_MOV_FRONT; 65 | break; 66 | case STATE_MOV_UTURN: 67 | turn=true; 68 | aceleration=1; 69 | Grigoras.rotate(180.0); 70 | // odometry 71 | switch (Grigoras.current_cell.theta) { 72 | case ANGLE_180: 73 | Grigoras.current_cell.theta = ANGLE_0; 74 | break; 75 | case ANGLE_270: 76 | Grigoras.current_cell.theta = ANGLE_90; 77 | break; 78 | case ANGLE_0: 79 | Grigoras.current_cell.theta = ANGLE_180; 80 | break; 81 | case ANGLE_90: 82 | Grigoras.current_cell.theta = ANGLE_270; 83 | break; 84 | } 85 | stateMovement = STATE_MOV_FRONT; 86 | break; 87 | case STATE_MOV_STOP: 88 | Grigoras.stop(); 89 | //disableOutputs 90 | break; 91 | } 92 | } 93 | 94 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/RandomNextMove/RandomNextMove.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | /* 3 | This example was created by Sérgio Silva 4 | on the 20th April 2015 5 | 6 | This code example is in the public domain. 7 | 8 | Description: 9 | The robot moves forward the desired distance in cm 10 | 11 | */ 12 | #include // Accelaration library 13 | #include // MMkit library 14 | 15 | AccelStepper motorLeft(AccelStepper::DRIVER, 9, 8); // declaration of motorLeft to control the MMkit 16 | AccelStepper motorRight(AccelStepper::DRIVER, 11, 10); // declaration of motorRight to control the MMkit 17 | 18 | MMkit Grigoras(motorLeft, motorRight); // declaration of object variable to control the MMkit 19 | 20 | enum statesRobotMovements { 21 | STATE_MOV_IDLE, 22 | STATE_MOV_FRONT, 23 | STATE_MOV_RIGHT, 24 | STATE_MOV_LEFT, 25 | STATE_MOV_UTURN, 26 | STATE_MOV_STOP 27 | }; 28 | 29 | unsigned char stateMovement = STATE_MOV_FRONT; 30 | unsigned char toMove = STATE_MOV_FRONT; 31 | boolean turn=false; 32 | unsigned int velocidade=10; 33 | double aceleration=1; //usada para chegar a velocidade 34 | unsigned long previousMicros=0; 35 | 36 | void setup(){ 37 | Grigoras.setupMMkit(); // Starts the MMkit 38 | Grigoras.goForward(18.0); //distance to go forward in cm (18.0) means 18.0cm 39 | Grigoras.setForwardMotionSpeed(velocidade); //sets forward speed 40 | Grigoras.waitForStart(); // waits for hand passing front right sensors 41 | } 42 | 43 | void loop(){ 44 | 45 | if(Grigoras.running()==true) { 46 | if(turn==false){ 47 | acceleration(); 48 | Grigoras.runSpeed(); //moves at the desired speed 49 | } 50 | else{ 51 | Grigoras.run(); 52 | } 53 | } 54 | else{ 55 | digitalWrite(13,HIGH); 56 | turn=false; 57 | Grigoras.readIRSensors(); 58 | stateMovement = nextMove(stateMovement); 59 | robotMove(); 60 | 61 | } 62 | } 63 | 64 | void robotMove(void) 65 | { 66 | switch (stateMovement) { 67 | case STATE_MOV_IDLE: 68 | Grigoras.stop(); 69 | delay(2000); 70 | break; 71 | 72 | case STATE_MOV_FRONT: 73 | turn=false; 74 | Grigoras.goForward(18.0); 75 | break; 76 | case STATE_MOV_RIGHT: 77 | turn=true; 78 | Grigoras.rotate(90); 79 | break; 80 | case STATE_MOV_LEFT: 81 | turn=true; 82 | Grigoras.rotate(-90); 83 | break; 84 | } 85 | 86 | } 87 | unsigned char nextMove(unsigned char State) 88 | { 89 | unsigned char nMove=State; 90 | switch (nMove) { 91 | case STATE_MOV_FRONT: 92 | nMove=rand()%2; //choose a random move Left or Right 93 | return nMove+2; 94 | break; 95 | case STATE_MOV_RIGHT: 96 | return STATE_MOV_FRONT; 97 | break; 98 | case STATE_MOV_LEFT: 99 | return STATE_MOV_FRONT; 100 | break; 101 | default: 102 | digitalWrite(13,LOW); 103 | return STATE_MOV_FRONT; 104 | break; 105 | } 106 | 107 | 108 | } 109 | 110 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_570753ad8877dea1987cf40b0d7f5691.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic/TurnLeft Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
TurnLeft Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 |

56 | Files

file  TurnLeft.ino
 
60 |
61 | 62 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_6c401e1c6837dca0adcc3b899b7ea8f1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic/TurnRight Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
TurnRight Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 |

56 | Files

file  TurnRight.ino
 
60 |
61 | 62 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_2281310147e0fac8c8cf0985ec60de65.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic/Test_Button Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
Test_Button Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 |

56 | Files

file  Test_Button.ino
 
60 |
61 | 62 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_93c0f6084947c07eb7b438496d1cfde6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic/Button_switch Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
Button_switch Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 |

56 | Files

file  Button_switch.ino
 
60 |
61 | 62 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_dbb79cb84dde56bb04f2d47dfbfaeb94.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic/TesteIRSensors Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
TesteIRSensors Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 |

56 | Files

file  TesteIRSensors.ino
 
60 |
61 | 62 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_e95d46c41705e2e75f2dcb6c6d7c71ef.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic/Button_switch_Bin Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
Button_switch_Bin Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 |

56 | Files

file  Button_switch_Bin.ino
 
60 |
61 | 62 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /MMKIT/doc/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: Class List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 45 |
46 |
47 |
48 |
Class List
49 |
50 |
51 |
Here are the classes, structs, unions and interfaces with brief descriptions:
52 |
[detail level 12]
53 | 54 | 55 |
 CMMkit
 Ccell
56 |
57 |
58 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /MMKIT/doc/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: Class Index 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 45 |
46 |
47 |
48 |
Class Index
49 |
50 |
51 |
C | M
52 | 53 | 56 | 57 | 58 | 59 |
  M  
54 |
  c  
55 |
MMkit   MMkit::cell   
60 |
C | M
61 |
62 | 63 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /MMKIT/doc/BluetoothCom_2robotMove_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/BluetoothCom/robotMove.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
robotMove.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void robotMove (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/Basic_2MoveFoward_2Acceleration_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic/MoveFoward/Acceleration.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
Acceleration.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void acceleration (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/MMkitSeqMotion_2robotMove_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/MMkitSeqMotion/robotMove.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
robotMove.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void robotMove (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/RightWallFollow_2robotMove_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/RightWallFollow/robotMove.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
robotMove.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void robotMove (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/Advanced_2TestUART1_2Acceleration_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/TestUART1/Acceleration.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
Acceleration.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void acceleration (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/Advanced_2BluetoothCom_2Acceleration_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/BluetoothCom/Acceleration.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
Acceleration.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void acceleration (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/BluetoothCom_2nextMove_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/BluetoothCom/nextMove.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
nextMove.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | unsigned char nextMove (unsigned char State)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/FloodFillAlgorithm_2robotMove_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/FloodFillAlgorithm/robotMove.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
robotMove.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void robotMove (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /AccelStepper/examples/MotorShield/MotorShield.pde: -------------------------------------------------------------------------------- 1 | // AFMotor_ConstantSpeed.pde 2 | // -*- mode: C++ -*- 3 | // 4 | // Shows how to use AccelStepper to control a 3-phase motor, such as a HDD spindle motor 5 | // using the Adafruit Motor Shield 6 | // http://www.ladyada.net/make/mshield/index.html. 7 | // Create a subclass of AccelStepper which controls the motor pins via the 8 | // Motor Shield serial-to-parallel interface 9 | 10 | #include 11 | 12 | // Arduino pin names for interface to 74HCT595 latch 13 | // on Adafruit Motor Shield 14 | #define MOTORLATCH 12 15 | #define MOTORCLK 4 16 | #define MOTORENABLE 7 17 | #define MOTORDATA 8 18 | 19 | // PWM pins, also used to enable motor outputs 20 | #define PWM0A 5 21 | #define PWM0B 6 22 | #define PWM1A 9 23 | #define PWM1B 10 24 | #define PWM2A 11 25 | #define PWM2B 3 26 | 27 | 28 | // The main purpose of this class is to override setOutputPins to work with Adafruit Motor Shield 29 | class AFMotorShield : public AccelStepper 30 | { 31 | public: 32 | AFMotorShield(uint8_t interface = AccelStepper::FULL4WIRE, uint8_t pin1 = 2, uint8_t pin2 = 3, uint8_t pin3 = 4, uint8_t pin4 = 5); 33 | 34 | virtual void setOutputPins(uint8_t mask); 35 | }; 36 | 37 | 38 | AFMotorShield::AFMotorShield(uint8_t interface, uint8_t pin1, uint8_t pin2, uint8_t pin3, uint8_t pin4) 39 | : AccelStepper(interface, pin1, pin2, pin3, pin4) 40 | { 41 | // Enable motor control serial to parallel latch 42 | pinMode(MOTORLATCH, OUTPUT); 43 | pinMode(MOTORENABLE, OUTPUT); 44 | pinMode(MOTORDATA, OUTPUT); 45 | pinMode(MOTORCLK, OUTPUT); 46 | digitalWrite(MOTORENABLE, LOW); 47 | 48 | // enable both H bridges on motor 1 49 | pinMode(PWM2A, OUTPUT); 50 | pinMode(PWM2B, OUTPUT); 51 | pinMode(PWM0A, OUTPUT); 52 | pinMode(PWM0B, OUTPUT); 53 | digitalWrite(PWM2A, HIGH); 54 | digitalWrite(PWM2B, HIGH); 55 | digitalWrite(PWM0A, HIGH); 56 | digitalWrite(PWM0B, HIGH); 57 | 58 | setOutputPins(0); // Reset 59 | }; 60 | 61 | // Use the AF Motor Shield serial-to-parallel to set the state of the motor pins 62 | // Caution: the mapping of AccelStepper pins to AF motor outputs is not 63 | // obvious: 64 | // AccelStepper Motor Shield output 65 | // pin1 M4A 66 | // pin2 M1A 67 | // pin3 M2A 68 | // pin4 M3A 69 | // Caution this is pretty slow and limits the max speed of the motor to about 500/3 rpm 70 | void AFMotorShield::setOutputPins(uint8_t mask) 71 | { 72 | uint8_t i; 73 | 74 | digitalWrite(MOTORLATCH, LOW); 75 | digitalWrite(MOTORDATA, LOW); 76 | 77 | for (i=0; i<8; i++) 78 | { 79 | digitalWrite(MOTORCLK, LOW); 80 | 81 | if (mask & _BV(7-i)) 82 | digitalWrite(MOTORDATA, HIGH); 83 | else 84 | digitalWrite(MOTORDATA, LOW); 85 | 86 | digitalWrite(MOTORCLK, HIGH); 87 | } 88 | digitalWrite(MOTORLATCH, HIGH); 89 | } 90 | 91 | AFMotorShield stepper(AccelStepper::HALF3WIRE, 0, 0, 0, 0); // 3 phase HDD spindle drive 92 | 93 | void setup() 94 | { 95 | stepper.setMaxSpeed(500); // divide by 3 to get rpm 96 | stepper.setAcceleration(80); 97 | stepper.moveTo(10000000); 98 | } 99 | 100 | void loop() 101 | { 102 | stepper.run(); 103 | } 104 | -------------------------------------------------------------------------------- /MMKIT/doc/FloodFillAlgorithm_2nextMove_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/FloodFillAlgorithm/nextMove.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
nextMove.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | unsigned char nextMove (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/MMkitSeqMotion_2nextMove_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/MMkitSeqMotion/nextMove.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
nextMove.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | unsigned char nextMove (unsigned char State)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/Advanced_2MMkitSeqMotion_2Acceleration_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/MMkitSeqMotion/Acceleration.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
Acceleration.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void acceleration (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/Advanced_2RandomNextMove_2Acceleration_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/RandomNextMove/Acceleration.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
Acceleration.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void acceleration (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/Advanced_2RightWallFollow_2Acceleration_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/RightWallFollow/Acceleration.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
Acceleration.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void acceleration (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/Advanced_2TesteMicromouse_2Acceleration_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/TesteMicromouse/Acceleration.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
Acceleration.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void acceleration (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/RightWallFollow_2nextMove_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/RightWallFollow/nextMove.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
nextMove.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | unsigned char nextMove (unsigned char State)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/odometry_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/RightWallFollow/odometry.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
odometry.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | unsigned char odometry (unsigned char THETA, unsigned char MOVE)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/Advanced_2FloodFillAlgorithm_2Acceleration_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/FloodFillAlgorithm/Acceleration.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
Acceleration.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 |

58 | Functions

60 | void acceleration (void)
 
63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_97206bf5efc8a056e59b25e67411479c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic/MoveFoward Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
MoveFoward Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 | 60 | 61 |

56 | Files

file  Acceleration.ino
 
file  MoveFoward.ino
 
62 |
63 | 64 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /MMKIT/doc/dynsections.js: -------------------------------------------------------------------------------- 1 | function toggleVisibility(linkObj) 2 | { 3 | var base = $(linkObj).attr('id'); 4 | var summary = $('#'+base+'-summary'); 5 | var content = $('#'+base+'-content'); 6 | var trigger = $('#'+base+'-trigger'); 7 | var src=$(trigger).attr('src'); 8 | if (content.is(':visible')===true) { 9 | content.hide(); 10 | summary.show(); 11 | $(linkObj).addClass('closed').removeClass('opened'); 12 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); 13 | } else { 14 | content.show(); 15 | summary.hide(); 16 | $(linkObj).removeClass('closed').addClass('opened'); 17 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); 18 | } 19 | return false; 20 | } 21 | 22 | function updateStripes() 23 | { 24 | $('table.directory tr'). 25 | removeClass('even').filter(':visible:even').addClass('even'); 26 | } 27 | 28 | function toggleLevel(level) 29 | { 30 | $('table.directory tr').each(function() { 31 | var l = this.id.split('_').length-1; 32 | var i = $('#img'+this.id.substring(3)); 33 | var a = $('#arr'+this.id.substring(3)); 34 | if (l 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/TestUART1 Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
TestUART1 Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 | 60 | 61 |

56 | Files

file  Acceleration.ino
 
file  TesteUART1.ino
 
62 |
63 | 64 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_83ae17484a6bf3bb38cfccb0fdab562b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/RandomNextMove Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
RandomNextMove Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 | 60 | 61 |

56 | Files

file  Acceleration.ino
 
file  RandomNextMove.ino
 
62 |
63 | 64 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_8d38b807a6e3e45699ecf424d534bc3d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/TesteMicromouse Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
TesteMicromouse Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 | 60 | 61 |

56 | Files

file  Acceleration.ino
 
file  TesteMicromouse.ino
 
62 |
63 | 64 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /MMKIT/doc/Test__Button_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic/Test_Button/Test_Button.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
Test_Button.ino File Reference
54 |
55 |
56 | 57 | 59 | 61 | 62 | 64 | 65 |

58 | Functions

60 | void setup ()
 
63 | void loop ()
 
66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /MMKIT/examples/Advanced/TesteMicromouse/TesteMicromouse.ino: -------------------------------------------------------------------------------- 1 | /**@file*/ 2 | /* 3 | This example was created by Sérgio Silva 4 | on the 20th April 2015 5 | 6 | This code example is in the public domain. 7 | 8 | Description: 9 | The LED on pin 13 RED LED turns ON when one of the switch is ON 10 | Makes 4 blinking combination switch 11 | | switchs| pin 12 | |Position| value 13 | | |I 0| | PIN2 0 14 | | |I 0| | PIN3 0 15 | ------------------ 16 | | |0 I| | PIN2 1 17 | | |I 0| | PIN3 0 18 | ------------------ 19 | | |I 0| | PIN2 0 20 | | |0 I| | PIN3 1 21 | ------------------ 22 | | |0 I| | PIN2 1 23 | | |0 I| | PIN3 1 24 | 25 | */ 26 | #include // Accelaration library 27 | #include // MMkit library 28 | 29 | AccelStepper motorLeft(AccelStepper::DRIVER, 9, 8); // declaration of motorLeft to control the MMkit 30 | AccelStepper motorRight(AccelStepper::DRIVER, 11, 10); // declaration of motorRight to control the MMkit 31 | 32 | MMkit Grigoras(motorLeft, motorRight); // declaration of object variable to control the MMkit 33 | 34 | enum statesRobotMovements { 35 | STATE_MOV_IDLE, 36 | STATE_MOV_FRONT, 37 | STATE_MOV_RIGHT, 38 | STATE_MOV_LEFT, 39 | STATE_MOV_UTURN, 40 | STATE_MOV_STOP 41 | }; 42 | 43 | unsigned char stateMovement = STATE_MOV_FRONT; 44 | unsigned char toMove = STATE_MOV_FRONT; 45 | char value = B00; 46 | unsigned int velocidade = 10; 47 | double aceleration = 1; //usada para chegar a velocidade 48 | unsigned long previousMicros=0; 49 | void setup() { 50 | pinMode(2, INPUT); 51 | pinMode(3, INPUT); 52 | pinMode(13, OUTPUT); 53 | Grigoras.setupMMkit(); // Starts the MMkit 54 | Grigoras.goForward(2000.0); //distance to go forward in cm (18.0) means 18.0cm 55 | Grigoras.setForwardMotionSpeed(velocidade); //sets forward speed if value < 40 = cm/s 56 | } 57 | 58 | void loop() { 59 | value = B00; 60 | if (digitalRead(3) == 1) { 61 | value = value | B01; 62 | } 63 | if (digitalRead(2) == 1) { 64 | value = value | B10; 65 | } 66 | Serial.println(value,BIN); 67 | switch (value) { 68 | case B11: 69 | Grigoras.testIRSensors(); 70 | Grigoras.current_cell.wall = B00000000; // clears cell values 71 | if ( Grigoras.isWallLeft() == 1) { // wall 0000 0 LRF checks if there is a left wall 72 | Grigoras.current_cell.wall = Grigoras.current_cell.wall | B00000100; 73 | } 74 | if ( Grigoras.isWallFront() == 1) { // wall 0000 0 LRF checks if there is a front wall 75 | Grigoras.current_cell.wall = Grigoras.current_cell.wall | B00000001; 76 | } 77 | if ( Grigoras.isWallRight() == 1) { // wall 0000 0 LRF checks if there is a right wall 78 | Grigoras.current_cell.wall = Grigoras.current_cell.wall | B00000010; 79 | } 80 | Serial.println(Grigoras.current_cell.wall, BIN); 81 | digitalWrite(13, HIGH); 82 | delay(1000); 83 | digitalWrite(13, LOW); 84 | delay(1000); 85 | break; 86 | case B10: 87 | digitalWrite(13, HIGH); 88 | delay(500); 89 | digitalWrite(13, LOW); 90 | delay(500); 91 | break; 92 | case B01: 93 | digitalWrite(13, HIGH); 94 | delay(100); 95 | digitalWrite(13, LOW); 96 | delay(100); 97 | break; 98 | case B00: 99 | if (Grigoras.running() == true) { 100 | acceleration(); 101 | Grigoras.runSpeed(); //moves at the desired speed 102 | } 103 | else { 104 | Grigoras.stop(); 105 | } 106 | break; 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /MMKIT/doc/structMMkit_1_1cell-members.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: Member List 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 45 | 49 |
50 |
51 |
52 |
MMkit::cell Member List
53 |
54 |
55 | 56 |

This is the complete list of members for MMkit::cell, including all inherited members.

57 | 58 | 59 | 60 | 61 | 62 | 63 |
theta (defined in MMkit::cell)MMkit::cell
wall (defined in MMkit::cell)MMkit::cell
weight (defined in MMkit::cell)MMkit::cell
x (defined in MMkit::cell)MMkit::cell
y (defined in MMkit::cell)MMkit::cell
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_6a1f418063e6d5990bbad65b4484ba91.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/BluetoothCom Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
BluetoothCom Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 |

56 | Files

file  Acceleration.ino
 
file  BluetoothCom__new.ino
 
file  nextMove.ino
 
file  robotMove.ino
 
66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_592569b4388661b9b54987c21ff28f23.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/MMkitSeqMotion Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
MMkitSeqMotion Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 |

56 | Files

file  Acceleration.ino
 
file  MMkitSeqMotion.ino
 
file  nextMove.ino
 
file  robotMove.ino
 
66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_49c0c3b1034d927ad83ff3370afdee52.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/FloodFillAlgorithm Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
FloodFillAlgorithm Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 |

56 | Files

file  Acceleration.ino
 
file  FloodFillAlgorithm.ino
 
file  nextMove.ino
 
file  robotMove.ino
 
66 |
67 | 68 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /MMKIT/doc/Button__switch_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic/Button_switch/Button_switch.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions | 52 | Variables
53 |
54 |
Button_switch.ino File Reference
55 |
56 |
57 | 58 | 60 | 62 | 63 | 65 | 66 |

59 | Functions

61 | void setup ()
 
64 | void loop ()
 
67 | 69 | 71 | 72 |

68 | Variables

70 | int value =0
 
73 |
74 | 75 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /MMKIT/doc/Button__switch__Bin_8ino.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Basic/Button_switch_Bin/Button_switch_Bin.ino File Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 | Functions | 52 | Variables
53 |
54 |
Button_switch_Bin.ino File Reference
55 |
56 |
57 | 58 | 60 | 62 | 63 | 65 | 66 |

59 | Functions

61 | void setup ()
 
64 | void loop ()
 
67 | 69 | 71 | 72 |

68 | Variables

70 | char value =B00
 
73 |
74 | 75 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /MMKIT/doc/dir_86087c4770309f08313423a25610c00b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MMkit: examples/Advanced/RightWallFollow Directory Reference 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | 19 | 20 | 26 | 27 | 28 |
21 |
MMkit 22 |  V1.0 23 |
24 |
Micromouse Kit for The Micromouse Portuguese Contest
25 |
29 |
30 | 31 | 32 | 39 | 44 | 48 |
49 |
50 |
51 |
RightWallFollow Directory Reference
52 |
53 |
54 | 55 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |

56 | Files

file  Acceleration.ino
 
file  nextMove.ino
 
file  odometry.ino
 
file  RightWallFollow.ino
 
file  robotMove.ino
 
68 |
69 | 70 | 75 | 76 | 77 | --------------------------------------------------------------------------------