[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself

Search:


View post   

>> No.2391173 [View]
File: 34 KB, 633x758, 1639398300078.png [View same] [iqdb] [saucenao] [google]
2391173

>>2391151
>You can use four voltage dividers instead of the opto thing.
Probably, but I "have" to use the opto-couplers. We already had some arduinos burn up because the people who originally built this room are backwards assed savages. Their solution to stop one device literally eating arduinos after a single use was to lay another ground line directly to that device. It wasn't in their plans or anything, they came up with that out of nowhere.
>But how does it clean up your code to use A?
Long ass description:
I assume that I will have to pull the inputs of the arduino high and sense a voltage drop with it. But to understand why that would fuck up my code you need to know the following:
The goal of the game is to press buttons within a timeframe as they light up. Lets say I have 4 leds, and 4 buttons (to simplifiy, in acutal, it's 10 leds, one inside one of 10 buttons each). The leds and buttons are coded bitwise into a variable each (lets say integers). When none of the leds are on, the status of that variable would look like this: L0000 and the variable for the buttons like this B0000. If I want to set one of the leds to flip on, I use a function that flips one of the leds, let's say L0010. From then on, the arduino is polling the input until the timer is up. If the button var matches the led var (L0010 = B0010), you pass and the next round starts. If they don't match, you start over. If my assumption is correct and the inputs indeed are high, the button var would look like this: B1101 instead and I would have to run an inverter. Nothing too hard, but I would have to check for it all the time and it would cost some cycles every time I would have to convert. I know, I'm bitching on a very high level, but I'm trying to hit a moving target (I didn't even know how to hold a soldering iron on march 2nd this year).

I can compile you the entire working mechanism if you want, but it will take a while.

>> No.1375399 [DELETED]  [View]
File: 34 KB, 633x758, sweaty.png [View same] [iqdb] [saucenao] [google]
1375399

I'm gonna kill myself tommorow

>> No.1339783 [View]
File: 34 KB, 633x758, 1518108473456.png [View same] [iqdb] [saucenao] [google]
1339783

>>1338880
>live in spain, third world country full of migrant shitskins taking all the jobs and welfare
>no jobs
>will probably never be able to own a house
>see this thread

>> No.1202512 [View]
File: 34 KB, 633x758, 234324234.png [View same] [iqdb] [saucenao] [google]
1202512

I don't even know how I feel about this thread, hope you live a long happy life anon.

Navigation
View posts[+24][+48][+96]