Blink without delay

ferojusko2:
Hi
I don't undurstand why you divide millis()/1024?
2^32=4294967296; 4294967296/1000=4294967.296; 4294967.296%2=1;

I use this counting and works perfect thought millis() over count
In Arduino int=2^16 I thing.

I said "integer" not int. Integers are a mathematical class of numbers, while ints are a C/C++ datatype. Don't get them confused, because C/C++ "long" type is also an integer.

Your math is correct. However, it is also the reason why your method won't work. It appears to work for you, because you didn't wait 42 days for millis to roll over. When it does, one of your pulses will be too short, and subsequent pulses will be out of sync.

Your last pulse before rollover is at t+4294967000 milliseconds. The next pulse should be at t+4294968000 milliseconds (which is evenly divisible by 1000). But at that time, millis will read 4294968000-4294967296 = 704. It should be evenly divisible by 1000, but it isn't. Now do you see?