This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| logicpython:cubloc_api:stepstat [2026/04/22 05:23] – [Example] mfranklin | 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 13: | Line 13: | ||
| ===== Parameters ===== | ===== Parameters ===== | ||
| - | * **pin**: | + | * **pin**: |
| ===== Return Value ===== | ===== Return Value ===== | ||
| Line 27: | Line 27: | ||
| <code python> | <code python> | ||
| + | from time import sleep_ms | ||
| from cubloc import StepStat | from cubloc import StepStat | ||
| + | # Start the pulse train | ||
| StepPulse(15, | StepPulse(15, | ||
| - | result = StepStat(15) | ||
| - | print(result) | ||
| while True: | while True: | ||
| - | | + | |
| + | |||
| + | # Print the number of pulses generated so far | ||
| + | result = StepStat(15) | ||
| + | print(result) | ||
| </ | </ | ||