ATTiny85 7 add own train protcol — ATtiny85 simulation

An interactive ATtiny85 circuit simulation you can run free in your browser on Velxio, by ian7171.

Components

Sketch code

#define F_CPU 8000000UL // Is slower than the CPU but for this is fine

#include <avr/io.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
#include <stdint.h>
#include "fn_i2c.h"
#include "fn_UART.h"


/*
int main(void)

{

    usi_i2c_init();

    oled_init();

    oled_clear();

    oled_cursor(10, 2);

    print_to_oled(PSTR("Hello Aiden"));

    


serial_init();


    while (1)
    {
        serial_send('U');

    }





    return 0;

}*/



int main(void)
{
    DDRB |= (1 << TX);
    PORTB |= (1 << TX);

    uart_init();

    while (1)

    {

        uart_putc('H');

        uart_putc('E');

        uart_putc('L');

        uart_putc('L');

        uart_putc('O');

        uart_putc('\n');

        _delay_ms(100);

    }
}

More projects by ian7171