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.
yes sir,it's about the $50 robot..is the purpose of the LED just to show that the microcontroller receives voltage?if that so,is the battery the problem why my microcontroller doesn't receives certain volts or current.. I'm using a 4 AA alkaline batteries.. 1.5V each in particular..tnx^^
#include <avr/io.h>#include <util/delay.h>#include "global.h"#include "a2d.h"void delay_ms( unsigned long int ms ) { _delay_ms( ms );}void delay_cycles( unsigned long int cycles ) { while( cycles > 0 ) cycles--;}void PORTD_HIGH( int position ) { PORTD |= (1 << position); }void PORTD_LOW( int position ) { PORTD &= ~(1 << position);}void LED_ON( void ) { PORTD_LOW(4);}void LED_OFF( void ) { PORTD_HIGH(4);}void configure_ports( void ) { DDRD = 0xFF; // Set Port D pins as all outputs DDRC = 0x00; // Set all C ports for input PORTC = 0x00; // Make sure pull-up resistors are turned off}int main( void ) { // Setup input and output ports as such configure_ports(); while(1) { LED_ON(); delay_cycles(1000); LED_OFF(); delay_cycles(1000); } return 1;}