|
import josx.platform.rcx.*; /** * This program plays a C note 5 times **/ public class LoopExample { public static void main (String[] args0) throws Exception { int i = 0; // counter variable // loops 5 times for (i=0; i < 5; i++) { Sound.playTone(262,40); // C note Thread.sleep(500); } } } |
|
for( i = 0 ; i < n ; i++ ) { // my code here } |
|
while ( Sensor.S2.readBooleanValue() == false ) { Sound.playTone(349,40); // F note } |