VOLUMN-LINK

音量模組

內置兩組
0 ~ 1023
Slot
0 1 2 3
4 5 6 7
 

B4R = Basic4Arduino

Libraries Manager  rCore
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 btnA2 As Pin
  Private btnA3 As Pin
End Sub

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

  btnA2.Initialize(btnA2.A2,btnA2.MODE_INPUT)
  btnA2.AddListener("BtnA2_StateChanged")

  btnA3.Initialize(btnA3.A3,btnA3.MODE_INPUT)

  CallSubPlus("BtnA2_StateChanged",1000,1)
End Sub


Sub BtnA2_StateChanged (State As Boolean)
  Dim ss As String = JoinStrings(Array As String("A2 : ", btnA2.AnalogRead ," , A3 : ", btnA3.AnalogRead))
  Log(ss)
  CallSubPlus("BtnA2_StateChanged",1000,1)
End Sub
 
程式說明