main.cpp

mail@pastecode.io avatar
unknown
c_cpp
a month ago
837 B
2
Indexable
Never
#include <Arduino.h>

#define IRMP_PROTOCOL_NAMES       1
#define IRMP_SUPPORT_NEC_PROTOCOL 1
#define IRMP_INPUT_PIN            2
#define DEBUG

#include <irmp.hpp>

IRMP_DATA irmp_data;

#define BUTTON_LENGTH 8 // @todo not working for no reason broken

#include <Macro.h>
#include <Scripts.h>

byte buttonStates = 0;

void setup() {
  #ifdef DEBUG
    Serial.begin(115200);
    while (!Serial) {;}
    Serial.println("Starting...");
  #endif

  irmp_init();

  registerRepeatedMacro(moveMouseRandomly, 0, RandomMouseMoveData());
  registerRepeatedMacro(moveMouseRandomly, 4, RandomMouseMoveData());
  //registerNormalMacro(remoteDesktop, 4);

  setupScripts();
}

void loop() {
    if (irmp_get_data(&irmp_data)) {
      buttonStates = irmp_data.command;
    }

    updateMacros(buttonStates);
}
Leave a Comment