Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int lumina;
- int effet;
- void setup() {
- // put your setup code here, to run once:
- pinMode(11,OUTPUT);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- lumina = analogRead(0);
- if (lumina>512){
- effet=map(lumina,512,1023,0,255);
- analogWrite(11,effet);
- }
- else{
- analogWrite(11,0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement