Timer that can detect game usage

April 9, 2024, 14:22

necoarcstan

Hey all. Trying to make a timer that when plugged in, times how long I've been playing a game and after a set time, say four hours, it'll start making a loud noise. I've got the raspberry pi pico, a breadboard, headers, wires, speakers, soldering equipment. Now I just need to know what to start doing. Any help is greatly appreciated.

k9t33n

do you know python?

necoarcstan

sorry for the "little" delay, I know a minimal amount.

oops.se

If you create a script that starts the game and it also have a start/stop of a timer before and after the game start.

necoarcstan

ok, noted

k9t33n

I could just make your entire script right now but I don't want to spoon feed

k9t33n

So instead I'll just give you hints

k9t33n

Like: check the time module documentation

k9t33n

Which you can create a timer with

k9t33n

Come back to me once you manage to get it to print something after 10 minutes but not before

necoarcstan

I am sorry

necoarcstan

im having a major skill issue. Where should I go to learn how to do this?

k9t33n

.

necoarcstan

i followed Bro's Code's timer to the letter and got a timer that prints out a digitial clock display for each second. it can't go past into days but I don't need it to, only need it to keep time for four hours

k9t33n

Yeah

k9t33n

Great

necoarcstan

now the main thing is how to make this timer only operate when playing a video game 🤔

k9t33n

So you have figured out how to also then print something only after a certain amount of time?

k9t33n

I think steam has an API

k9t33n

I'll check later

necoarcstan

that uses the .sleep function right?

k9t33n

That is an option yes

necoarcstan

:3 yippie!

k9t33n

The sleep function is in seconds btw

necoarcstan

yup, you have to input time in seconds for this timer