SHARE
TWEET

Untitled

a guest Apr 7th, 2017 135 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' Gambas class file
  2.  
  3.   Private Sport As SerialPort
  4.  
  5.  
  6.  
  7. Public Sub Form_Open()
  8.  
  9.   Sport = New SerialPort As "Sport"
  10.   Sport.PortName = "/dev/ttyACM0"
  11.   Sport.Speed = "9600"
  12.   Sport.Parity = 0
  13.   Sport.DataBits = "8"
  14.   Sport.StopBits = "2"
  15.   Sport.FlowControl = 0
  16.   Try Sport.Open()
  17.  
  18.  
  19. End
  20.  
  21.  
  22.  
  23.  
  24.  
  25. Public Sub PY_MouseDown()
  26.  
  27.   Try Print #SPort, "w"
  28. End
  29.  
  30. Public Sub MX_MouseDown()
  31.  
  32.   Try Print #SPort, "a"
  33. End
  34.  
  35. Public Sub MY_MouseDown()
  36.  
  37.   Try Print #SPort, "s"
  38. End
  39.  
  40. Public Sub PX_MouseDown()
  41.  
  42.   Try Print #SPort, "d"
  43. End
  44.  
  45. Public Sub PZ_MouseDown()
  46.  
  47.   Try Print #SPort, "i"
  48. End
  49.  
  50. Public Sub MZ_MouseDown()
  51.  
  52.   Try Print #SPort, "k"
  53. End
  54.  
  55. Public Sub PU_MouseDown()
  56.  
  57.   Try Print #SPort, "u"
  58. End
  59.  
  60. Public Sub MU_MouseDown()
  61.  
  62.   Try Print #SPort, "j"
  63. End
  64.  
  65.  
  66.  
  67.  
  68. Public Sub PY_MouseUp()
  69.  
  70.   Try Print #SPort, "z"
  71. End
  72.  
  73. Public Sub MX_MouseUp()
  74.  
  75.   Try Print #SPort, "z"
  76. End
  77.  
  78. Public Sub MY_MouseUp()
  79.  
  80.   Try Print #SPort, "z"
  81. End
  82.  
  83. Public Sub PX_MouseUp()
  84.  
  85.   Try Print #SPort, "z"
  86. End
  87.  
  88. Public Sub PU_MouseUp()
  89.  
  90.   Try Print #SPort, "z"
  91. End
  92.  
  93. Public Sub MU_MouseUp()
  94.  
  95.   Try Print #SPort, "z"
  96. End
  97.  
  98. Public Sub PZ_MouseUp()
  99.  
  100.   Try Print #SPort, "z"
  101. End
  102.  
  103. Public Sub MZ_MouseUp()
  104.  
  105.   Try Print #SPort, "z"
  106. End
  107.  
  108.  
  109.  
  110. Public Sub auto_Click()
  111.  
  112.   Try Print #SPort, "o"
  113.   nSteps.Visible = True
  114.   Label2.Visible = True
  115.   set_nSteps.Visible = True
  116.  
  117.  
  118.  
  119. End
  120.  
  121. Public Sub manual_Click()
  122.  
  123.   Try Print #SPort, "l"
  124.   nSteps.Visible = False
  125.   Label2.Visible = False
  126.   set_nSteps.Visible = False
  127.  
  128.  
  129.  
  130. End
  131.  
  132.  
  133.  
  134. Public Sub set_Click()
  135.  
  136.   Try Print #Sport, "m"
  137.   Sleep 0.05
  138.   Try Print #Sport, stepSpeed.Value
  139.  
  140.  
  141. End
  142.  
  143. Public Sub set_nSteps_Click()
  144.  
  145.   Try Print #Sport, "p"
  146.   Sleep 0.05
  147.   Try Print #Sport, nSteps.Value
  148.  
  149. End
  150.  
  151.  
  152.  
  153. Public Sub fullStep_Click()
  154.  
  155.   Try Print #Sport, "x"
  156.  
  157. End
  158.  
  159. Public Sub halfStep_Click()
  160.  
  161.   Try Print #Sport, "c"
  162.  
  163. End
  164.  
  165. Public Sub quarterStep_Click()
  166.  
  167.   Try Print #Sport, "v"
  168.  
  169. End
  170.  
  171. Public Sub eighthStep_Click()
  172.  
  173.   Try Print #Sport, "b"
  174.  
  175. End
  176.  
  177. Public Sub sisteenthStep_Click()
  178.  
  179.   Try Print #Sport, "n"
  180.  
  181. End
  182.  
  183.  
  184.  
  185. Public Sub salir_Click()
  186.  
  187.   Quit
  188.  
  189. End
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top