Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include "DigiKeyboard.h"
  2. // This sketch is used to do the initial setup on
  3. // a freshly installed Raspberry Pi: Upload it to a
  4. // Digispark board, and connect it to your Arduino.
  5. // It will log in using 'pi'/'raspberry' and execute
  6. // 'sudo systemctl enable ssh' and '...start ssh'
  7.  
  8. const int def_delay = 125;
  9.  
  10. void setup() {
  11. DigiKeyboard.delay(def_delay);
  12. DigiKeyboard.sendKeyStroke(KEY_ENTER);
  13. DigiKeyboard.delay(def_delay);
  14. type("pi");
  15. type("raspberry");
  16.  
  17. DigiKeyboard.delay(10*def_delay);
  18. type("sudo systemctl enable ssh");
  19. type("sudo systemctl start ssh");
  20.  
  21. DigiKeyboard.delay(5*def_delay);
  22. // Emit a 'beep' so we know we can remove the key
  23. // Connect headphones to hear it :)
  24. type("speaker-test -t sine -c 2 -s 2 -f 440");
  25. type("logout");
  26. }
  27.  
  28. void loop() {
  29.  
  30. }
  31.  
  32. void type(char* text) {
  33. DigiKeyboard.println(text);
  34. DigiKeyboard.sendKeyStroke(KEY_ENTER);
  35. DigiKeyboard.delay(def_delay);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement