Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The code for Light Sensor LED Brightness Control System with ATMEGA3
- http://www.instructables.com/id/Light-Sensor-LED-Brightness-Control-System-for-Ard/
- 1.ICStation UNO R3 with USB compatible with Arduino
- http://www.icstation.com/product_info.php?products_id=3516
- 2.Bread board
- http://www.icstation.com/product_info.php?products_id=1450
- 3.Highlight LED light emitting diode
- http://www.icstation.com/product_info.php?products_id=3226
- 4.Analog light sensor
- 5.Hard jumper wire
- 6.4 PCS jumper wire
- 7. 5 Voltage DC power supply
- 8.3 PCS of pins
- 9.3P DuPont line
- Specific source program as follows:
- int _ABVAR_1_Bright;
- void setup()
- {
- _ABVAR_1_Bright = 0;
- Serial.begin(9600);
- }
- void loop()
- {
- Serial.print( analogRead(A0) );
- Serial.println("");
- _ABVAR_1_Bright = analogRead(A0) ;
- analogWrite(3, map ( _ABVAR_1_Bright , 50 , 900 , 0 , 255 ) );
- if (( ( _ABVAR_1_Bright ) < ( 50 ) ))
- {
- analogWrite(3, 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement