AVR Programming with C.

Simple and fun projects with AVR-C

Public Chat
Similar projects worth following
We all love arduino but we have to admit that most of the times, it is limited and if you really want to understand nitty-gritty details of microcontrollers then you need to strip your arduino board.

In this project, i will programming various AVR microcontrollers with C.

I will be using USBasp as my programmer, since i run i Linux, i will programming straight from the terminal using avrdude.

I will also be programming an Attiny85 directly and Atmega328p from UNO board.


Code for iterating through the 3 colours of an RGB LED

x-csrc - 436.00 bytes - 08/26/2019 at 22:07


  • 1 × ATtiny85 Microprocessors, Microcontrollers, DSPs / ARM, RISC-Based Microcontrollers
  • 1 × Arduino UNO
  • 1 × USBasp Programmer for AVR board

  • Input with tactile Push button.

    8teims08/26/2019 at 23:46 0 comments

    Today i decided to use tactile push button to get binary input unlike the arduino code i had to do math. Encountered my third AVR i/o avr register  PINx.

    //This Code is a simple i/o using tactile switch button and a LED.
    #define F_CPU 16000000L
    #include <avr/io.h>
    #include <util/delay.h>
    int main(){
            DDRB = 0x01;//Setting PB0 as output
            PORTB = 0x02;//Activating internal pullups of PB1
                    if(!(PINB & 0x02)){
                            PORTB |= 0x01;//Bitmask operation
                            PORTB &= 0xFE;//Bitmask operation

  • RGBlinking with Arduino.

    8teims08/26/2019 at 02:37 0 comments

    Today i wrote a simple blink code, with a little twist. It loops through all 3 colours of an RGB LED and then becomes White.

View all 2 project logs

Enjoy this project?



8teims wrote 08/26/2019 at 22:09 point

Thanks, I really appreciate. 

  Are you sure? yes | no

Ken Yap wrote 08/26/2019 at 05:48 point

Tip: The left and right shift operators have an assign counterpart, I.e. you can write i <<= 1.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates