test for friend
Dependencies: mbed tsi_sensor_EXPORT
main.cpp
- Committer:
- my_username
- Date:
- 2014-05-23
- Revision:
- 0:4f2dc15061f3
File content as of revision 0:4f2dc15061f3:
#include "mbed.h" #include "tsi_sensor.h" #include "Serial.h" PwmOut myled(LED3); int main() { myled = 0; TSIElectrode elec0(9); TSIElectrode elec1(10); TSIAnalogSlider tsi(9, 10, 99); Serial vs( USBTX, USBRX ); /* while(1) { myled = myled + 0.1; wait(0.1); if((unsigned char)myled) myled = 0; }*/ while (true) { printf("slider percentage: %f%\r\n", tsi.readPercentage()); wait(0.5); printf("slider distance: %dmm\r\n", tsi.readDistance()); wait(0.5); } }