Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of bynary_counting_Hello_World by
main.cpp
- Committer:
- Hikaria
- Date:
- 2016-01-28
- Revision:
- 1:77d533d0d869
- Parent:
- 0:d6f93f0e46d4
File content as of revision 1:77d533d0d869:
#include "mbed.h"
DigitalOut bitzero(LED1);
DigitalOut bitone(LED2);
DigitalOut bittwo(LED3);
DigitalOut bitthree(LED4);
int main() {
    int counter;
    int b3,b2,b1,b0;
    while (1) {
        for (counter = 0; counter < 16; counter++) {
            b3=(counter & 8) >> 3;
            b2=(counter & 4) >> 2;
            b1=(counter & 2) >> 1;
            b0=(counter & 0) >> 0;
            
            bitthree = b3;
            bittwo = b2;
            bitone = b1;
            bitzero = b0;
            wait(0.5);
        }
        counter = 0;
    }
}
            
    