import stamp.core.*; public class Segment7LED { static boolean P0 = true; static boolean flag = true; //public static int = 0; public static void main() { while(flag=true) { // clearLED(); for (int i=0;i<10;i++) { CPU.delay(10000); clearLED(); displayNumber(i); } // end for flag=false; } // end while } // end main public static void displayNumber(int value) { switch (value) { case 1: CPU.writePin(CPU.pins[13],true); // LED [On] CPU.writePin(CPU.pins[8],true); // LED [On] break; case 2: CPU.writePin(CPU.pins[14],true); // LED [On] CPU.writePin(CPU.pins[13],true); // LED [On] CPU.writePin(CPU.pins[2],true); // LED [On] CPU.writePin(CPU.pins[6],true); // LED [On] CPU.writePin(CPU.pins[7],true); // LED [On] break; case 3: CPU.writePin(CPU.pins[14],true); // LED [On] CPU.writePin(CPU.pins[13],true); // LED [On] CPU.writePin(CPU.pins[2],true); // LED [On] CPU.writePin(CPU.pins[8],true); // LED [On] CPU.writePin(CPU.pins[7],true); // LED [On] break; case 4: CPU.writePin(CPU.pins[1],true); // LED [On] CPU.writePin(CPU.pins[2],true); // LED [On] CPU.writePin(CPU.pins[13],true); // LED [On] CPU.writePin(CPU.pins[8],true); // LED [On] break; case 5: CPU.writePin(CPU.pins[14],true); // LED [On] CPU.writePin(CPU.pins[1],true); // LED [On] CPU.writePin(CPU.pins[2],true); // LED [On] CPU.writePin(CPU.pins[8],true); // LED [On] CPU.writePin(CPU.pins[7],true); // LED [On] break; case 6: CPU.writePin(CPU.pins[1],true); // LED [On] CPU.writePin(CPU.pins[6],true); // LED [On] CPU.writePin(CPU.pins[2],true); // LED [On] CPU.writePin(CPU.pins[8],true); // LED [On] CPU.writePin(CPU.pins[7],true); // LED [On] break; case 7: CPU.writePin(CPU.pins[14],true); // LED [On] CPU.writePin(CPU.pins[13],true); // LED [On] CPU.writePin(CPU.pins[8],true); // LED [On] break; case 8: CPU.writePin(CPU.pins[1],true); // LED [On] CPU.writePin(CPU.pins[2],true); // LED [On] CPU.writePin(CPU.pins[6],true); // LED [On] CPU.writePin(CPU.pins[7],true); // LED [On] CPU.writePin(CPU.pins[8],true); // LED [On] CPU.writePin(CPU.pins[13],true); // LED [On] CPU.writePin(CPU.pins[14],true); // LED [On] break; case 9: CPU.writePin(CPU.pins[1],true); // LED [On] CPU.writePin(CPU.pins[2],true); // LED [On] CPU.writePin(CPU.pins[7],true); // LED [On] CPU.writePin(CPU.pins[8],true); // LED [On] CPU.writePin(CPU.pins[13],true); // LED [On] CPU.writePin(CPU.pins[14],true); // LED [On] break; case 0: CPU.writePin(CPU.pins[1],true); // LED [On] CPU.writePin(CPU.pins[6],true); // LED [On] CPU.writePin(CPU.pins[7],true); // LED [On] CPU.writePin(CPU.pins[8],true); // LED [On] CPU.writePin(CPU.pins[13],true); // LED [On] CPU.writePin(CPU.pins[14],true); // LED [On] break; } // end switch } // end displayNumber public static void clearLED() { CPU.writePin(CPU.pins[1],false); // LED [Off] CPU.writePin(CPU.pins[2],false); // LED [Off] CPU.writePin(CPU.pins[6],false); // LED [Off] CPU.writePin(CPU.pins[7],false); // LED [Off] CPU.writePin(CPU.pins[8],false); // LED [Off] CPU.writePin(CPU.pins[13],false); // LED [Off] CPU.writePin(CPU.pins[14],false); // LED [Off] } // end clearLED } // end class declaration