I have a program that is supposed to turn on 4 LEDs simultaneously in 4 steps:

the 4 LEDs are turned on for 500 ms using PMW for a value of 10mv.the 4 LEDs are turned on for 500 ms using PMW for a value of 250mv.the 4 LEDs are turned on for 500 ms using PMW for a value of 50mv.the 4 LEDs are turned on for 500 ms using PMW for a value of 0mv.The program makes the stpe 1 and 2 and then it stops wotking and the LEDs keep on at 250mv.

I tried to change the duration for the first two steps but it always stops after these first two steps are done and don't continue the 3 and 4.

I used oriented object programming so please be patient with the code; actually the most important classes are Effect and Motor.

Node.cpp: this class creates a Node which is defined by an amplitude and a duration for the selected for example: amplitude: 10mv duration:500ms

the 4 LEDs are turned on for 500 ms using PMW for a value of 10mv.the 4 LEDs are turned on for 500 ms using PMW for a value of 250mv.the 4 LEDs are turned on for 500 ms using PMW for a value of 50mv.the 4 LEDs are turned on for 500 ms using PMW for a value of 0mv.

Unless you have a circuit to turn PWM into analog, it doesn't work that way.PWM is full VCC for value/256 time out of each duty cycle. Default duty cycle is about (just over) 2 ms. PWM 127 should get just over 1 ms ON, 1 ms OFF at 5V pattern.