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 BinaryCount by
main.cpp
- Committer:
- CSTritt
- Date:
- 2017-09-13
- Revision:
- 6:0c1ab2c11252
- Parent:
- 5:f723b267eae3
- Child:
- 7:031078522195
File content as of revision 6:0c1ab2c11252:
/* Project: BinaryCount File: main.cpp Displays 4 bit binary count on bar graph display. Written by: Dr. C. S. Tritt Created: 9/13/17 (v. 1.0) */ #include "mbed.h" BusOut barGraph(D5, D4, D3, D2); // Create barGraph BusOut object. DigitalOut pinD7(D7); // Needed to force this pin off. int main() { printf("Binary count example\n"); // ID software. pinD7 = 0; // Force pin D7 off. This shouldn't be necessary. barGraph = 0; // Light top bar. while(true) { barGraph = barGraph + 1; // Add one to count. wait(1.0); if (barGraph == 15) { barGraph = 0; } } }