CPP 221
S8 Abdi Guest on 14th October 2023 08:58:48 AM
  1. #define res A0
  2. #define motor 9
  3. void setup(){
  4.   pinMode(motor,OUTPUT);
  5. }
  6.  
  7. void loop(){
  8.   int i = analogRead(res);
  9.   i = (i*255)/1023;
  10.   analogWrite(motor,i);
  11. }

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.