Programmers

All on one SLOW page
Serial Port
Parallel Port
Smart Programmers
Serial Loaders

Projects

ATmega8 Serial LCD
ATtiny2313 Serial LCD
ATtiny4313 Serial LCD
ATmega328 SIRC
ATtiny2313 SIRC
40-pin Dev Board
28-pin Dev Board
AVR PS/2 Keyboard
AVR MAX232 RTS/CTS
AVR Dual RS232 Ports

Minimal Circuits

ATmega16
ATmega32
ATmega644
ATmega1284
ATmega8515
ATmega8535
ATmega8
ATmega48
ATmega88
ATmega168
ATmega328
ATmega162
ATmega128
ATtiny13
ATtiny2313
ATtiny4313
ATtiny24
ATtiny84
ATtiny25
ATtiny45
ATtiny85

Other Stuff

ATtiny13 vs ATtiny85
ATmega8 vs ATmega88
ATmega16 vs ATmega164
ISP and SPI
MAX232 Arduino
A small FAQ
Hardware Info

SIRC using an ATmega328

Page: 1 2 3 4 5

Test Sketch

This sketch demonstrates the library. Button 1 turns on an LED and button 4 turns it off. Button 2 turns on another LED and button 5 turns it off. The volume up and down fades an LED on and off.

#include 

const int LED1 = 9;
const int LED2 = 12;
const int LED3 = 13;
const int cmdBtn1 = 0;
const int cmdBtn2 = 1;
const int cmdBtn4 = 3;
const int cmdBtn5 = 4;
const int cmdVolUp = 18;
const int cmdVolDn = 19;
const int adrBtn = 1;

int level1 = 1;

void setup() { 

    pinMode(LED1, OUTPUT);
    pinMode(LED2, OUTPUT);
    pinMode(LED3, OUTPUT);
} 

void loop() {

  
    if ( Sirc.commandReady ) {
      Sirc.commandBusy = true;
      if ( Sirc.address == adrBtn ) {
        if ( Sirc.command == cmdBtn1 ) {
          digitalWrite( LED2, HIGH );
        } else if ( Sirc.command == cmdBtn4 ) {
          digitalWrite( LED2, LOW );
        } else if ( Sirc.command == cmdBtn2 ) {
          digitalWrite( LED3, HIGH );
        } else if ( Sirc.command == cmdBtn5 ) {
          digitalWrite( LED3, LOW );
        } else if ( Sirc.command == cmdVolUp ) {
          if (( level1 += 5 ) > 254 ) {
            level1 = 254;
          }
        } else if ( Sirc.command == cmdVolDn ) {
          if (( level1 -= 5 ) < 1 ) {
            level1 = 1;
          }
        }
        analogWrite( LED1, level1 );
      }
      Sirc.command = 0;
      Sirc.commandReady = false;
      Sirc.commandBusy = false;
    }
}

Page: 1 2 3 4 5