hi everyone,
i wrote a code in which i poll the status of some sensors and if data are received on the Serial Arduino enables some little motors.
this is the pseudo-code:
void setup(){
Serial.begin(baudRate);
initialize_Motor_pins();
calibrateSensors();
}
void loop(){
readSensorStatus(); //there are 26 capacitive sensors;
if(Serial.available()){
char letter = serial.read()
switch(letter){
case 'a' : activateMotors(1);
case 'b' : activateMotors(2);
.
.
.
//each letter received activates a different motor
.
.
.
}
}
is there any way i can manage the Serial.available event as an interrupt?
i hope i was clear. thank for the help