Extensions Port

From MigWiki
Jump to: navigation, search

All Mignon microcontroller kits are equipped with the same 5 pin expansion port.

‎Your Mignon Game Kit is compatible to the Arduino I/O board. The main difference is that most of the micro-controller pins are used to drive dot-matrix-display, speaker, and the buttons. But some of the pins are left over! With this pins you can start very exciting input / output experiments.

Blinking LED

One would plug the long leg (+) of a LED to the first digital pin 5. Accordingly the short leg (-) should be connected to a series resistor ca. 220 Ohm and the other end of the resistor to GND. You need the series resistor to avoid the a fusing of the LED.

Now you can run you LED blinking with the following code:

int ledPin =  5;                // LED connected to digital pin 5
void setup()   {                
 pinMode(ledPin, OUTPUT);      // initialize the digital pin as an output

void loop()                     
 digitalWrite(ledPin, HIGH);   // set the LED on
 delay(1000);                  // wait for a second
 digitalWrite(ledPin, LOW);    // set the LED off
 delay(1000);                  // wait for a second

Sensor Read Send

With his code you can read a electric currents between 0 and 5 V. The forth pin of the EXTENSION port "pin 19 / adc 5" is the sensor pin. "adc" means analog / digital converter and is compatible to "Analogin" on the Arduino board. If you connect a sensor such as a photo cell you can control the speed of the blinking LED with light. And via MigProg this example sends numeric values to your computer. One can use this stream for instance with a processing application [1].

int sensorPin = 5;                      // select the input pin for the potentiometer
int ledPin = 5;                         // select the pin for the LED
int sensorValue = 0;                    // variable to store the value coming from the sensor

void setup() {
  pinMode(ledPin, OUTPUT);              // declare the ledPin as an OUTPUT
  Serial.begin(9600);                   // open the serial port at 9600 bps

void loop() {
  sensorValue = analogRead(sensorPin);  // read the value from the sensor
  digitalWrite(ledPin, HIGH);           // turn the ledPin on
  delay(sensorValue);                   // stop the program for <sensorValue> milliseconds
  digitalWrite(ledPin, LOW);            // turn the ledPin off
  delay(sensorValue);                   // stop the program for for <sensorValue> milliseconds
  Serial.println(sensorValue);          // print it out to the serial port

Control RGB LED

by Sebastian Sester



#include <avr/pgmspace.h>
int k=0;
void setup(){
  // Initialise the pins
  pinMode(5, OUTPUT); 
  pinMode(6, OUTPUT); 
  pinMode(7, OUTPUT);

void loop(){
  // Reset pins
  digitalWrite(5, LOW);
  digitalWrite(6, LOW);
  digitalWrite(7, LOW);
  // Read input
  k = analogRead(5) / 100;

  // Decide which pins should be activated
  if((k >= 0 && k < 4) || k >= 10)
    digitalWrite(5, HIGH);
  if((k >= 2 && k < 7) || k >= 10)
    digitalWrite(6, HIGH);
  if(k >= 6)
    digitalWrite(7, HIGH);
  if((k > 8 && k < 10) || k >= 10) {
    digitalWrite(5, HIGH);
  // wait & start again


You could also control a LCD with the MGK: LCD-Extension

LED Stripe


( Link to the old page: Examples for the Mignon Game Kit )