Question
PIR motion sensor on the ARM MBED this is the code now. with an interrupt in and fall edge. I'm not sure how to implement
PIR motion sensor on the ARM MBED
this is the code now. with an interrupt in and fall edge. I'm not sure how to implement the Lcd screen as when I put it into it it doesn't seem to work? how do I get it so where the alarm is triggered and its a falling edge, a message will appear on the screen?
thanks George
#include "mbed.h" #include "C12832.h" //example using InterruptIn with the input from the PIR motion sensors InterruptIn alarm(p11); DigitalOut led(LED1); DigitalOut flash(LED4); C12832 lcd(p5, p7, p6, p8, p11); void flip() { led = !led; } int main() { alarm.mode(PullUp); wait(2); alarm.fall(&flip); // attach the address of the flip function to the falling edge while(1) { // wait around, interrupts will interrupt flash = !flash; wait(0.25); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started