Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int outMotor = 9;
- int readInput = A0;
- int output;
- int motorMapp;
- void setup()
- {
- pinMode(outMotor, OUTPUT);
- Serial.begin(9600);
- }
- void loop()
- {
- output = analogRead(readInput);
- //Mapping
- motorMapp = map(output, 0, 1023, 0, 255);
- analogWrite(outMotor, motorMapp);
- delay(1);
- Serial.println(motorMapp);
- Serial.print(" ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement