/*
 * LED_cude_test.c
 *
 * Created: 25.12.2012 19:39:46
 *  Author: Nikolaj
 */ 

#include "avr/io.h"

int8_t const reihen[10] = {0, 128, 1, 64, 2, 32, 4, 16, 8, 255};
int8_t const spalten[9] = {0, 1, 2, 4, 8, 16, 32, 64, 128};

int main(void)
{
	PORTE.DIRSET = 0xFF; /* PORTE als Ausgang. Matrix 74ACT573(Dx8)  */
	PORTC.DIRSET = 0xFF; /* PORTC als Ausgang. Matrix (8xLE(74ACT573)) */
	PORTH.DIRSET = 0xFF; /* PORTH als Ausgang. 74HCT273D(Ebene) */
	PORTA.DIRSET = 0xFF;
	
	int pause=0;
	while(1)
    {
		
		PORTA.OUTCLR = PIN0_bm;
		PORTH.OUT = reihen[9];
		PORTA.OUTSET = PIN0_bm;
		
		PORTE.OUT = 0xFF;
		PORTC.OUT = 0xFF;
		PORTC.OUT = 0x00;
		while(1)
		{
			PORTE.OUT = 0x00;
			PORTC.OUT = 64;
		}

		 		
	}
}
/*
		PORTE.OUTCLR = 0xFF; 
		PORTC.OUTSET = 0xFF;
		int8_t lauf=0;
	
		for(lauf=1; lauf<=8; lauf++)
		{
			PORTA.OUTCLR = PIN0_bm;
			PORTH.OUT = reihen[lauf];
			PORTA.OUTSET = PIN0_bm; 
			for(pause=0; pause<=10000; pause++);					
		}
		for(lauf=8; lauf>=1; lauf--)
		{
			PORTA.OUTCLR = PIN0_bm;
			PORTH.OUT = reihen[lauf];
			PORTA.OUTSET = PIN0_bm; 
			for(pause=0; pause<=10000; pause++);					
		}	
*/