Currently I am trying to copy "GeorgeNotFound" 's MinecraftShocker plugin from his Video (https://youtu.be/rCyJ-TFFxWA) but i am getting this error which means no Arduino is found right?
I already checked the Arduino Uno is connected to "COM3" and I already have the Firmata installed on the Arduino.
I'm using Maven to add libraries.
I changed the jar i was using from slf4j-log4j12.jar to slf4j-jdk14.jar and now i get a different error.
Added text to indicate where it keeps failing.
Made all earlier Edits Italic for better readability.
I am not using the slf4j-jdk14.jar
anymore,
Instead I removed the dependencies of org.scream3r:jssc:2.8.0
in com.github.kurbatov:firmata4j:2.3.8
and istalled io.github.java-native:jssc:2.9.2
separately (so it now doesn't use the 2.8.0 as default anymore, but instead is using the fixed 2.9.2 version ;) )
And voilà it's working
ERROR:
Connecting...
Connected
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=9764, tid=1144
#
# JRE version: OpenJDK Runtime Environment (15.0+36) (build 15+36-1562)
# Java VM: OpenJDK 64-Bit Server VM (15+36-1562, mixed mode, sharing, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C [jSSC-2.8_x86_64.dll+0xb5db]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Lucky 56\IdeaProjects\Shocker\hs_err_pid9764.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Process finished with exit code 1
CODE:
package me.lucky56.shocker;
import org.firmata4j.IODevice;
import org.firmata4j.Pin;
import org.firmata4j.firmata.FirmataDevice;
import java.io.IOException;
public class Main
{
public static void main(String[] args) throws IOException, InterruptedException {
System.out.println("Connecting...");
IODevice device = new FirmataDevice("COM3");
System.out.println("Connected");
device.start();
device.ensureInitializationIsDone();
System.out.println("Connected Successfully");
for (int i = 0; i < 5; i++)
{
turnOn(device);
System.out.println("On");
Thread.sleep(250);
System.out.println("Off");
turnOff(device);
Thread.sleep(1000);
}
device.stop();
}
static void turnOn(IODevice device)
{
try
{
device.getPin(7).setMode(Pin.Mode.OUTPUT);
device.getPin(7).setValue(350);
device.getPin(13).setMode(Pin.Mode.INPUT);
} catch (IOException e)
{
e.printStackTrace();
}
}
static void turnOff(IODevice device)
{
try
{
device.getPin(7).setMode(Pin.Mode.INPUT);
} catch (IOException e)
{
e.printStackTrace();
}
}
}
I am not using the slf4j-jdk14.jar
anymore,
Instead I removed the dependencies of org.scream3r:jssc:2.8.0
in com.github.kurbatov:firmata4j:2.3.8
and istalled io.github.java-native:jssc:2.9.2
separately (so it now doesn't use the 2.8.0 as default anymore, but instead is using the fixed 2.9.2 version ;) )
And voilà it's working