Getting actual syntax

Hello… it’s me again

I already use Gadgeteer since a while… but I updated now my Boards to the latest SDK 4.3.
Now I have some issues with the new syntax… my C# knowledge is really minimal… so I’m out of ideas pretty fast.

Thet the
void ProgramStarted()
changed to
Public Sub ProgramStarted()

can I live with…
And for many modules there is a “Sample Program” in the catalog.
Will those stay there for a long time or do I need to download em all for later use?

However… I got a problem with the Button.
That one workes a bit different than the other modules.
In old times I used:

button.ButtonPressed += button_ButtonPressed;

void button_ButtonPressed(Button sender, Button.ButtonState state)
{}

But this doesn’t work anmore…
Can someone tell me what I have to use now? ::slight_smile:
(And is it similar with the JoyStick button?)

Thank you very much for the informations.
I hope I can use my equipment for a while longer… got a whole box full of Gadgeteer material.
And I think it’s very handy to use also for ppl that don’t have much programming knowledge… like me^^

Greets evul

The press event goes inside the ProgramStarted section and the handler goes just after that:



        void ProgramStarted()
        {
            button.ButtonPressed += button_ButtonPressed;
        }

        void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            led.BlinkOnce(white); 
        }


Ahh… noticed my error.
I selected the wrong programming language while creating the project… silly me -.-"
Was really wondering why you stillhad the


void ProgramStarted()

and me not^^


    Partial Public Class Program
        Public Sub ProgramStarted()
  
            button.ButtonPressed += button_ButtonPressed;

        End Sub
        void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            led.BlinkOnce(white); 
        }

    End Class

Thx for help :3

You have mixed C# and VB code. :naughty: