Browse Source

Dateien hochladen nach „arduino“

master
Tobias Baumann 2 years ago
parent
commit
0d71760614
1 changed files with 21 additions and 34 deletions
  1. 21
    34
      arduino/TactiloControllerPanda.ino

+ 21
- 34
arduino/TactiloControllerPanda.ino View File

#define TAC10 0 #define TAC10 0




#define LED 13



void setup() void setup()
{ {
pinMode(TAC8, OUTPUT); pinMode(TAC8, OUTPUT);
pinMode(TAC9, OUTPUT); pinMode(TAC9, OUTPUT);
pinMode(TAC10, OUTPUT); pinMode(TAC10, OUTPUT);

pinMode(LED, OUTPUT);
} }


void set_AllLow() void set_AllLow()
digitalWrite(TAC8, LOW); digitalWrite(TAC8, LOW);
digitalWrite(TAC9, LOW); digitalWrite(TAC9, LOW);
digitalWrite(TAC10, LOW); digitalWrite(TAC10, LOW);

digitalWrite(LED, LOW);
} }


void processSerialData(char SerialData) void processSerialData(char SerialData)
{ {
case '0': case '0':
digitalWrite(TAC1, !digitalRead(TAC1)); digitalWrite(TAC1, !digitalRead(TAC1));
Serial.print("Tactilo 1: ");
Serial.println(digitalRead(TAC1));
//Serial.print("Tactilo 1: ");
//Serial.println(digitalRead(TAC1));
break; break;
case '1': case '1':
digitalWrite(TAC2, !digitalRead(TAC2)); digitalWrite(TAC2, !digitalRead(TAC2));
Serial.print("Tactilo 2: ");
Serial.println(digitalRead(TAC2));
//Serial.print("Tactilo 2: ");
//Serial.println(digitalRead(TAC2));
break; break;
case '2': case '2':
digitalWrite(TAC3, !digitalRead(TAC3)); digitalWrite(TAC3, !digitalRead(TAC3));
Serial.print("Tactilo 3: ");
Serial.println(digitalRead(TAC3));
//Serial.print("Tactilo 3: ");
//Serial.println(digitalRead(TAC3));
break; break;
case '3': case '3':
digitalWrite(TAC4, !digitalRead(TAC4)); digitalWrite(TAC4, !digitalRead(TAC4));
Serial.print("Tactilo 4: ");
Serial.println(digitalRead(TAC4));
//Serial.print("Tactilo 4: ");
//Serial.println(digitalRead(TAC4));
break; break;
case '4': case '4':
digitalWrite(TAC5, !digitalRead(TAC5)); digitalWrite(TAC5, !digitalRead(TAC5));
Serial.print("Tactilo 5: ");
Serial.println(digitalRead(TAC5));
//Serial.print("Tactilo 5: ");
//Serial.println(digitalRead(TAC5));
break; break;
case '5': case '5':
digitalWrite(TAC6, !digitalRead(TAC6)); digitalWrite(TAC6, !digitalRead(TAC6));
Serial.print("Tactilo 6: ");
Serial.println(digitalRead(TAC6));
//Serial.print("Tactilo 6: ");
//Serial.println(digitalRead(TAC6));
break; break;
case '6': case '6':
digitalWrite(TAC7, !digitalRead(TAC7)); digitalWrite(TAC7, !digitalRead(TAC7));
Serial.print("Tactilo 7: ");
Serial.println(digitalRead(TAC7));
//Serial.print("Tactilo 7: ");
//Serial.println(digitalRead(TAC7));
break; break;
case '7': case '7':
digitalWrite(TAC8, !digitalRead(TAC8)); digitalWrite(TAC8, !digitalRead(TAC8));
Serial.print("Tactilo 8: ");
Serial.println(digitalRead(TAC8));
//Serial.print("Tactilo 8: ");
//Serial.println(digitalRead(TAC8));
break; break;
case '8': case '8':
digitalWrite(TAC9, !digitalRead(TAC9)); digitalWrite(TAC9, !digitalRead(TAC9));
Serial.print("Tactilo 9: ");
Serial.println(digitalRead(TAC9));
//Serial.print("Tactilo 9: ");
//Serial.println(digitalRead(TAC9));
break; break;
case '9': case '9':
digitalWrite(TAC10, !digitalRead(TAC10)); digitalWrite(TAC10, !digitalRead(TAC10));
Serial.print("Tactilo 10: ");
Serial.println(digitalRead(TAC10));
//Serial.print("Tactilo 10: ");
//Serial.println(digitalRead(TAC10));
break; break;
case 'b': case 'b':
if(digitalRead(LED) == LOW)
{
digitalWrite(LED, HIGH);
Serial.println("...Begin Tactile Session"); Serial.println("...Begin Tactile Session");
}
break; break;
case 'e': case 'e':
if(digitalRead(LED) == HIGH)
{
set_AllLow(); set_AllLow();
Serial.println("...End Tactile Session"); Serial.println("...End Tactile Session");
}
break; break;
default: default:
break; break;
} }
}
}

Loading…
Cancel
Save