Java SuperClass constants not available

27 views
Skip to first unread message

James Caska

unread,
Sep 14, 2014, 8:23:01 AM9/14/14
to boo...@googlegroups.com
I am making very nice progress and my embedded JVM platform now passes all the tests in the integration suite with a few exceptions based on known JVM limitations

Now I am getting ready to deploy Boo apps to actual devices

What I have is a Java supclass called 'Arduino' which is an implementation of the Arduino keywords and functions allowing these to be called from Boo

An example looks like this

import muvium.compatibility.arduino
class Blink(Arduino):
def setup():
pinMode( 13, HIGH)
def loop():
for vout in (HIGH,LOW):
digitalWrite( 13, vout)
delay(500)

The problem is it doesn't compile and i get the following errors

..\..\temp\Build\Blink.boo(4,22): BCE0005: Unknown identifier: 'HIGH'.
..\..\temp\Build\Blink.boo(6,22): BCE0005: Unknown identifier: 'HIGH'.
..\..\temp\Build\Blink.boo(6,27): BCE0005: Unknown identifier: 'LOW'.

If I manually insert the constants, it compiles fine

import muvium.compatibility.arduino
class Blink(Arduino):
final HIGH = 1
final LOW = 0
def setup():
pinMode( 13, HIGH)
def loop():
for vout in (HIGH,LOW):
digitalWrite( 13, vout)
delay(500)

It seems the Boo jar scanner finds the superclass methods but not the superclass constants. which are declared as follows in the superclass
public static final int HIGH = 1;
public static final int LOW = 0;
public static final int OUTPUT = 0; 
public static final int INPUT = 1;


Any suggestions on working around this, I suppose I can inject the necessary constants as a temporary workaround.

Thanks,
James



James Caska

unread,
Sep 15, 2014, 6:24:48 AM9/15/14
to boo...@googlegroups.com
So in addition to constants of a superclass, inherited methods of the superclass are also not found.

So pinMode(), digtalWrite() and delay() all report

C:\Users\James\AppData\Local\Virtual Breadboard\VBB 5.08\temp\build\Blink.boo(9,
9): BCE0005: Unknown identifier: 'pinMode'.
C:\Users\James\AppData\Local\Virtual Breadboard\VBB 5.08\temp\build\Blink.boo(12
,13): BCE0005: Unknown identifier: 'digitalWrite'.
C:\Users\James\AppData\Local\Virtual Breadboard\VBB 5.08\temp\build\Blink.boo(13
,13): BCE0005: Unknown identifier: 'delay'.

Because these are methods in the superclass of Arduino, whereas methods in Arduino itself are found and don't cause errors.

Looking for workarounds..
Reply all
Reply to author
Forward
0 new messages