Adam Ciechalski
/
Inst_LAB_3
Potentiometers experiment
main.cpp@0:f842d2e7c87f, 2019-04-13 (annotated)
- Committer:
- AdamCiechalski
- Date:
- Sat Apr 13 13:36:12 2019 +0000
- Revision:
- 0:f842d2e7c87f
- Child:
- 1:9444965b4725
LAB3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AdamCiechalski | 0:f842d2e7c87f | 1 | #include "mbed.h" |
AdamCiechalski | 0:f842d2e7c87f | 2 | #include "C12832.h" |
AdamCiechalski | 0:f842d2e7c87f | 3 | |
AdamCiechalski | 0:f842d2e7c87f | 4 | C12832 lcd(p5, p7, p6, p8, p11); |
AdamCiechalski | 0:f842d2e7c87f | 5 | PwmOut led1(LED1); |
AdamCiechalski | 0:f842d2e7c87f | 6 | AnalogIn pot1(p19); |
AdamCiechalski | 0:f842d2e7c87f | 7 | |
AdamCiechalski | 0:f842d2e7c87f | 8 | |
AdamCiechalski | 0:f842d2e7c87f | 9 | int main() { |
AdamCiechalski | 0:f842d2e7c87f | 10 | while(1) { |
AdamCiechalski | 0:f842d2e7c87f | 11 | led1 = pot1; |
AdamCiechalski | 0:f842d2e7c87f | 12 | lcd.cls(); |
AdamCiechalski | 0:f842d2e7c87f | 13 | lcd.locate(0,3); |
AdamCiechalski | 0:f842d2e7c87f | 14 | lcd.printf("value of pot1 is %f\n", pot1.read()); |
AdamCiechalski | 0:f842d2e7c87f | 15 | wait(0.05); |
AdamCiechalski | 0:f842d2e7c87f | 16 | } |
AdamCiechalski | 0:f842d2e7c87f | 17 | } |
AdamCiechalski | 0:f842d2e7c87f | 18 |