Main Site Documentation

Increase of a PIN in the for loop


#1

Hi

For i As Integer = 0 To 6
           Outs(i) = New GTI.DigitalOutput(Socket, Gadgeteer.Socket.Pin.Three + i, False, Modules)
           Next

the sum. Pin.Three + i
work in C # but not in VB
how you can use a similar function in VB?


#2

@ ABS_DEV - Can you cast the enum to an int like this:


Outs(i) = New GTI.DigitalOutput(Socket, (int)Gadgeteer.Socket.Pin.Three + i, False, Modules)


#3

so by an error of type
but in VB Integer Gadgeteer.Socket.Pin.Three be allowed to become?

I confirm that the sum without the program
works perfectly! :slight_smile:

 Outs(0) = New GTI.DigitalOutput(Socket, Socket.Pin.Three, False, Modules)