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

Committer:
icserny
Date:
Wed Nov 18 15:29:18 2015 +0000
Revision:
8:a5b18dfe684f
Parent:
6:59d91df28f63
First version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
frankvnk 6:59d91df28f63 1 http://mbed.org/users/frankvnk/code/ComparatorIn/#e6a4cd28e217