This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| logicpython:cubloc_api:stepstat [2026/04/10 02:06] – created - external edit 127.0.0.1 | logicpython: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 '' | + | Return how many pulses have been generated by the most recent '' |
| ===== Syntax ===== | ===== Syntax ===== | ||
| Line 8: | Line 8: | ||
| from cubloc import StepStat | from cubloc import StepStat | ||
| - | StepStat(channel: int) | + | StepStat(pin: int) |
| </ | </ | ||
| ===== Parameters ===== | ===== Parameters ===== | ||
| - | * **channel**: '' | + | * **pin**: The GPIO pin on which '' |
| ===== Return Value ===== | ===== Return Value ===== | ||
| - | Return how many pulses have been generated by the most recent '' | + | Return how many pulses have been generated by the most recent '' |
| ===== Exceptions ===== | ===== Exceptions ===== | ||
| - | * [[https:// | + | * [[https:// |
| - | * [[https:// | + | * [[https:// |
| ===== 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, |
| - | print(result) | + | |
| + | while True: | ||
| + | sleep_ms(1000) | ||
| + | |||
| + | # Print the number of pulses generated so far | ||
| + | | ||
| + | print(result) | ||
| </ | </ | ||