├── .gitattributes └── YouTube_Subscriber_Code └── YouTube_Subscriber_Code.ino /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /YouTube_Subscriber_Code/YouTube_Subscriber_Code.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 4 | To watch out full tutorial video of this project, head on to our YouTube channel 5 | https://www.youtube.com/techiesms 6 | 7 | Code modified by team techiesms on 14th August 2021 8 | 9 | 10 | */ 11 | #define OSX 0 12 | #define WINDOWS 1 13 | 14 | 15 | 16 | #include 17 | 18 | 19 | // change this to match your platform: 20 | int platform = OSX; 21 | 22 | // Init function 23 | void setup() 24 | { 25 | // Begining the stream 26 | pinMode(2, INPUT_PULLUP); 27 | Keyboard.begin(); 28 | 29 | // Waiting 500ms for init 30 | delay(500); 31 | 32 | 33 | } 34 | 35 | // Unused 36 | void loop() { 37 | // while (digitalRead(2) == HIGH) { 38 | // // do nothing until pin 2 goes low 39 | // delay(500); 40 | // } 41 | 42 | 43 | 44 | switch (platform) { 45 | case OSX: 46 | // Press CMD + Space to open spotlight 47 | Keyboard.press(KEY_LEFT_GUI); 48 | Keyboard.press(' '); 49 | Keyboard.releaseAll(); 50 | break; 51 | case WINDOWS: 52 | // Press CMD + r to open spotlight 53 | Keyboard.press(KEY_LEFT_GUI); 54 | Keyboard.press('r'); 55 | Keyboard.releaseAll(); 56 | break; 57 | } 58 | delay(100); 59 | 60 | // Type Google Chrome 61 | Keyboard.print("Chrome"); 62 | 63 | delay(100); 64 | 65 | typeKey(KEY_RETURN); 66 | delay(1000); 67 | 68 | typeKey(KEY_RETURN); 69 | delay(3000); 70 | 71 | 72 | Keyboard.print("https://www.youtube.com/techiesms?sub_confirmation=1"); 73 | delay(500); 74 | 75 | typeKey(KEY_RETURN); 76 | 77 | delay(5000); 78 | 79 | typeKey(KEY_TAB); 80 | 81 | typeKey(KEY_TAB); 82 | 83 | typeKey(KEY_RETURN); 84 | 85 | while (true); 86 | } 87 | 88 | void typeKey(int key) 89 | { 90 | Keyboard.press(key); 91 | delay(50); 92 | Keyboard.release(key); 93 | } 94 | --------------------------------------------------------------------------------