I finally have a use for the parallel task capabilites on a 20m2 but during coding I realised something odd was going on, so I did some simple parallel task tests.
With 6 LEDs wired into the 20m2 I ran this code:
And as expected all 6 LEDs blinked in unison.
However if you don't use start0 and simply increase the number of all the start lines by any number, such as:
You'll discover the first parallel task (in the code, its number is irrelevent in this case) is running twice as fast as all the others as the LED blinks twice for each blink of the other LEDs.
But if you were to use start tasks in an order such as 1,3,4,5,6,7 then all 6 will blink in unison, only when you don't use start0 and the remaining task numbers don't have a gap in them will you get the first task running at double speed.
How weird is that?
Maybe someone might find a use for it
edit: I did one further test with this code:
and found with my multimeter the first LED was blinking at 292hz and the rest were all blinking at 146hz. And when I used start task numbers of 0,1,2,3,4,5 , all LEDs were blinking in unison at 170hz.
With 6 LEDs wired into the 20m2 I ran this code:
Code:
start0:
do
for b0=0 to 255
next b0
toggle b.0
toggle b.0
loop
start1:
do
for b1=0 to 255
next b1
toggle b.1
toggle b.1
loop
start2:
do
for b2=0 to 255
next b2
toggle b.2
toggle b.2
loop
start3:
do
for b3=0 to 255
next b3
toggle b.3
toggle b.3
loop
start4:
do
for b4=0 to 255
next b4
toggle b.4
toggle b.4
loop
start5:
do
for b5=0 to 255
next b5
toggle b.5
toggle b.5
loop
However if you don't use start0 and simply increase the number of all the start lines by any number, such as:
Code:
start1:
do
for b0=0 to 255
next b0
toggle b.0
toggle b.0
loop
start2:
do
for b1=0 to 255
next b1
toggle b.1
toggle b.1
loop
start3:
do
for b2=0 to 255
next b2
toggle b.2
toggle b.2
loop
start4:
do
for b3=0 to 255
next b3
toggle b.3
toggle b.3
loop
start5:
do
for b4=0 to 255
next b4
toggle b.4
toggle b.4
loop
start6:
do
for b5=0 to 255
next b5
toggle b.5
toggle b.5
loop
But if you were to use start tasks in an order such as 1,3,4,5,6,7 then all 6 will blink in unison, only when you don't use start0 and the remaining task numbers don't have a gap in them will you get the first task running at double speed.
How weird is that?
Maybe someone might find a use for it
edit: I did one further test with this code:
Code:
start1:
do
toggle b.0
loop
start2:
do
toggle b.1
loop
start3:
do
toggle b.2
loop
start4:
do
toggle b.3
loop
start5:
do
toggle b.4
loop
start6:
do
toggle b.5
loop
Last edited: