tomasz gurajek
/
lab2020potentiometr-experiment_modyfied
tomasz_gurajek
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "C12832.h" 00003 C12832 lcd(p5, p7, p6, p8, p11); 00004 PwmOut led1(LED1); 00005 AnalogIn pot1(p19); 00006 int main() { 00007 while(1) { 00008 led1 = pot1; 00009 wait(0.01); 00010 lcd.locate(0,0); //brings the cursor on the LCD display back to the top left corner 00011 lcd.printf("Value = %.2f\n\r",pot1.read()); // displays the value on the LCD 00012 lcd.printf("Value = %.2e\n\r",pot1.read()); // displays the value on the LCD 00013 } 00014 }
Generated on Sun Oct 9 2022 00:02:43 by 1.7.2