Code for tamagotchi vpet


I hope I'm doing the right thing is this forum by making a new subject.

I'm new to Arduino, I'm alot more mechanical but I have a rough understanding of code.

What I need is a code to to turn a led on, for a back light I want to install into a v-pet tamagotchi. I want to be able to hold one of the buttons on the v-pet for around 2 seconds to turn the light on and stay on.

Then to turn off the light, hold the button again for 2 seconds.

I can also pay for the help.

Any help would be really appreciated.

Click "report to moderator" and request that they move your post to the "Gigs & Collaborations" forum section. Also remember to modify your post and mention how much you can pay.

Just did as requested thanks.


Hi lifelessfire - check your PM

This is basically a combination of state change detection and "blink without delay".

Record when the button last changed to pressed state (usually low); and if 2 seconds later still in that state switch the LED on or off.