Javelin syntax question
In the program below, final static int LEDpin = CPU.pin0 works, but not
····························· final static int LEDpin = CPU.pins[noparse][[/noparse]0].· Why not?
Also, why do we need to say "int" in above statement as I tried "char", and "short" with success (but "long" does not work.)· Can anyone explain why this is so?
BTW, this is my attempt to duplicate ex1 from StampWorks into Javelin.·
·import stamp.core.*;
···· public class ex1 {
······ //final static int LEDpin = CPU.pin0;····· //works
······ final static int LEDpin = CPU.pins[noparse][[/noparse]0];·· // Error IDE-0042 Unknown unhandled exception in JVM [noparse][[/noparse]527]
······ public static void main() {
········ int mydelay=10000;
········ while (true) {
·········· CPU.writePin (LEDpin, true);
·········· CPU.delay (mydelay);
·········· CPU.writePin (LEDpin, false);
·········· CPU.delay (mydelay);
········ }
······ }
··· }
····························· final static int LEDpin = CPU.pins[noparse][[/noparse]0].· Why not?
Also, why do we need to say "int" in above statement as I tried "char", and "short" with success (but "long" does not work.)· Can anyone explain why this is so?
BTW, this is my attempt to duplicate ex1 from StampWorks into Javelin.·
·import stamp.core.*;
···· public class ex1 {
······ //final static int LEDpin = CPU.pin0;····· //works
······ final static int LEDpin = CPU.pins[noparse][[/noparse]0];·· // Error IDE-0042 Unknown unhandled exception in JVM [noparse][[/noparse]527]
······ public static void main() {
········ int mydelay=10000;
········ while (true) {
·········· CPU.writePin (LEDpin, true);
·········· CPU.delay (mydelay);
·········· CPU.writePin (LEDpin, false);
·········· CPU.delay (mydelay);
········ }
······ }
··· }