Sunday, April 10, 2016

Carduino Remote Test Code (copy and paste this into a new arduino IDE sketch)

int pin1 = 22; //REPLACE 22 WITH YOUR PIN
int pin2 = 30; //REPLACE 30 WITH YOUR PIN



void setup() {
 Serial.begin(9600);
 pinMode(pin1, INPUT);
 pinMode(pin2, INPUT);

}

void loop() {
 int speedValue = pulseIn(pin1, HIGH);
  int directionValue = pulseIn(pin2, HIGH);
 
  //Serial.println(speedValue);
  Serial.println(directionValue);

  delay(50);

}

No comments:

Post a Comment