This mod adds the ability to control your Minecraft world with an Arduino and vice versa.
The following blocks are added to the game:
- The Serial Sender can send redstone values to the Arduino to be applied to a certain pin
- In Digital Write mode, the selected pin is set high depending on the redstone input being higher than 0 or not. This is possible on all pins.
- In Analog Write mode, the selected pin outputs a PWM signal with its duty cycle set according to the redstone input. This is limited to pins with PWM functionality.
- The Serial Receiver asks the Arduino for changes on the pin it is attached to and converts them to redstone power
- In Digital Read mode, the block will output redstone level 15 or 0 depending on the attached pin's state. This is possible on all pins.
- In Digital Read with Pullup mode, the same principle applies as with Digital Read mode with the only difference being that the internal pullup resistor of the attached Arduino pin is enabled. This is possible on all pins.
- In Analog Read mode, the block outputs a redstone signal according to the voltage applied to attached analog pin. This is limited to analog pins.
- In Interrupt mode, an interrupt is attached to the selected pin and the block gets an update every time the Interrupt Service Routine on the Arduino is called. This is limited to pins with Interrupt functionality.
For this mod to work, you need to flash the C code from the Arduino Sketch file provided in the GitHub repository onto your Arduino and have it connected via USB when you start the game. If the Arduino is not connected when the game starts, the blocks won't do anything. Disconnecting the Arduino while the game is running will crash the game! The COM port the mod tries to use can be changed in the config file, be sure to check the port your Arduino is using. The default configuration is COM3 for Windows. You can find the port your Arduino is connected to in the Arduino IDE or in the Windows Device Manager.
The Arduino Sketch as well as the config file are adapted to the Arduino UNO. If you want to use another Arduino board, you need to adjust both of those according to their documentation.
Disclaimer: If you use this mod, you are expected to have some experience with the Arduino platform