Added password examples and some comments about the features.
This commit is contained in:
parent
a047580155
commit
96d4a99aec
1 changed files with 19 additions and 14 deletions
|
|
@ -16,11 +16,14 @@ unsigned int count;
|
||||||
Blinker blinker(LED_PIN);
|
Blinker blinker(LED_PIN);
|
||||||
|
|
||||||
// the list of available passwords
|
// the list of available passwords
|
||||||
|
// the number and overall lenght of passwords depends because the memory of the digispark is very limited...
|
||||||
|
// i recommend to use a prefix you easily can remember for the password/passwords to make the passwords
|
||||||
|
// on the passkey unusable for others if you have lost your passkey. E.g.: WhatAWonderfulWorld -> then press the button.
|
||||||
const char *passwords[] = {
|
const char *passwords[] = {
|
||||||
"PASSWORD1",
|
"n0Emb871NAQPSIqBoldh8R7UDaNhncF7Pt60Amdo6GWdTdAPwVBi2A3KU8x8DTCRo6GWdTdXNn2wLh3SUbxVWQvFDVPtatDg", // passwords[0]
|
||||||
"PASSWORD2",
|
"oaxt6e3lSgflOuJ3C6Q6sUb5gvmvI5IEPFku5fqcbxJljBOUblHIT121wCu", // passwords[1]
|
||||||
"PASSWORD3",
|
"jUgKGBtiJ0iNN1Ok9vejrXNn2wLh3SUbxVWQvFDVPtat0OxJlKU8x8DTCRo6GWdTdAPwVBi2A3KUrTKQwjUgK", // passwords[2]
|
||||||
"PASSWORD4"
|
"G57dFnXsPUnRq1eC1CjrGxpCjuiJFlDti54W6wBS9Ro6GWdTdAPwVBi2A3KU8x8KGBtiJ0iNN1Ok9vejrXNn2wLhH" // etc...
|
||||||
};
|
};
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|
@ -28,12 +31,6 @@ void setup() {
|
||||||
pinMode(BUTTON_PIN, INPUT);
|
pinMode(BUTTON_PIN, INPUT);
|
||||||
digitalWrite(BUTTON_PIN, HIGH);
|
digitalWrite(BUTTON_PIN, HIGH);
|
||||||
|
|
||||||
// light up the LED for a second to show that passkey is ready
|
|
||||||
pinMode(LED_PIN, OUTPUT);
|
|
||||||
digitalWrite(LED_PIN, HIGH);
|
|
||||||
delay(1000);
|
|
||||||
digitalWrite(LED_PIN, LOW);
|
|
||||||
|
|
||||||
// set blink effect (ON, OFF) in milliseconds
|
// set blink effect (ON, OFF) in milliseconds
|
||||||
blinker.setDelay(25, 10000);
|
blinker.setDelay(25, 10000);
|
||||||
blinker.start();
|
blinker.start();
|
||||||
|
|
@ -41,6 +38,12 @@ void setup() {
|
||||||
// initialize HID
|
// initialize HID
|
||||||
DigiKeyboard.delay(0);
|
DigiKeyboard.delay(0);
|
||||||
DigiKeyboard.sendKeyStroke(0);
|
DigiKeyboard.sendKeyStroke(0);
|
||||||
|
|
||||||
|
// light up the LED for a second to show that passkey is ready
|
||||||
|
pinMode(LED_PIN, OUTPUT);
|
||||||
|
digitalWrite(LED_PIN, HIGH);
|
||||||
|
delay(1000);
|
||||||
|
digitalWrite(LED_PIN, LOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
@ -72,7 +75,9 @@ void loop() {
|
||||||
DigiKeyboard.println(passwords[2]);
|
DigiKeyboard.println(passwords[2]);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
DigiKeyboard.println(passwords[3]);
|
// you can use print instead of println if you don't want to
|
||||||
|
// hit enter automatically after inserting the password
|
||||||
|
DigiKeyboard.print(passwords[3]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue