Jhon Plantikow
/
MensureCapacitor
User a frequecy of response using LM555 in circuit to mensure the capacitor unit
Diff: main.cpp
- Revision:
- 0:8b2d83f469fa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Jun 25 00:26:16 2015 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "capSense.h" +#include <ctype.h> + + +#define RA 51000 // ohms +#define RB 22000 // ohms +#define PERIOD 2000000 //us + + +Serial pc(SERIAL_TX, SERIAL_RX); +CapSense cap(RA, RB, PERIOD, PB_9); + +int main() +{ + while(1) + { + float capacitance = cap.measure(); + pc.printf("%.4f#%.2f\n", capacitance,(float)cap._count/1.999); + } +} \ No newline at end of file