Example: analyse QEP input (simulated by PWM outputs). More...
#include "BBB/pruio.bi"
#include "BBB/pruio_pins.bi"
Go to the source code of this file.
Macros | |
#define | PMX /* 4095 */ |
Default PMax value. | |
#define | VHz /* 25 */ |
The frequency for speed measurement. | |
Functions | |
int | main () |
Variables | |
CONST_UInt8 | PINS [...] = {P8_12, P8_11, P8_16} |
The header pins to use for input (PWMSS-1). | |
VAR | io = NEW PruIo |
Create a PruIo structure, wakeup subsystems. | |
Float_t | freq = 50. |
The current frequency (startvalue here). | |
Float_t | realfreq |
The real frequency of PWM output. | |
UInt32 | pmax = PMX |
The maximum position value. | |
UInt32 | posi |
The current position value. | |
UInt32 | m = -1 |
The operation mode for user configurations. | |
UInt32 | p = 0 |
The pin index to use for re-configuration. | |
Float_t | velo |
The current speed. | |
VAR | k = ASC(INKEY()) |
The key code. | |
Example: analyse QEP input (simulated by PWM outputs).
This file contains an example on how to use libpruio to analyse pulse trains from a QEP sensor. The sensor signals can either come from a real sensor. Or, to avoid the need of a real sensor, the signals can get simulated by PWM output which is generated by this program. Find a functional description in section qep.
Licence: GPLv3, Copyright 2014-2023 by Thomas{ doT ]Freiherr[ At ]gmx[ DoT }net
Compile by: fbc -w all qep.bas
Definition in file qep.bas.