Zu 4:
Verzicht auf die Arduinonummerei
Die Pins und Zeiten sind jetzt neu zugeordnet.
Wenn nötig, dann sind die Zeiten neu anzuordnen
#include <util/delay.h>
const uint8_t size = 17; // anzahl LED Pins
const uint8_t ledtakt[size] PROGMEM = { 60, 25, 40, 75, 33, 90, 57, 24, 100, 68, 73, 80, 37, 75, 254, 97, 105};
// Register Pin Zuordnung {PB0 PB1 PB2 - - - - - - - - - PB7 | PD0 PD1 - - - - - - - - PD6 | PA0 PA1}
uint8_t ledtime[size]; // merker für den Zeitablauf
uint8_t zeitMerker = 0; // millis() ErsatzStoff
// Schwellwerte
const byte schwelleB = 8; // 8 Bit in Port B (bit 0 bis 7)
const byte schwelleD = 7; // 7 bit in Port D (bit 8 bis 14)
// der Rest muss in Port A stecken (bit 15 und 16)
int main()
{
DDRB = 0b11111111;
DDRD = 0b01111111;
DDRA = 0b00000011;
while(1)
{
for( uint8_t LED = 0; LED < size ; LED++ )
{
uint8_t diff = zeitMerker - ledtime[LED];
uint8_t takt = pgm_read_byte(&ledtakt[LED]);
if(diff >= takt)
{
ledtime[LED] = zeitMerker;
byte bit = LED; // das Bit, welches es zu verarbeiten gilt
if(bit<schwelleB)
{
PINB = (1<<bit);
continue;
}
bit -= schwelleB;
if(bit<schwelleD)
{
PIND = (1<<bit);
continue;
}
bit -= schwelleD;
PINA = (1<<bit);
}
}
_delay_ms(99); // 1 ms für die Verarbeitung
zeitMerker++;
}
}
auch wieder ungetestet, bin mitten auf dem Acker, keinerlei Arduino zur Hand