Simple program to demonstrate the basic functions of the analog comparator of the FRDM-KL25Z board.

Dependencies:   ComparatorIn mbed

Fork of ComparatorIn_demo by Frank Vannieuwkerke

ComparatorIn demo

Simple program to demonstrate the basic functions of the analog comparator of the FRDM-KL25Z board.

The blue LED flashes after 2 sec delay. The green LED is driven by the interrupts of the Analog Comparator (LED ON at rising edge, LED OFF at falling edge).

The output of the Analog Comparatir is also tested by polling, the result is printed out at the standard output (UART0). The default speed and format (9600 bps, 8,N,1) are used.

Credits

This program is based on the ComparatorIn library and the ComparatorIn_demo program written by Frank Vannieuwkerke

Used library:

Hardware requirements:

  • FRDM-KL25 board
  • CdS photoresistor pulled up by 10 k

/media/uploads/icserny/05_comparator_demo.png

Files at this revision

API Documentation at this revision

Comitter:
icserny
Date:
Wed Nov 18 15:29:18 2015 +0000
Parent:
7:a4f884972a0e
Commit message:
First version

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Nov 11 08:12:13 2015 +0000
+++ b/main.cpp	Wed Nov 18 15:29:18 2015 +0000
@@ -1,4 +1,4 @@
-/** comparatorin_demo
+/** 05_comparator_demo
  *  Simple program to demonstrate the basic functions
  *  of the analog comparator of the FRDM-KL25Z board.
  *