![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Lab exercise 2.2 Potentiometers experiment
main.cpp
- Committer:
- ciaranom
- Date:
- 2020-06-20
- Revision:
- 0:9f16c71a1120
- Child:
- 1:1bb7bf26a054
File content as of revision 0:9f16c71a1120:
#include "mbed.h" #include "C12832.h" PwmOut led1(LED1); AnalogIn pot1(p19); C12832 lcd(p5, p7, p6, p8, p11); float pot1val; int main() { while(1) { led1 = pot1; wait(0.01); pot1val = pot1*100; lcd.cls(); wait(.1); lcd.locate(0,0); lcd.printf("Pot1 value: %.4f", pot1val); wait(1); lcd.cls(); wait(.1); lcd.locate(0,0);; lcd.printf("Pot1 value: %.4e", pot1.read()); wait (1); } }