Podpialem swoj wyswietlacz (
#include <avr/io.h>
#include <avr/iom8.h>
void pause(unsigned char time) { for(unsigned char i = 0 ; i < time; ++i) for(unsigned char j = 0 ; j < 255; ++j) ; }
#define DANE PORTD #define INSTR PORTC
#define A0 1 << 4 #define E1 1 << 3 #define E2 1 << 2 #define READ 1 << 1 #define RST 1 << 5
#define P0 1 #define P1 2 #define P2 4 #define P3 8 #define P4 16 #define P5 32 #define P6 64 #define P7 128
void SetI(const char & x) { INSTR = RST | x; }
void SetD(const char& x) { DANE = x; }
int main() { //DDRB = ~0;
DDRD = ~0; //out dir DDRC = ~0; //out dir
// Turn on display OPTIONAL??? SetI (0 | E1 | E2); pause(1);
SetD(0xe2); SetI(READ | E1 | E2); pause(1);
SetD(0xAF); SetI( E1 | E2); pause(1);
SetD (P0|P2|P4|P5|P7); SetI (E1|A0 | E2); pause(1);
while(1) { }
}