Hardware components | ||||||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
Software apps and online services | ||||||
![]() |
| |||||
![]() |
| |||||
This is my first project, so I hope you enjoy it!!
Circuit Diagram:
Link to TinkerCAD:
Photoresistor
C/C++Photoresistor has three pins , VCC, GND and OUTPUT
In this project, There are two parts, The Light Emitting Diode or LED circuit and Photoresistor circuit with a LED
THE CONNECTIONS :
For LED circuit (Arduino not needed);
LED(positive) - switch
LED(negative) - Battery(negative)
Switch - Battery(positive)
For Photoresistor;
LED(positive) - pin 13
LED(negative) - GND
Photoresistor(VCC) - 5v pin
Photoresistor(GND) - GND
Photoresistor(Output) - A0
Instead of the LED circuit, I am using a toy LED gun
In this project, There are two parts, The Light Emitting Diode or LED circuit and Photoresistor circuit with a LED
THE CONNECTIONS :
For LED circuit (Arduino not needed);
LED(positive) - switch
LED(negative) - Battery(negative)
Switch - Battery(positive)
For Photoresistor;
LED(positive) - pin 13
LED(negative) - GND
Photoresistor(VCC) - 5v pin
Photoresistor(GND) - GND
Photoresistor(Output) - A0
Instead of the LED circuit, I am using a toy LED gun
int led = 13;
void setup() {
Serial.begin(9600);
Serial.println("This a virtual gun shooting module");
Serial.println("Initializing VGSM");
delay(7000);
Serial.println("player one ready");
pinMode(led, OUTPUT);
}
void loop() {
int value = analogRead(A0);
if (value <= 31){
Serial.println("Player one is down");
digitalWrite(led, HIGH);
}
else {
Serial.println("Player one is active");
Serial.println(value);
delay(150);
digitalWrite(led, LOW);
}
}
//Author: Nithish Murugavenkatesh
int led = 13;
void setup() {
Serial.begin(9600);
Serial.println("This a virtual gun shooting module");
Serial.println("Initializing VGSM");
delay(9000);
Serial.println("player one ready");
pinMode(led, OUTPUT);
}
void loop() {
int value = analogRead(A0);
if (value <= 31){
Serial.println("Player one is down");
digitalWrite(led, HIGH);
}
else {
Serial.println("Player one is active");
Serial.println(value);
delay(150);
digitalWrite(led, LOW);
}
}





_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)




Comments