analog motor speed test — ESP32 simulation

An interactive ESP32 circuit simulation you can run free in your browser on Velxio, by josephkinuthia541.

Components

Sketch code

const int MOTOR_PIN =5;
const int SIG1 = 14;
const int SIG2 = 27;

void setup() {
  Serial.begin(115200);
  pinMode(MOTOR_PIN, OUTPUT);
  pinMode(SIG1, INPUT);
  pinMode(SIG2, INPUT);
  digitalWrite(MOTOR_PIN, HIGH);
  Serial.print("Motor ON");
}

void loop() {

  int signal1 = digitalRead(SIG1);
  int signal2 = digitalRead(SIG2);

  Serial.print("SIG1 = ");
  Serial.print(signal1);

  Serial.print("    SIG2 = ");
  Serial.println(signal2);

  delay(100);
}

More projects by josephkinuthia541