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.
main.cpp@0:8ebdec6e7f39, 2015-02-10 (annotated)
- Committer:
- morecat_lab
- Date:
- Tue Feb 10 23:18:06 2015 +0000
- Revision:
- 0:8ebdec6e7f39
16 segment LED library test program 1st release
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| morecat_lab | 0:8ebdec6e7f39 | 1 | // |
| morecat_lab | 0:8ebdec6e7f39 | 2 | // 16 segment LED display library test program |
| morecat_lab | 0:8ebdec6e7f39 | 3 | // created by morecat_lab |
| morecat_lab | 0:8ebdec6e7f39 | 4 | // 2015/2/11 |
| morecat_lab | 0:8ebdec6e7f39 | 5 | // |
| morecat_lab | 0:8ebdec6e7f39 | 6 | // tested on LPC1114 mbed |
| morecat_lab | 0:8ebdec6e7f39 | 7 | |
| morecat_lab | 0:8ebdec6e7f39 | 8 | #include "mbed.h" |
| morecat_lab | 0:8ebdec6e7f39 | 9 | #include "Stnseg.h" |
| morecat_lab | 0:8ebdec6e7f39 | 10 | |
| morecat_lab | 0:8ebdec6e7f39 | 11 | // create an instance of 4digit 16segment dislpay |
| morecat_lab | 0:8ebdec6e7f39 | 12 | Stnseg my16seg(dp1, dp2, dp4, dp6, dp9, dp10, dp11, dp13); |
| morecat_lab | 0:8ebdec6e7f39 | 13 | |
| morecat_lab | 0:8ebdec6e7f39 | 14 | int main() { |
| morecat_lab | 0:8ebdec6e7f39 | 15 | int i = 0; |
| morecat_lab | 0:8ebdec6e7f39 | 16 | my16seg.setZeroSupress(0); |
| morecat_lab | 0:8ebdec6e7f39 | 17 | my16seg.begin(); |
| morecat_lab | 0:8ebdec6e7f39 | 18 | while(1) { |
| morecat_lab | 0:8ebdec6e7f39 | 19 | my16seg.writeNum(i++); |
| morecat_lab | 0:8ebdec6e7f39 | 20 | my16seg.setDot(i % 4); |
| morecat_lab | 0:8ebdec6e7f39 | 21 | if (i >= 10000) i = 0; |
| morecat_lab | 0:8ebdec6e7f39 | 22 | my16seg.updateWithDelay(50); |
| morecat_lab | 0:8ebdec6e7f39 | 23 | } |
| morecat_lab | 0:8ebdec6e7f39 | 24 | } |