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@2:6bc37de37167, 2020-07-31 (annotated)
- Committer:
- kevinsullivan
- Date:
- Fri Jul 31 20:44:25 2020 +0000
- Revision:
- 2:6bc37de37167
- Parent:
- 1:44729c5f024a
- Child:
- 3:ace46fcebfd6
summerlab2020 Q2_2
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| kevinsullivan | 0:376219f61e79 | 1 | #include "mbed.h" |
| kevinsullivan | 0:376219f61e79 | 2 | #include "C12832.h" |
| kevinsullivan | 2:6bc37de37167 | 3 | |
| kevinsullivan | 0:376219f61e79 | 4 | Serial pc(USBTX, USBRX); // tx, rx |
| kevinsullivan | 0:376219f61e79 | 5 | PwmOut led1(LED1); |
| kevinsullivan | 2:6bc37de37167 | 6 | PwmOut led2(LED2); |
| kevinsullivan | 0:376219f61e79 | 7 | AnalogIn pot1(p19); |
| kevinsullivan | 0:376219f61e79 | 8 | C12832 lcd(p5,p7,p6,p8,p11); |
| kevinsullivan | 2:6bc37de37167 | 9 | |
| kevinsullivan | 0:376219f61e79 | 10 | int main() |
| kevinsullivan | 0:376219f61e79 | 11 | { |
| kevinsullivan | 0:376219f61e79 | 12 | while(1) { |
| kevinsullivan | 2:6bc37de37167 | 13 | float volt_out = pot1; |
| kevinsullivan | 0:376219f61e79 | 14 | led1 = pot1; |
| kevinsullivan | 2:6bc37de37167 | 15 | led2 = !led1; // NOT LED1; When led1 is off led2 is on. |
| kevinsullivan | 0:376219f61e79 | 16 | wait(0.01); |
| kevinsullivan | 0:376219f61e79 | 17 | lcd.locate(0,0); //brings the cursor on the LCD back to the top left corner |
| kevinsullivan | 2:6bc37de37167 | 18 | lcd.printf("value = %.3fV\n",volt_out); // displays the voltage value on the LCD1 to 3 decimal places |
| kevinsullivan | 2:6bc37de37167 | 19 | lcd.printf("value = %.1eV\n",volt_out); // displays the voltage value on the LCD1 in scientific notation |
| kevinsullivan | 2:6bc37de37167 | 20 | lcd.printf("getting there!"); |
| kevinsullivan | 0:376219f61e79 | 21 | } |
| kevinsullivan | 0:376219f61e79 | 22 | } |