hello to all,
on Greenfoot.org i saw two informations: Docu how to use native libraries and Sense Board Demo.
I want to control a similar multi-I/O-board called K8055D from Veleman, Belgium
The difference: the board comes with a dll-file to control it via USB but without BYTE-Information
I started to follow the advices to use dll´s. Attached I show the situation of work, but you see: There are compiler comments, but I don´t know how to avoid them.
Asking for help Yogibaer
Start of KD8055
compiler says:
cannot find symbol – variable K8055D or package K8055D does not exist
Following the advice of the documentation I
„placed native binaries (.dll, .so and .jnilib) files in the root folder of the scenario“.
Start of PanelWorld
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Controlboard for a multi-I/O-Interface-Board, similar to SenseBoard
* @author Yogibaer
*/
public class PanelWorld extends World
{
static
{final NativeLoader loader = new NativeLoader();
loader.loadClass("KD8055");}
// alternative loader.loadClass(„K8055D.dll“) gives no problems from the compiler
private KD8055 board;
public PanelWorld()
{
super(600, 400, 1);
}
public void act()
{ test1();
}
public void test1()
{ board.oeffnen();
board.setzLampe1();
Greenfoot.delay(10);
board.setzLampe2();
board.setzLampe3();
board.schliessen();
}
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* KD8055 is the bridge-class to the K8055D.dll.
* * @author Yogibaer
*/
public class KD8055
{
public void act()
{
// Add your action code here.
}
public void oeffnen()
{K8055D.openDevice(0);} or {K8055D.dll.openDevice(0);)
public void setzLampe1()
{K8055D.SetDigitalChannel(1);}
public void setzLampe2()
{K8055D.SetDigitalChannel(2);}
public void setzLampe3()
{K8055D.SetDigitalChannel(3);}

