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.
// Place any #define statements here before you include ANY other files // You must ALWAYS specify the board you are using// These are all in the 'sys' folder e.g.#include "sys/axon.h" // I am using an Axon // Now include any other files that are needed here#include "uart.h"#include "rprintf.h" // Now create any global variables such as motors, servos, sensors etc // This routine is called once only and allows you to do set up the hardware// Dont use any 'clock' functions here - use 'delay' functions insteadvoid appInitHardware(void){ rprintf("Initializing Hardware...\r\n"); // Set UART0 to 19200 baud uartInit(UART0, 19200); // Tell rprintf to output to UART0 rprintfInit(&uart0SendByte);}// This routine is called once to allow you to set up any other variables in your program// You can use 'clock' function here.// The loopStart parameter has the current clock value in µSTICK_COUNT appInitSoftware(TICK_COUNT loopStart){ return 0; // dont pause after} // This routine is called repeatedly - it?s your main loopTICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){ rprintf("Hello world\n"); return 1000000; // wait for 1 second before calling me again. 1000000us = 1 second}
statusLED_off();
// Place any #define statements here before you include ANY other files // You must ALWAYS specify the board you are using// These are all in the 'sys' folder e.g.#include "sys/axon.h" // I am using an Axon // Now include any other files that are needed here#include "uart.h"#include "rprintf.h" // Now create any global variables such as motors, servos, sensors etc // This routine is called once only and allows you to do set up the hardware// Dont use any 'clock' functions here - use 'delay' functions insteadvoid appInitHardware(void){ rprintf("Initializing Hardware...\r\n"); // Set UART1 to 19200 baud uartInit(UART1, 19200); // Tell rprintf to output to UART1 rprintfInit(&uart1SendByte);}// This routine is called once to allow you to set up any other variables in your program// You can use 'clock' function here.// The loopStart parameter has the current clock value in µSTICK_COUNT appInitSoftware(TICK_COUNT loopStart){ return 0; // dont pause after} // This routine is called repeatedly - it?s your main loopTICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){ rprintf("Hello world\n"); return 1000000; // wait for 1 second before calling me again. 1000000us = 1 second}