TACK-LINK
品名 按鈕模組
規格 內置兩鍵

B4R = Basic4Arduino

Libraries Manager  rCore
#Region Project Attributes
  #AutoFlushLogs: True
  #CheckArrayBounds: True
  #StackBufferSize: 300
#End Region

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 btnA0 As Pin
  Private btnA1 As Pin
End Sub

Private Sub AppStart
  Serial1.Initialize(115200)
  Log("AppStart")

  btnA0.Initialize(btnA0.A0,btnA0.MODE_INPUT)
  btnA0.AddListener("BtnA0_StateChanged")

  btnA1.Initialize(btnA1.A1,btnA1.MODE_INPUT)
  btnA1.AddListener("BtnA1_StateChanged")
End Sub


Sub BtnA0_StateChanged (State As Boolean)
 Log("A0 = ",State)
End Sub

Sub BtnA1_StateChanged (State As Boolean)
 Log(" A1 = ",State)
End Sub