LAK132

XT screamer

Oct 2nd, 2020
1,270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include <Arduino.h>
  2. #include <HardwareSerial.h>
  3.  
  4. #define systemRequest 84
  5. #define modCode       96
  6. #define altModCode    97
  7.  
  8. #define CLOCK_PIN  10
  9. #define DATA_PIN   23
  10. #define SWITCH_PIN 22
  11.  
  12. #define CLOCK digitalRead(CLOCK_PIN)
  13. #define DATA  digitalRead(DATA_PIN)
  14.  
  15. void setup()
  16. {
  17.   Serial.begin(19200);
  18.   Serial.println("Connected");
  19.   pinMode(CLOCK_PIN, INPUT);
  20.   pinMode(DATA_PIN, INPUT);
  21.   pinMode(SWITCH_PIN, OUTPUT);
  22.   digitalWrite(SWITCH_PIN, LOW);
  23.   Keyboard.set_modifier(0);
  24.   Keyboard.set_key1(0);
  25.   Keyboard.set_key2(0);
  26.   Keyboard.set_key3(0);
  27.   Keyboard.set_key4(0);
  28.   Keyboard.set_key5(0);
  29.   Keyboard.set_key6(0);
  30.   Keyboard.send_now();
  31.   while (CLOCK == LOW)
  32.     ;
  33. }
  34.  
  35. void loop()
  36. {
  37.   while (CLOCK == LOW)
  38.     ;
  39.  
  40.   int data = DATA;
  41.  
  42.   while (CLOCK == HIGH)
  43.   {
  44.     if (DATA != data)
  45.     {
  46.       Serial.println("YOUR KEYBOARD IS BEING NAUGHTY");
  47.     }
  48.   }
  49. }
  50.  
Advertisement
Add Comment
Please, Sign In to add comment