Hi there, my frist post, on e14 community (just to you know, im a nurse in a nursing home, have some experience in arduino, (copy/past coding, and i have an quadcopter based in the Ardupilot)
Now my problem, i have an pacient with Alzheimer disease, that fall asleep in the toilet, some times more than an hour, i want to use an HC-SR04 range finder to make a simple task: (a detail the toilet is used by other that use regularly the toilet)
Scanning distance to target (person sit on toilet)
IF is less to 50cm AND for more than 10min
Activate LED
Activate a Servo ( to pull the emergency bell)
Loop
Now im trying to learn the code, and i understand the code for range findings, and millis (to time), but i didint get the way to make the statemant IF => 50 && 6000sec
Cant see a way to create the code
I hope you help me