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 2 Guests are viewing this topic.
#include <avr/io.h>#include <util/delay.h>#include "uart2.h"#include "rprintf.h"void configurePorts(void);int main (void) { configurePorts(); uartInit(); rprintfInit(uart0SendByte); // UART0 = DDD1 rprintf("ABC\n\r"); _delay_ms(1000); rprintf("DEF\n\r"); _delay_ms(1000); rprintf("GHI\n\r"); return 0; }void configurePorts(void) { // Port B: Only used to scope pins for delay DDRB = 0xFF; // All Outputs PORTB = 0xFF; // All High // Port D: UART0 is DDD1 DDRD = (1 << DDD1);}
void sec(void) { unsigned long int x; for (x = 0; x < 780000; x++) { PORTB ^= (1 << PB0); }}
int main (void) {Any_setup_code here;Any_other_run_once_code;while(1) // indefinite loop { Your_repeating_code_here; }return 0;}
#include <avr/io.h>#include <util/delay.h>#include "uart2.h"#include "rprintf.h"void configurePorts(void);int main (void) { configurePorts(); uartInit(); while(1) rprintfInit(uart0SendByte); // UART0 = DDD1 rprintf("ABC\n\r"); _delay_ms(1000); rprintf("DEF\n\r"); _delay_ms(1000); rprintf("GHI\n\r"); } return 0; }void configurePorts(void) { // Port B: Only used to scope pins for delay DDRB = 0xFF; // All Outputs PORTB = 0xFF; // All High // Port D: UART0 is DDD1 DDRD = (1 << DDD1);}
#include <avr/io.h>#include <util/delay.h>#include "uart2.h"#include "rprintf.h"void configurePorts(void);int main (void) { configurePorts(); uartInit(); while(1) { rprintfInit(uart0SendByte); // UART0 = DDD1 rprintf("ABC\n\r"); _delay_ms(1000); rprintf("DEF\n\r"); _delay_ms(1000); rprintf("GHI\n\r"); } return 0; }void configurePorts(void) { // Port B: Only used to scope pins for delay DDRB = 0xFF; // All Outputs PORTB = 0xFF; // All High // Port D: UART0 is DDD1 DDRD = (1 << DDD1);}
Started by ninja Electronics
Started by Tomas Electronics
Started by Popcorn97 Electronics