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:daf6195ac7a7, 2015-12-23 (annotated)
- Committer:
- mbed_Cookbook_SE
- Date:
- Wed Dec 23 15:38:22 2015 +0000
- Revision:
- 0:daf6195ac7a7
??
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 1 | #include "mbed.h" |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 2 | |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 3 | Ticker flipper; |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 4 | BusOut Col(dp3,dp6,dp7,dp8,dp9,dp10,dp11,dp12); |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 5 | BusOut Row(dp15,dp16,dp17,dp18,dp19,dp20,dp21,dp22); |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 6 | |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 7 | const uint8_t pt[8] = { |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 8 | 0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 9 | }; |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 10 | |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 11 | void flip() { |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 12 | static int col = 0; |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 13 | |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 14 | Row = 0; |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 15 | Col = pt[col]; |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 16 | Row = 1 << col; |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 17 | |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 18 | col++; |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 19 | col %= 8; |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 20 | } |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 21 | |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 22 | int main() { |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 23 | flipper.attach(&flip, 0.002); |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 24 | |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 25 | while(1) { |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 26 | } |
| mbed_Cookbook_SE | 0:daf6195ac7a7 | 27 | } |