diff --git a/TouchKey.ino b/TouchKey.ino new file mode 100644 index 0000000..5126784 --- /dev/null +++ b/TouchKey.ino @@ -0,0 +1,32 @@ +#include "DigiKeyboard.h" +#include + +#define SECRET "this is a secret\n" + +#define BuildInLED 1 // internal LED at PB1 + +CapacitiveSensor cs = CapacitiveSensor(2,0); // PB2 is output pin, PB0 is sensor pin + +void setup() +{ + pinMode(BuildInLED, OUTPUT); + digitalWrite(BuildInLED, LOW); +} + +void loop() +{ + long input = cs.capacitiveSensor(30); + + if (input > 200) { + digitalWrite(BuildInLED, HIGH); + DigiKeyboard.print(SECRET); + DigiKeyboard.delay(1000); + + while (cs.capacitiveSensor(30) > 100) { + } + + digitalWrite(BuildInLED, LOW); + } + + DigiKeyboard.delay(100); +} diff --git a/case/TouchKey-Case.f3d b/case/TouchKey-Case.f3d new file mode 100644 index 0000000..fec1763 Binary files /dev/null and b/case/TouchKey-Case.f3d differ diff --git a/case/assembled.jpg b/case/assembled.jpg new file mode 100644 index 0000000..8242c08 Binary files /dev/null and b/case/assembled.jpg differ diff --git a/case/overview.jpg b/case/overview.jpg new file mode 100644 index 0000000..e286de1 Binary files /dev/null and b/case/overview.jpg differ