Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.21 KB | None | 0 0
  1. const int outputPin = 5;
  2.  
  3. void setup() {
  4.   pinMode(outputPin, OUTPUT);
  5. }
  6.  
  7. void loop() {
  8.   int input = analogRead(A0);
  9.   int output = map(input, 0, 1023, 0,255);
  10.   analogWrite(outputPin, output);
  11.   delay(2);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement