Usage of Hysteresis library and sample code with LED.
Dependencies: HysteresisIn mbed
main.cpp
00001 #include "mbed.h" 00002 #include "HysteresisIn.h" 00003 00004 //analog pin, two thresholds and initial state 00005 HysteresisIn hy(PTB0, 0.3, 0.7, 0); 00006 DigitalOut led(PTA5); 00007 00008 int main() { 00009 while(1) { 00010 led = hy.read(); //boolean value 00011 wait(1); 00012 00013 } 00014 } 00015
Generated on Mon Jul 18 2022 19:16:31 by 1.7.2