Buy an Axon, Axon II, or Axon Mote and build a great robot, while helping to support SoR.
0 Members and 1 Guest are viewing this topic.
package arduino.tutorial;import static haiku.avr.lib.arduino.WProgram.*;public class BlinkWithThread extends Thread { static byte ledPin = 13; // LED connected to digital pin 13 public void run() // run over and over again { while (true) { digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for a second } } /** * @param args */ public static void main(String[] args) { pinMode(ledPin, OUTPUT); // sets the digital pin as output new BlinkWithThread().start(); }}
I never have heard, that ROS (Robot OS) runs on ATMega-32.
java has got a rich classes for such purpose and an ease in mathematical calculations
it's C which 'use way too much resources
Are C libraries bigger or smaller than JAVA libraries? Or are they smaller because they include less functions than equivalent JAVA libraries? What's your point here?
Forth: Do you know an AVR port of Forth? If so and when it comes to the fun-part: Does Forth support multithreading?
5 threads - in my experience - are a lot for robots which are based on ATmega328p.
...public class BlinkWithThread extends Thread { static byte ledPin = 13; // LED connected to digital pin 13 public void run() // run over and over again { while (true) { digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for a second } } private static long fib(int n) { if (n < 2) return 1; return fib(n - 1) + fib(n - 2); }; public static void main(String[] args) { pinMode(ledPin, OUTPUT); // sets the digital pin as output new BlinkWithThread().start(); for (int i = 0; i<20; i++) { Serial.print(i); Serial.print(' '); Serial.println(fib(i)); } }}