int pwmPin1 = 0; int pwmPin2 = 1; int pot = A1; // assigns analog input A1 to variable pot int c1 = 0; // declares variable c1 int c2 = 0; // declares variable c2 //int min=108; //int max=139; void setup() // setup loop { pinMode(pwmPin1, OUTPUT); pinMode(pwmPin2, OUTPUT); pinMode(pot, INPUT); } void loop() { // c2= map(analogRead(pot), min, max, 0,1000); c2=analogRead(pot); c1= 1000-c2; // subtracts c2 from 1000 ans saves the result in c1 digitalWrite(pwmPin1, HIGH); digitalWrite(pwmPin2, HIGH); delayMicroseconds(c1); digitalWrite(pwmPin1, LOW); digitalWrite(pwmPin2, LOW); delayMicroseconds(c2); }