Hi,
how can I re-raise the instructions that are inside the programStarter () without performing all the main ()?
the code:
void ProgramStarted()
{
Debug.Print(“Program Started”);
PWM Srclk = new PWM(Cpu.PWMChannel.PWM_2, 500, 0.5, true); // Socket4 PIEDINO 9 …CLOCK
GT.Socket socket = GT.Socket.GetSocket(4, false, null, null);
Ser = new GT.Interfaces.DigitalOutput(socket, GT.Socket.Pin.Three, false, null); //Socket4 PIEDINO 3 .....Dato seriale
Rclk = new GT.Interfaces.DigitalOutput(socket, GT.Socket.Pin.Four, false, null); //Socket4 PIEDINO 4 .....Avanzamento Dato seriale
Oe_Neg = new GT.Interfaces.DigitalOutput(socket, GT.Socket.Pin.Five, false, null); //Socket4 PIEDINO 5 .....Abilita Uscite
Srclr_Neg = new GT.Interfaces.DigitalOutput(socket, GT.Socket.Pin.Six, false, null); //Socket4 PIEDINO 6 .....Pulisce lo shift register
Srclk.Start();
Oe_Neg.Write(false);
Thread.Sleep(2);
Ser.Write(true);
Srclr_Neg.Write(true);
Thread.Sleep(2);
Ser.Write(false);
buttonForMountaineer.ButtonPressed += new ButtonForMountaineer.ButtonEventHandler(buttonForMountaineer_ButtonPressed);
buttonForMountaineer.ButtonReleased += new ButtonForMountaineer.ButtonEventHandler(buttonForMountaineer_ButtonReleased);
}
void buttonForMountaineer_ButtonReleased(ButtonForMountaineer sender, ButtonForMountaineer.ButtonState state)
{
Debug.Print("Dato inserito…posizione "+a);
if (a == 8)
{
a = 0;
Oe_Neg.Write(true);
Thread.Sleep(4);
Oe_Neg.Write(false);
Main(); <<<---------------Reload MAIN()
}
}
thanks.
Scorpion1