Dear friend,
This is my first post so i want you to be lenient.
I have a arduino uno and i bought : 10 hall sensors, 3 LEDs and a 10k resistor.
I succesfully connected 1 hall sensor and 1 LED and it was functional!
Now i want to make a project that :
if the hall sensor is HIGH count 5 seconds then turn on the led.
I downloaded the CountUpDownTimer library but i have the following error:
no matching function for call to 'CountUpDownTimer::TimeCheck()
bellow is the code...
#include <CountUpDownTimer.h>
int h_sensor = 1;
int led = 13;
int h_state = 0;
int TimeCheck;
CountUpDownTimer T(UP);
void setup(){
T.StartTimer();
pinMode (led,OUTPUT);
pinMode (h_sensor,INPUT);
}
void loop(){
T.Timer();
h_state = digitalRead (h_sensor);
if (h_state == HIGH){
T.TimeCheck(T.Timer) {
(if T.Timer(5){
digitalWrite(led == HIGH);
}
digitalWrite(led == LOW);
}
}
system
2
I downloaded the CountUpDownTimer library
Why? It is trivial to record when a hall effect sensor reading changes from "no magnet nearby" to "magnet nearby".
Then, periodically (as illustrated in the blink without delay example), see if enough time has passed to warrant doing something.
It is a part from a project.
In this project i want to :
1)turn on the led.
2)when the hall sensor is HIGH.
3)turn off the led for 5 seconds.
4)turn on the led.
system
4
digitalWrite(led == HIGH);
}
digitalWrite(led == LOW);
Do you want to point to an example where you got this nonsense?
Robin2
5
@rodrigez_21, I suspect most of the techniques you require are covered in the demo Several Things at a Time
...R
@PaulS thanks for your time!
Robin2
7
rodrigez_21:
@PaulS thanks for your time!
@PaulS may not have a great bedside manner but his diagnoses are usually accurate.
...R