mbeduino with led dice shield

Dependencies:   mbed

main.cpp

Committer:
hsgw
Date:
2013-03-10
Revision:
0:86132e31ac47

File content as of revision 0:86132e31ac47:

#include "mbed.h"

int dice[7] = {0,8,65,73,85,93,119};

BusOut diceLeds(p29,p21,p30,p22,p23,p11,p12);

DigitalOut myled(LED1);

int main() {
    diceLeds = dice[5];
    while(1) {
    }
}


/*
Arduino sketch example

const int firstLedPin = 2;

const int dice[7][7] = {
  {0,0,0,0,0,0,0},
  {0,0,0,1,0,0,0},
  {1,0,0,0,0,0,1},
  {1,0,0,1,0,0,1},
  {1,0,1,0,1,0,1},
  {1,0,1,1,1,0,1},
  {1,1,1,0,1,1,1}
};

void setDice(int num){
  for(int i=0;i<7;i++){
    digitalWrite(firstLedPin+i,dice[num][i]);
  }
}

void setup(){
  for(int i=0;i<7;i++){
    pinMode(firstLedPin+i, OUTPUT);
  }
  setDice(5);
}

void loop(){}



*/