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);
}
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!
Keep Informed
About This Forum
This community is for professionals and enthusiasts of our products and services.
Read GuidelinesQuestion tools
Stats
Asked: 11/9/16, 2:39 PM |
Seen: 2158 times |
Last updated: 11/23/16, 3:45 AM |
Estoy enviando los datos desde el monitor serie del IDE de arduino.