User Tools

Site Tools

한국어

logicpython:cubloc_api:stepstat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
logicpython:cubloc_api:stepstat [2026/04/10 02:06] – created - external edit 127.0.0.1logicpython:cubloc_api:stepstat [2026/04/22 05:33] (current) – [Example] mfranklin
Line 1: Line 1:
 ====== StepStat ====== ====== StepStat ======
  
-Return how many pulses have been generated by the most recent ''StepPulse'' or ''StepAccel'' command on the ''channel''.+Return how many pulses have been generated by the most recent ''StepPulse'' or ''StepAccel'' command on the ''pin''.
  
 ===== Syntax ===== ===== Syntax =====
Line 8: Line 8:
 from cubloc import StepStat from cubloc import StepStat
  
-StepStat(channel: int)+StepStat(pin: int)
 </code> </code>
  
 ===== Parameters ===== ===== Parameters =====
  
-  * **channel**: ''StepPulse channel'' number (0 or 1).+  * **pin**: The GPIO pin on which ''StepPulse'' or ''StepAccel'' was used.
  
 ===== Return Value ===== ===== Return Value =====
  
-Return how many pulses have been generated by the most recent ''StepPulse'' or ''StepAccel'' command on the ''channel''.+Return how many pulses have been generated by the most recent ''StepPulse'' or ''StepAccel'' command on the ''pin''.
  
 ===== Exceptions ===== ===== Exceptions =====
  
-  * [[https://docs.micropython.org/en/latest/library/builtins.html#TypeError|TypeError]]: ''channel'' is not an integer. +  * [[https://docs.micropython.org/en/latest/library/builtins.html#TypeError|TypeError]]: ''pin'' is not an integer. 
-  * [[https://docs.micropython.org/en/latest/library/builtins.html#ValueError|ValueError]]: ''channel'' is outside the supported range.+  * [[https://docs.micropython.org/en/latest/library/builtins.html#ValueError|ValueError]]: ''pin'' is outside the supported range.
  
 ===== Example ===== ===== Example =====
  
 <code python> <code python>
 +from time import sleep_ms
 from cubloc import StepStat from cubloc import StepStat
  
-Example usage +Start the pulse train 
-result = StepStat(0+StepPulse(15, 2000, 5000) 
-print(result)+ 
 +while True: 
 +    sleep_ms(1000) 
 +     
 +    # Print the number of pulses generated so far 
 +    result = StepStat(15
 +    print(result) 
 </code> </code>
  
logicpython/cubloc_api/stepstat.1775786799.txt.gz · Last modified: by 127.0.0.1