This Repository will explain my 4th task in Electronics and Electrical Power department at SMART METHODS summer training.
- Design a circuit for robot eyes using 2 LEDs and transistor.
-
Using 2n2222 transister (NPN) as a switch for the LEDs whcih will help to provide the required power for them.
- 2n2222 Transistor Datasheet.
- Design steps:
- Circuit daigram:
- Code using PWM:
// C++ code
//
int eysLED=3; // define led pin
void setup()
{
pinMode(eysLED, OUTPUT); // set as output
}
void loop()
{
analogWrite(eysLED, 255); //use PWM
delay(60); //delay in microsecond
}
- Task is Done 😍