Advertisement
KRITSADA

Arduino Map Function to Control Motor

Aug 10th, 2016
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.20 KB | None | 0 0
  1. void setup() {
  2.   // put your setup code here, to run once:
  3.  
  4. }
  5.  
  6. void loop() {
  7.   analogWrite(3,map(analogRead(A5),0,1023-analogRead(A4),255,0));
  8.   // put your main code here, to run repeatedly:
  9.  
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement