73 lines
1.9 KiB
C
73 lines
1.9 KiB
C
/* ******************************************************** *
|
|
* *
|
|
* Simple Template for ATMEL Microcontroller *
|
|
* -------------------------------------------------------- *
|
|
* Created on: 25.07.2016 *
|
|
* Author: Paolo Iocco *
|
|
* ******************************************************** */
|
|
/* ******************************************************** *
|
|
ATtiny 84 Pin map
|
|
+-\/-+
|
|
GND 1|o |14 GND
|
|
PB0 2| |13 PA0 ADC0
|
|
PB1 3| |12 PA1 ADC1
|
|
/Reset PB3 4| |11 PA2 ADC2
|
|
PB2 5| |10 PA3 ADC3
|
|
ADC7 PA7 6| |9 PA4 ADC4 SCK
|
|
MOSI ADC6 PA6 7| |8 PA5 ADC5 MISO
|
|
+----+
|
|
* ******************************************************** */
|
|
|
|
#define F_CPU 1000000L
|
|
#define CONFIG_DISPLAY
|
|
|
|
#define __DELAY_BACKWARD_COMPATIBLE__
|
|
#include <avr/io.h>
|
|
#include <util/delay.h>
|
|
#include "../00_Lib/nokia_5110.h"
|
|
|
|
|
|
int main (void)
|
|
{
|
|
unsigned char zwischenspeicher;
|
|
DDRB = 0b00000001;
|
|
DDRA = 0b00011111;
|
|
|
|
LCD_init(); //LCD initialization
|
|
LCD_clear(); //clear the LCD
|
|
|
|
LCD_write_char('*');
|
|
LCD_write_byte(0,1);
|
|
LCD_write_byte(0,1);
|
|
LCD_write_char('L');
|
|
LCD_write_char('o');
|
|
LCD_write_char('v');
|
|
LCD_write_char('e');
|
|
LCD_write_byte(0,1);
|
|
LCD_write_byte(0,1);
|
|
LCD_write_byte(0,1);
|
|
LCD_write_byte(0,1);
|
|
LCD_write_byte(0,1);
|
|
LCD_write_char('S');
|
|
LCD_write_char('i');
|
|
LCD_write_char('l');
|
|
LCD_write_char('v');
|
|
LCD_write_char('i');
|
|
LCD_write_char('a');
|
|
LCD_write_byte(0,1);
|
|
LCD_write_byte(0,1);
|
|
LCD_write_char('*');
|
|
|
|
LCD_write_english_string(0,1,"LOVE");
|
|
|
|
while(1)
|
|
{
|
|
zwischenspeicher = PORTB;
|
|
zwischenspeicher = zwischenspeicher ^ 0b00000001;
|
|
PORTB = zwischenspeicher;
|
|
_delay_ms(500);
|
|
}
|
|
return 0;
|
|
}
|
|
|