The GitHub repository; https://github.com/philleonard/LeJOS-NXT-Mindstorm-Navigation.git
The PDF can be downloaded here if you find the PDF viewer below a little small.
Cheers!
Phil
import lejos.nxt.*;
public class fib {
public static void main (String[] args) {
//Limit the sequence.
int fib[] = new int[100];
//First two terms in sequence are 1
fib[0] = fib[1] = 1;
for (int i = 2; i < fib.length; i++) {
//Calculate, and print next value in Fibonacci sequence
fib[i] = fib[i - 1] + fib[i - 2];
LCD.clear();
LCD.drawInt(fib[i], 6, 4);
//Move forward for the length of the Fibonacci number
Motor.C.forward();
Motor.A.forward();
try{
Thread.sleep(fib[i]);
} catch (Exception e) {}
//Sleep for a tenth of a second.
Motor.C.stop();
Motor.A.stop();
try{
Thread.sleep(100);
} catch (Exception e) {}
}
}
}