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@6:869b37ae3497, 2020-02-10 (annotated)
- Committer:
- robindeleu
- Date:
- Mon Feb 10 10:08:59 2020 +0000
- Revision:
- 6:869b37ae3497
- Parent:
- 4:f0eb984c583d
2pots+lcd+rgb
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| chris | 0:cca95aa94e09 | 1 | #include "mbed.h" |
| chris | 2:989f84939300 | 2 | #include "C12832.h" |
| chris | 0:cca95aa94e09 | 3 | |
| chris | 4:f0eb984c583d | 4 | C12832 lcd(D11, D13, D12, D7, D10); |
| chris | 1:e50da1f1f653 | 5 | |
| chris | 3:100dbea70564 | 6 | AnalogIn pot1 (A0); |
| chris | 3:100dbea70564 | 7 | AnalogIn pot2 (A1); |
| chris | 0:cca95aa94e09 | 8 | |
| robindeleu | 6:869b37ae3497 | 9 | |
| robindeleu | 6:869b37ae3497 | 10 | PwmOut r (D5); |
| robindeleu | 6:869b37ae3497 | 11 | PwmOut g (D8); |
| robindeleu | 6:869b37ae3497 | 12 | PwmOut b (D9); |
| robindeleu | 6:869b37ae3497 | 13 | |
| chris | 0:cca95aa94e09 | 14 | int main() |
| chris | 0:cca95aa94e09 | 15 | { |
| robindeleu | 6:869b37ae3497 | 16 | lcd.cls(); |
| robindeleu | 6:869b37ae3497 | 17 | lcd.locate(0,3); |
| robindeleu | 6:869b37ae3497 | 18 | lcd.printf("P1 : P2"); |
| robindeleu | 6:869b37ae3497 | 19 | |
| robindeleu | 6:869b37ae3497 | 20 | while(true) { |
| robindeleu | 6:869b37ae3497 | 21 | r = pot1-pot2; |
| robindeleu | 6:869b37ae3497 | 22 | g = pot1; |
| robindeleu | 6:869b37ae3497 | 23 | b = pot2; |
| robindeleu | 6:869b37ae3497 | 24 | |
| robindeleu | 6:869b37ae3497 | 25 | |
| robindeleu | 6:869b37ae3497 | 26 | |
| robindeleu | 6:869b37ae3497 | 27 | |
| chris | 3:100dbea70564 | 28 | wait(0.1); |
| chris | 0:cca95aa94e09 | 29 | } |
| chris | 0:cca95aa94e09 | 30 | } |