I am finally starting to experiment with my project but I am unsure of which pins are which.
I was following this tutorial, but instead I was trying to get a relay to open and close. I tried 1-30 for the pin # and nothing ever happened. It's possible that I had something wrong, but mainly for now I am curious if anyone knows how to "address" a specific pin on this board.
All I have to go on is this image, but it doesn't tell me what # to use for each pin.
Regarding my relay, I was expecting it to click at some point as I literally went through each pin (1-30) in the code, one at a time.
I have a 5v power supply connected to Vin and Gnd. For the 5v relay, I have Positive going to the 5v rail on my breadboard, Gnd going to the ground rail on my breadboard and for the signal pin, I have it connected to GPIO0 as per a diagram linked above.
I was following this tutorial, but instead I was trying to get a relay to open and close. I tried 1-30 for the pin # and nothing ever happened. It's possible that I had something wrong, but mainly for now I am curious if anyone knows how to "address" a specific pin on this board.
All I have to go on is this image, but it doesn't tell me what # to use for each pin.
B4X:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
' DO NOT USE PINS: 6,7,8,11
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
Private gpio0 As Pin
Private Timer1 As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
gpio0.Initialize(13, gpio0.MODE_OUTPUT) ' Tried 1-30
gpio0.DigitalWrite(False)
Timer1.Initialize ("Timer1_Tick", 3000)
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick
Dim currentState As Boolean = gpio0.DigitalRead
Log("Relay > CurrentState: ", currentState)
Dim NewState As Boolean = Not(currentState)
Log("Relay > NewState: ", NewState)
gpio0.DigitalWrite(NewState)
End Sub
Regarding my relay, I was expecting it to click at some point as I literally went through each pin (1-30) in the code, one at a time.
I have a 5v power supply connected to Vin and Gnd. For the 5v relay, I have Positive going to the 5v rail on my breadboard, Gnd going to the ground rail on my breadboard and for the signal pin, I have it connected to GPIO0 as per a diagram linked above.