libpruio  0.6.8
Fast and easy Digital/Analog Input/Output for Beaglebones
qep.bas File Reference

Example: analyse QEP input (simulated by PWM outputs). More...

#include "BBB/pruio.bi"
#include "BBB/pruio_pins.bi"
Include dependency graph for qep.bas:

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.
 

Detailed Description

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

Since
0.4.0

Definition in file qep.bas.

Function Documentation

◆ main()

int main ( )

The main function.

Definition at line 121 of file qep.bas.

Here is the call graph for this function: