Advertisement
Guest User

Untitled

a guest
Feb 14th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1.  
  2. int pent = A0;
  3. int val = 0;
  4. int led = 10;
  5.  
  6.  
  7. void setup() {
  8. // put your setup code here, to run once:
  9. pinMode(pent, INPUT);
  10. Serial.begin(9600);
  11. }
  12.  
  13. void loop() {
  14. // put your main code here, to run repeatedly:
  15. val = analogRead(pent);
  16. Serial.println(val);
  17. analogWrite(led, val/4);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement