7seg SPI LED mocude test program

Dependencies:   mbed spi7Seg

Committer:
morecat_lab
Date:
Fri Jan 30 21:08:20 2015 +0000
Revision:
1:48e2c8603f94
Parent:
0:1d34bbc9e7a4
1st publish

Who changed what in which revision?

UserRevisionLine numberNew contents of line
morecat_lab 0:1d34bbc9e7a4 1 #include "mbed.h"
morecat_lab 0:1d34bbc9e7a4 2 #include "Spi7Seg.h"
morecat_lab 0:1d34bbc9e7a4 3 #include "LAMd.h"
morecat_lab 0:1d34bbc9e7a4 4
morecat_lab 0:1d34bbc9e7a4 5 DigitalOut myled(LED1);
morecat_lab 0:1d34bbc9e7a4 6 Spi7Seg mySpi7Seg(D5, D6, D7);
morecat_lab 0:1d34bbc9e7a4 7
morecat_lab 0:1d34bbc9e7a4 8 int main() {
morecat_lab 0:1d34bbc9e7a4 9 int i=1;
morecat_lab 0:1d34bbc9e7a4 10 mySpi7Seg.begin();
morecat_lab 0:1d34bbc9e7a4 11 while(1) {
morecat_lab 0:1d34bbc9e7a4 12 myled = 1;
morecat_lab 1:48e2c8603f94 13 mySpi7Seg.writeNum(i);
morecat_lab 1:48e2c8603f94 14 // mySpi7Seg.writeHex(i);
morecat_lab 0:1d34bbc9e7a4 15 mySpi7Seg.update();
morecat_lab 1:48e2c8603f94 16 wait(0.02);
morecat_lab 0:1d34bbc9e7a4 17 myled = 0;
morecat_lab 1:48e2c8603f94 18 wait(0.02);
morecat_lab 0:1d34bbc9e7a4 19 i++;
morecat_lab 0:1d34bbc9e7a4 20 }
morecat_lab 0:1d34bbc9e7a4 21 }