/* Code */ //You have to add this function to "digitalout.c" (from heavy) void DigitalOut_SetAllValues(int Value) { int n; for(n=1; n <= DIGITALOUT_COUNT; n++){ DigitalOut_SetValue(n-1, Value); } } //This is the Task, you can place this piece of code wherever you want void LEDEffect() { int n, i, step; //Turns off all digital outs DigitalOut_SetAllValues(0); while(true) { //First (from 0 to 2 and 5 to 7) for(n=0; n<=2; n++) { for(i=0; i<=1; i++){ step = i*4; (0+step-(n+step)) == 0 ? DigitalOut_SetValue(0+step, 1) : DigitalOut_SetValue(0+step, 0); (1+step-(n+step)) == 0 ? DigitalOut_SetValue(1+step, 1) : DigitalOut_SetValue(1+step, 0); (2+step-(n+step)) == 0 ? DigitalOut_SetValue(2+step, 1) : DigitalOut_SetValue(2+step, 0); } Sleep(8); } //Second (From 3 to 1 and 7 to 5) for(n=3; n>=1; n -= 1) { for(i=0; i<=1; i++){ step = i*4; (3+step-(n+step)) == 0 ? DigitalOut_SetValue(3+step, 1) : DigitalOut_SetValue(3+step, 0); (2+step-(n+step)) == 0 ? DigitalOut_SetValue(2+step, 1) : DigitalOut_SetValue(2+step, 0); (1+step-(n+step)) == 0 ? DigitalOut_SetValue(1+step, 1) : DigitalOut_SetValue(1+step, 0); } Sleep(8); } } } //Finally, you have to create a task at Make(), located at "make.c" TaskCreate( LEDEffect, "LEDEff", 400, NULL, 3);