Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Arduino.h>
- #include <HardwareSerial.h>
- #define systemRequest 84
- #define modCode 96
- #define altModCode 97
- #define CLOCK_PIN 10
- #define DATA_PIN 23
- #define SWITCH_PIN 22
- #define CLOCK digitalRead(CLOCK_PIN)
- #define DATA digitalRead(DATA_PIN)
- void setup()
- {
- Serial.begin(19200);
- Serial.println("Connected");
- pinMode(CLOCK_PIN, INPUT);
- pinMode(DATA_PIN, INPUT);
- pinMode(SWITCH_PIN, OUTPUT);
- digitalWrite(SWITCH_PIN, LOW);
- Keyboard.set_modifier(0);
- Keyboard.set_key1(0);
- Keyboard.set_key2(0);
- Keyboard.set_key3(0);
- Keyboard.set_key4(0);
- Keyboard.set_key5(0);
- Keyboard.set_key6(0);
- Keyboard.send_now();
- while (CLOCK == LOW)
- ;
- }
- void loop()
- {
- while (CLOCK == LOW)
- ;
- int data = DATA;
- while (CLOCK == HIGH)
- {
- if (DATA != data)
- {
- Serial.println("YOUR KEYBOARD IS BEING NAUGHTY");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment