Question: I am currently doing a project that includes an attiny 8 5 microcontroller and two LEDs ( green for power indication and red for skin
I am currently doing a project that includes an attiny microcontroller and two LEDs green for power indication and red for skin contact and two ohm resistors connected between the cathode of each LED and to GND I have the red LED defined at PBpin the green LED defined at PBpin and copper tapematerial connected to PBpin Additionally, VCC is connected to pin and GND is connected to pin One end of the wire connected to PB is soldered to the actual copper material which makes it crucial for skin detection. Please write a C that will:
keep the green LED on at all times
have the red LED blink every ms when the skin is in contact with the copper material. The red LED should not blink every single time the skin is in contact with the copper material. The main goal is to set the probability that the red LED will blink when the skin gets in contact with the copper material is The red LED must keep blinking while the skin is in contact with the copper material at a random instance with a probability of Otherwise, the red LED will stay off.
For example, the circuit is powered on and once it is powered on the user puts his finger on the copper material and the red LED blinks every ms then when he lets go of the copper material, the the red LED stops blinking. And then he tries to touch the copper material the second time but the red LED does not blink given the condition I wanted to be set. Then it stays like that until it comes a fifth time where the red LED starts to blink again when he touches the copper material the fifth time. The point is that this behavior has to be random. Please test the code to ensure it is working exactly how I described it above before submitting it
I will be using this code in the Arduino IDE software.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
