Chris Styles
/
EA_potentiometer
An example program showing how to use the Potentiometer on the Embedded Artists baseboard
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 // Potentionmeter is on mbed p15 00004 // Ensure J27 is fitted 00005 00006 AnalogIn pot (p15); 00007 00008 Serial pc (USBTX,USBRX); 00009 00010 int main() { 00011 while(1) { 00012 float ain = pot; 00013 pc.printf("Analog pot voltage = %.2fv\n",ain*3.3); 00014 wait(0.2); 00015 } 00016 }
Generated on Thu Jul 14 2022 21:02:25 by 1.7.2