S T / Mbed 2 deprecated 7segb

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 
00003 BusOut Seg7(p5, p6, p7, p8, p9, p10, p11, p12);
00004 int SegChars[] = {0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 
00005     0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 };
00006 int count;
00007 
00008 int main() {
00009     while(1) {
00010         Seg7 = SegChars[(count++)%16 ];
00011         Seg7 = ~Seg7; // comment out for comon cathode, only for common anode
00012         wait(0.3);
00013     }
00014 }