Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MOTOR_PIN A0
- #define PMOS_PIN 3
- void setup()
- {
- pinMode(PMOS_PIN, OUTPUT);
- pinMode(MOTOR_PIN, INPUT);
- }
- int rot = 0;
- void loop()
- {
- int temp = analogRead(MOTOR_PIN);
- rot = map(temp,20,358,255,0);
- analogWrite(PMOS_PIN, rot);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement