Is possible to use this


#1

using this user interface


#2

Interesting… Where did you find that interface? You must be pointed to a very old version of Photonic3D that we still package with Photonic3D. I would be very surprised if that interface still worked. Is there a reason you want to use that interface?


#3

hello,
i’m trying to create a lite version of photonic3d that drive lcd and stepper motor with the minimal java code and GUI.
remove all unused files that needed for other printer.

help appreciated


#4

So, this isn’t well tested, but I’ve added another printer driver called “Generic Javascript”. This allows you to execute javascript on the pi whenever a template is required. In your case you’ll want to quick code up something like this:

I’ve added the Javascript for the template header to get you started. Just install the printer called: Direct stepper control

When you are ready to test, just hit the test button next to any template and it will execute the javascript without even having to save the printer to test.

Here’s the code I put in the header:

//https://github.com/Pi4J/pi4j/blob/master/pi4j-example/src/main/java/StepperMotorGpioExample.java
var gpioFactoryClass = Java.type("com.pi4j.io.gpio.GpioFactory");
var gpio = gpioFactoryClass.instance();

var pins = [gpio.provisionDigitalOutputPin(RaspiPin.GPIO_00, PinState.LOW),
	gpio.provisionDigitalOutputPin(RaspiPin.GPIO_01, PinState.LOW),
	gpio.provisionDigitalOutputPin(RaspiPin.GPIO_02, PinState.LOW),
	gpio.provisionDigitalOutputPin(RaspiPin.GPIO_03, PinState.LOW)];

var single_step_sequence = Java.to([parseInt('0001', 2),
	parseInt('0010', 2),
	parseInt('0100', 2),
	parseInt('1000', 2)], "byte[]");

var motor = new com.pi4j.component.motor.impl.GpioStepperMotorComponent(pins);
motor.setStepInterval(2);
motor.setStepSequence(single_step_sequence);
motor.setStepsPerRevolution(2038);
motor.step(2038);
"success"

Connect Photonic3D to lasershark