Im not very good at this stuff and im trying to learn but i can’t find anything about this. All im trying to do is when a button is pressed and held then once released for longer than x amount of time the LED blinks once. But only after its been released for that x amount of time.
This has to be a simple program but I cant find anything that comes close to what im trying to do.
Any help would be greatly appreciated.
So, what have you tried? Only looking for code that looks like what you want isn't coding.
But what you need to do is to check the button, when it becomes pressed record the time, if it released, check if it was a long press, if so, remember the time again and remember you want to blink the led, wait until the desired interval passed, turn on led, save the time, wait until the interval for how long you want to led on has passed and turn it off and remember you now want to start all over.
i have no code yet but i have been watching videos and trying to learn. I think this one is close to what you are talking about
if im understanding this right and to keep it simple 1 sec will be my divider.
so i need to write something that once pressed it will need to pass 1000ms sec. Then when its released for longer than 1000ms it will turn on the LED for 500ms then turn off back off.
If I’m correct then if its press less than 1000ms it won’t do anything and also if it gets released but then pressed again within 1000ms it still won’t do anything.
i have no code yet
Then this is the time to start writing And if you don't know where to start then this isn't the right start for you. Read some tutorials about the basics of the Arduino and try to detect when a button BECOMES pressed or BECOMES released. From that you can extend it.
yeah i know. unfortunately i don't get as much time as i would like to work on these type of projects. thanks for the advice ill keep playing around with it when i get time.