/** Utilisation des pads capacitifs d'un circuit playground express pour un circuit brodé les infos des pads sont transmis en série à pure data quand la valeur du pad dépasse un certain seuil Quimper @ Flux, 2 avril 2026, Résidence textile Debian 12 @ Tenko / Arduino 2.3.6 / pierre@lesporteslogiques.net + adafruit circuit playground library 1.12.0 : https://github.com/adafruit/Adafruit_CircuitPlayground */ #include int c1, c2, c3, c4, c5, c6; void setup() { CircuitPlayground.begin(); Serial.begin(115200); c1 = 0; c2 = 0; c3 = 0; c4 = 0; c5 = 0; c6 = 0; } void loop() { int rc1 = CircuitPlayground.readCap(A4); delay(5); int rc2 = CircuitPlayground.readCap(A5); delay(5); int rc3 = CircuitPlayground.readCap(A7); delay(5); int rc4 = CircuitPlayground.readCap(A1); delay(5); int rc5 = CircuitPlayground.readCap(A2); delay(5); int rc6 = CircuitPlayground.readCap(A3); delay(5); //int val = CircuitPlayground.readCap(A4); // pad A1 if ( rc1 > 1000) c1 = 1; if ( rc1 < 400) c1 = 0; if ( rc2 > 1000) c2 = 1; if ( rc2 < 400) c2 = 0; if ( rc3 > 1000) c3 = 1; if ( rc3 < 400) c3 = 0; if ( rc4 > 1000) c4 = 1; if ( rc4 < 400) c4 = 0; if ( rc5 > 1000) c5 = 1; if ( rc5 < 400) c5 = 0; if ( rc6 > 1000) c6 = 1; if ( rc6 < 500) c6 = 0; /* if (CircuitPlayground.readCap(A5) > 1000) c2 = 1; if (CircuitPlayground.readCap(A7) > 1000) c3 = 1; if (CircuitPlayground.readCap(A1) > 1000) c4 = 1; if (CircuitPlayground.readCap(A2) > 1000) c5 = 1; if (CircuitPlayground.readCap(A3) > 1000) c6 = 1; if (CircuitPlayground.readCap(A4) > 1000) c1 = 1; if (CircuitPlayground.readCap(A5) > 1000) c2 = 1; if (CircuitPlayground.readCap(A7) > 1000) c3 = 1; if (CircuitPlayground.readCap(A1) > 1000) c4 = 1; if (CircuitPlayground.readCap(A2) > 1000) c5 = 1; if (CircuitPlayground.readCap(A3) > 1000) c6 = 1; */ int pot = analogRead(A6); /* Serial.println(CircuitPlayground.readCap(A3)); delay(100); */ /* Serial.print(c1 * 4000); Serial.print(","); Serial.print(c2 * 3500); Serial.print(","); Serial.print(c3 * 3000); Serial.print(","); Serial.print(c4 * 2500); Serial.print(","); Serial.print(c5 * 2000); Serial.print(","); Serial.print(c6 * 1500); Serial.print(","); Serial.println(pot); delay(100); */ /* Serial.print(rc1); Serial.print(","); Serial.print(rc2); Serial.print(","); Serial.print(rc3); Serial.print(","); Serial.print(rc4); Serial.print(","); Serial.print(rc5); Serial.print(","); Serial.print(rc6); Serial.print(","); Serial.println(pot); */ Serial.print("bob "); Serial.print(c1); Serial.print(" "); Serial.print(c2); Serial.print(" "); Serial.print(c3); Serial.print(" "); Serial.print(c4); Serial.print(" "); Serial.print(c5); Serial.print(" "); Serial.print(c6); Serial.print(" "); Serial.println(pot); delay(10); }