Entradas/salidas digitales

Hola, tengo un problema con las entradas/salidas digitales, nose porque no se activan estoy tratando con este codigo si alguien puede ayudarme gracias.

#include <Indio.h>
#include <Wire.h>

char dato;

void setup() {
  // put your setup code here, to run once:


Serial.begin(9600); 


Indio.digitalMode(2,OUTPUT);
Indio.digitalMode(3,OUTPUT);

 

}

void loop() {
  // put your main code here, to run repeatedly:


if(Serial.available()>0)   // pregunta si existe un valor diferente de cero
{

 dato=Serial.read();  //lee el dato
 if(dato=='a')
 {

 Indio.digitalWrite(2,HIGH);
  Indio.digitalWrite(3,HIGH);
 Serial.print("activado");
 
 }
 
 if(dato=='b')
 {


 Indio.digitalWrite(2,LOW);
 Indio.digitalWrite(3,LOW);
 Serial.print("OFF");
 }

}
delay(10);
}

Alex Mallitasig
Alex Mallitasig
7
| 0 0 0
Asked on 11/9/16, 2:39 PM
0
vote
409 Views

Estoy enviando los datos desde el monitor serie del IDE de arduino.

Alex Mallitasig
on 11/9/16, 3:17 PM

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

30 follower(s)

Stats

Asked: 11/9/16, 2:39 PM
Seen: 409 times
Last updated: 11/23/16, 3:45 AM