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

Example: draw a graph of analog inputs. More...

#include "BBB/pruio.bi"
#include "fbgfx.bi"
Include dependency graph for oszi.bas:

Go to the source code of this file.

Functions

int main ()
 

Variables

VAR S_W = 0
 The screen width.
 
VAR S_H = 0
 The srceen hight.
 
VAR BPP = 0
 The bits per plain number.
 
VAR full = fb.GFX_FULLSCREEN
 Fullscreen or windowed mode.
 
VAR p = INSTR(COMMAND, "x")
 The position of the 'x' character (if any). More...
 
VAR w = VALINT(COMMAND)
 The required window width.
 
VAR h = VALINT(MID(COMMAND, p + 1))
 The required window hight.
 
UInt32 col [...]
 The colors for the lines (= channels). More...
 
UInt32 last [...]
 The previous data of the channels. More...
 
VAR io = NEW PruIo
 Create a PruIo structure, wakeup subsystems.
 
VAR scale = S_H / 65520
 The factor to scale values.
 
VAR gap = 2
 The gap between x values.
 
VAR fg = RGB(0, 0, 0)
 The foreground color.
 
VAR bg = RGB(250, 250, 250)
 The background color.
 
VAR k = ASC(INKEY())
 The key code.
 
VAR m = .Conf->STEPENABLE
 The step mask.
 
VAR neu = S_H - CUINT(.Value[i] * scale)
 The new sample.
 
VAR j = i - 1
 The channel index.
 

Detailed Description

Example: draw a graph of analog inputs.

This file contains an example on how to use libpruio to continuously draw a graph of the sampled data from the analog input lines. Find a functional description in section oszi.

Licence: GPLv3, Copyright 2014-2023 by Thomas{ doT ]Freiherr[ At ]gmx[ DoT }net

Compile by: fbc -w all oszi.bas

Since
0.0

Definition in file oszi.bas.

Function Documentation

◆ main()

int main ( )

The main function.

Definition at line 134 of file oszi.bas.

Here is the call graph for this function:

Variable Documentation

◆ col

UInt32 col[...]
Initial value:
= {
, RGBA(255, 0, 0, 255)
, RGBA( 0, 255, 0, 255)
, RGBA( 0, 0, 255, 255)
, RGBA(255, 255, 0, 255)
, RGBA(255, 0, 255, 255)
, RGBA( 0, 255, 255, 255)
, RGBA(127, 127, 127, 255)
}

The colors for the lines (= channels).

Definition at line 45 of file oszi.bas.

◆ last

UInt32 last[...]
Initial value:
= {
0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
}

The previous data of the channels.

Definition at line 58 of file oszi.bas.

◆ p

VAR p = INSTR(COMMAND, "x")

The position of the 'x' character (if any).

local pointer to the samples

Definition at line 27 of file oszi.bas.