/** comparatorin_demo * Simple program to demonstrate the basic functions * of the analog comparator of the FRDM-KL25Z board. * * Used library: * - ComparatorIn //https://developer.mbed.org/users/frankvnk/code/ComparatorIn/ * written by Frank Vannieuwkerke * * Hardware requirements: * - FRDM-KL25 board * - CdS photoresistor pulled up by 10 k * - Connecect the midpoint of the divider to PTE29 * * 10k CdS photoresistor * +3.3V --/\/\/\---+---/\/\/\---- GND * | * PTE29 * */

Dependencies:   ComparatorIn mbed

Fork of 05_comparator_demo by Istvan Cserny

Revision:
1:fb35e688f9f4
Parent:
0:e5deffde916d
Child:
2:bb19e60cb933
--- a/main.cpp	Wed Jun 05 18:07:02 2013 +0000
+++ b/main.cpp	Wed Jun 05 18:51:15 2013 +0000
@@ -28,7 +28,7 @@
     cmp_en = 1;
 
     compi._callbackISR(&cmp_ISR);               // Set comparator callback to cmp_ISR
-    compi.treshold(0x20);                       // Set copmarator threshold to 1.03V = 20 * 3.3V / 64
+    compi.treshold(0x20);                       // Set comparator threshold to 1.65V = 32 * 3.3V / 64
 
     while(1)
     {