CPP 94
RAHIMI 8 Guest on 14th October 2023 08:50:52 AM
  1. #define motor_pin 3
  2. #define pot_pin A0
  3.  
  4. void setup() {
  5.   pinMode(motor_pin, OUTPUT);
  6. }
  7.  
  8. void loop() {
  9.   int a = analogRead(pot_pin);
  10.   int b = (a * 255) / 1023;
  11.   analogWrite(motor_pin, b);
  12. }

Hightechrobo bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.