Dar Leg / Mbed 2 deprecated ubitRandomBlink

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 DigitalOut C[] = {(COL1), (COL2),(COL3)};
00004 DigitalOut R[] = {(ROW1), (ROW2),(ROW3)};
00005 
00006 int main() {
00007     int col = 0;
00008     int row = 0;
00009     
00010     while(1) {
00011         col = rand() % 2;
00012         row = rand() % 2;
00013         C[col] - 0;
00014         R[row] = 1;
00015         wait(0.9);
00016         R[row] = 0;
00017         C[col] = 1;
00018     }
00019 }