Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
496 B
1
Indexable
Never
#define BasisPin 5
#define ReadPin A3

void setup() {
  pinMode(BasisPin, OUTPUT);
  pinMode(ReadPin, INPUT);
  Serial.begin(9600);
}

void printlog(int setted)
{
  Serial.print(setted);
  Serial.print("/");
  Serial.println(analogRead(ReadPin));
}

void loop() {
  for (int i=0;i<=250;i+=10)
  {
    analogWrite(BasisPin, i);
    delay(500);
    printlog(i);
  }
  for (int i=250;i>=0;i-=10)
  {
    analogWrite(BasisPin, i);
    delay(500);
    printlog(i);
  }
}