Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. int lumina;
  2. int effet;
  3.  
  4. void setup() {
  5. // put your setup code here, to run once:
  6. pinMode(11,OUTPUT);
  7.  
  8.  
  9. }
  10.  
  11. void loop() {
  12. // put your main code here, to run repeatedly:
  13. lumina = analogRead(0);
  14. if (lumina>512){
  15. effet=map(lumina,512,1023,0,255);
  16. analogWrite(11,effet);
  17. }
  18. else{
  19. analogWrite(11,0);
  20. }
  21.  
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement