[ 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.1721332 [View]
File: 593 KB, 716x1028, SimpleLedCircuit.png [View same] [iqdb] [saucenao] [google]
1721332

>>1721234
To be fair, arduino's are so cheap now its almost stupid NOT to be using one. Pic related...

Simple circuit to turn an LED on when the Arduino is on. The green wire feeds 3.3v into D12, and in code I check if it is Logical HIGH (This ensures the LED ONLY turns on when the arduino is powered). I also added a 100k pull down resistor to D12 to make sure it is LOW when the arduino is off.
The code is fairly simple too...Basically
>>Read D12 into a variable
>>If (D12 == 1) {D10 = 1}
>>else {D10 = 0}
>>Delay(1)

Pretty straight forward. I check as fast as i can (1milli second) if the arduino is on. If it is, turn LED on. If its not, turn LED off.

If anyone is interested in the code, im more than happy to share

Another bonus is you only need 1 usb cable to run the whole thing!

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