Eins hab ich schonmal:

_delay_ms(500) wird nicht funktionieren:

"The maximal possible delay is 262.14 ms / F_CPU in MHz"

Grüsse, Stefan