#define pot A2 #define mot 7 void setup() { pinMode(mot,OUTPUT); } void loop() { int i = analogRead(pot); i = (i*255)/1023; analogeWrite(mot,i); }