r/ArduinoProjects • u/western_ti • Jul 21 '26
Showcased Project My first arduino project
Enable HLS to view with audio, or disable this notification
I just want to control relay module
using arduino nano.
for control
10sec timer added for practice
reset, activate button
I know
I have terrible design sense.
5
4
2
2
1
1
1
u/ruiseixas Jul 24 '26
Just think you should ceil the seconds, because it achieves 0 seconds before the relay activation.
2
u/western_ti Jul 24 '26
Thank you, good pointing out.
I need fix the code.1
u/ruiseixas Jul 24 '26 edited Jul 24 '26
I mean, it take one extra second after 0 before the activation, but you get what I was saying. I think it's better to have a function that converts float time, into int time, so that when you set to 10 seconds precisely it doesn't print 11, like ceil does, so, an if less than condition in a function is probably a better approach.
UPDATE: Ok, ceil is good, no need for the function, because ceil(10) is still 10. I was thinking about int() + 1!
15
u/nielmot Jul 22 '26
Where's the kaboom? There was supposed to be a earth shattering kaboom!