-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChromebook-Enrol.ino
105 lines (75 loc) · 1.96 KB
/
Chromebook-Enrol.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//updated for July 2022
#include <DigiKeyboard.h>
#define KEY_TAB 43
#define KEY_DOWN_ARROW 0x51
String ssid = "SSIDHERE";
String ssid_password = "PASSPHRASEHERE";
String email = "USERNAME\"DOMAIN"; //the /" inserts the @ symbol in the UK
String email_password = "PASSWORD";
int keyWait = 275;
void setup() {
//Welcome Screen
DigiKeyboard.sendKeyStroke(0);
wait(1);
pressKey(KEY_TAB, 2);
pressKey(KEY_ENTER, 1);
wait(1);
//Wireless Setup Screen
pressKey(KEY_TAB, 3);
pressKey(KEY_SPACE, 2);
//pressKey(KEY_TAB, 4);
//pressKey(KEY_ENTER, 1);
pressKey(KEY_TAB, 3);
pressKey(KEY_ENTER, 1);
wait(2);
DigiKeyboard.print(ssid);
pressKey(KEY_TAB, 1);
pressKey(KEY_ENTER, 1);
pressKey(KEY_DOWN_ARROW, 2);
pressKey(KEY_ENTER, 1);
pressKey(KEY_TAB, 1);
DigiKeyboard.print(ssid_password);
pressKey(KEY_ENTER, 1);
wait(10); //Wait to connect to wireless
pressKey(KEY_TAB, 3);
pressKey(KEY_ENTER, 1);
wait(3);
pressKey(KEY_ENTER, 1);
wait(4);//Wait for OS Terms to load
//Google Chrome OS Terms
DigiKeyboard.sendKeyStroke(KEY_TAB,MOD_SHIFT_LEFT);
DigiKeyboard.sendKeyStroke(KEY_TAB,MOD_SHIFT_LEFT);
DigiKeyboard.sendKeyStroke(KEY_TAB,MOD_SHIFT_LEFT);
pressKey(KEY_SPACE, 1); //Turn off feedback
pressKey(KEY_TAB, 3);
pressKey(KEY_ENTER, 1);
wait(45);//Updates
//Enterprise Enrollment
pressKey(KEY_TAB, 3);
pressKey(KEY_SPACE, 1);
pressKey(KEY_DOWN_ARROW, 1);
pressKey(KEY_ENTER, 1);
wait(5);
// pressKey(KEY_TAB, 6);
DigiKeyboard.print(email);
pressKey(KEY_ENTER, 1);
wait(4);
DigiKeyboard.print(email_password);
pressKey(KEY_ENTER, 1);
digitalWrite(0, HIGH);
digitalWrite(1, HIGH);
}
void loop() {
}
uint8_t pressKey(uint8_t key, int times) {
for (int i = 1; i <= times; i++) {
DigiKeyboard.delay(50);
DigiKeyboard.sendKeyStroke(key);
DigiKeyboard.delay(keyWait);
}
}
int wait(int seconds) {
for (int i = 0; i < seconds; i++) {
DigiKeyboard.delay(1000);
}
}