Hacking the MiP - ProMini Pack

This Tutorial is Retired!

This tutorial covers concepts or technologies that are no longer current. It's still here for you to read and enjoy, but may not be as useful as our newest tutorials.

Pages
Contributors: CaseyTheRobot
Favorited Favorite 2

Installing the Library and Using commands

The MiP has a very complex set of commands that can be used. To get started, first download the Arduino library and install it into your Arduino IDE. Take a look at this tutorial on installing Arduino Libraries.

To find a complete list of commands and functions head over to the Github page where we will continue to add functionality as it becomes available.

The Demo Sketch is very simple to show how the basic library works:

language:c
#include "MiP_commands.h"

MiP MyMiP(2);

void setup(){

  MyMiP.init(); //Serial port is configured for 115200
  Serial.print("MiP is Alive!!!");
  delay(100); //Need a delay to let the buffer clear before sending new commands

}

void loop() {

MyMiP.playSingleSound(BURP);  //Make burp sound
delay(100);
MyMiP.distanceDrive(20, 45);  //Drive +20 cm and turn 45 degrees
loop_LEDs();  //built function to blink LED's

delay(5000);

}

void loop_LEDs(){

    MyMiP.setChestLED(255, 0, 0); //Set LED to RED
    delay(200);
    MyMiP.setChestLED(0, 255, 0); //Set LED to GREEN
    delay(200);
    MyMiP.setChestLED(0, 0, 255); //Set LED to BLUE
    delay(200);

}