const int sensorPin = 9;
 
void setup() {
  Serial.begin(9600);   //iniciar puerto serie
  pinMode(sensorPin , INPUT);  //definir pin como entrada
}
 
void loop(){
  int value = 0;
  value = digitalRead(sensorPin );  //lectura digital de pin
 
  if (value == HIGH) {
      Serial.println("Detectado obstaculo");
  }
  delay(1000);
}

 

 

News Flash

Responsive Joomla template JA Purity III marks the next milestone of us in crafting the best Joomla templates for our techie users. Following up with Purity series, JA Purity III heritages the outstanding advantages of its pioneers: brilliant adaptation for multi-purpos

Leer más...