Don't ad-block us - support your favorite websites. We have safe, unobstrusive, robotics related ads that you actually want to see - see here for more.
0 Members and 1 Guest are viewing this topic.
//C file using Axon, Xbee, and Sabertooth #define Xbee_controlled//WebbotLib includes#include "sys/axon2.h" //defines your MCU (change to axon.h if you use the original Axon)//#include "servos.h" //use for software servo PWM//#include "a2d.h" //use for ADC#include "rprintf.h" //use for UART//user includes#include "hardware.h"#include "led.h"#include actuators.h// In my initialising code - pass the list of servos to controlvoid appInitHardware(void) { //initialize UART ports (see hardware.h to change baud/names) uartInit(Xbee,9600); //UART0 uartInit(USB_UART, USB_BAUD); //USB pin_make_output(L6,true); // declare USB for output #ifdef USB_controlled rprintfInit(USB_ACTIVATE); #endif #ifdef Xbee_controlled rprintfInit(WIRELESS_ACTIVATE); #endif //Initialise motor controller sabertoothInit(&sabertooth); led_off();//clear display }TICK_COUNT appInitSoftware(TICK_COUNT loopStart){ rprintf("\nAxon Initiated.\n\n");return 0;}int tempbyte;//vehicle speedDRIVE_SPEED speed=30;DRIVE_SPEED turn=80;//define directionsvoid go_left(void) { act_setSpeed(&left,-turn); act_setSpeed(&right,turn); }void go_right(void) { act_setSpeed(&left,turn); act_setSpeed(&right,-turn); }void go_straight(void) { act_setSpeed(&left,speed); act_setSpeed(&right,speed); }void go_reverse(void) { act_setSpeed(&left,-speed); act_setSpeed(&right,-speed); }void stop_dumb_robot(void) { act_setSpeed(&left,0); act_setSpeed(&right,0); }// This is the main loopTICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart) { #ifdef USB_controlled tempbyte=USB_GET;//get a single character #endif #ifdef Xbee_controlled tempbyte=WIRELESS_GET; #endif //control direction if (tempbyte=='a') go_left(); else if (tempbyte=='d') go_right(); else if (tempbyte=='w') go_straight(); else if (tempbyte=='x') go_reverse(); else if (tempbyte=='s') stop_stupid_robot(); //control speed by < and > if (tempbyte==',') { speed-=10; if (speed < 0) speed=0; rprintf("\nspeed=%d ",speed); } if (tempbyte=='.') { speed+=10; if (speed > 100) speed=100; rprintf("\nspeed=%d ",speed); } return 2000; // wait for 2ms }
stop_stupid_robot();' and 'stop_dumb_robot();
I just looked at the 'Getting Started' tutorial again and I noticed I clicked 'Build' instead of 'Rebuild all'. Could that have been my issue?
Or did I name my files incorrectly?
make: *** No rule to make target `../lib/libWebbot-ATmega640.a', needed by `ERA3.elf'. Stop.