Hi, I want to pass pin numbers and then declare them in C code, I want to do something like this
B4X:
Public Sub Begin (Pin1 As Byte, Pin2 As Byte)
RunNative ("begindevice",Array As Byte (Pin1,Pin2))
End Sub
#If C
void begindevice(B4R::Object* o){
B4R::Array* b = (B4R::Array*)B4R::Object::toPointer(o);
char* c = (char*)b->data;
int p1 = (c[0]); //get pin numbers
int p2 = (c[1]);
// how to declare and set pin mode of Pin1 and Pin2, for use in all other C subs for example sub (setP)
}
void setP(B4R::Object* o){
digitalWrite(Pin1,HIGH)
}
#End If