driver rename
This commit is contained in:
parent
7a1efabe49
commit
281a00ddc0
35 changed files with 0 additions and 0 deletions
30
control/examples/pegel/Makefile
Normal file
30
control/examples/pegel/Makefile
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Name: Makefile
|
||||
# Project: B15F (board15 Famulus Edition)
|
||||
# Author: Tristan Krause
|
||||
# Creation Date: 2019-05-15
|
||||
|
||||
# Environment
|
||||
COMPILER_PATH = g++
|
||||
|
||||
# Options
|
||||
CFLAGS = -std=c++17 -O3 -Wall -Wextra
|
||||
LDFLAGS = -lb15fdrv
|
||||
OBJECTS = main.o
|
||||
OUT = main.elf
|
||||
|
||||
COMPILE = $(COMPILER_PATH) $(CFLAGS)
|
||||
|
||||
main: $(OBJECTS)
|
||||
$(COMPILE) $(OBJECTS) -o $(OUT) $(LDFLAGS)
|
||||
|
||||
help:
|
||||
@echo "This Makefile has the following targets:"
|
||||
@echo "make main .... to compile"
|
||||
@echo "make clean ... to delete objects and executables"
|
||||
|
||||
clean:
|
||||
@echo "Cleaning..."
|
||||
rm -f $(OBJECTS) $(OUT)
|
||||
|
||||
.cpp.o:
|
||||
$(COMPILE) -c $< -o $@
|
13
control/examples/pegel/gnuplotscript.gp
Normal file
13
control/examples/pegel/gnuplotscript.gp
Normal file
|
@ -0,0 +1,13 @@
|
|||
set margin 10,10
|
||||
unset key
|
||||
set grid
|
||||
set title ''
|
||||
set xlabel 'U_{OUT} [V]'
|
||||
set ylabel 'U_{IN} [V]'
|
||||
set xrange [0:5]
|
||||
set yrange [0:5]
|
||||
set label at 5,5 ' [V] = 0' left
|
||||
unset output
|
||||
set terminal qt
|
||||
unset output
|
||||
plot "/tmp/tempfile0" using ($1*0.004888):($2*0.004888) binary format="%int16%int16" endian=big title ' [V] = 0' w l
|
43
control/examples/pegel/main.cpp
Normal file
43
control/examples/pegel/main.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
#include <iostream>
|
||||
#include <cmath>
|
||||
#include <b15f/b15f.h>
|
||||
#include <b15f/plottyfile.h>
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
B15F& drv = B15F::getInstance();
|
||||
PlottyFile pf;
|
||||
|
||||
uint16_t ba[1024];
|
||||
uint16_t bb[1024];
|
||||
|
||||
const uint16_t sample_count = 1024;
|
||||
const uint16_t delta = 1;
|
||||
|
||||
pf.setUnitX("V");
|
||||
pf.setUnitY("V");
|
||||
pf.setUnitPara("V");
|
||||
pf.setDescX("U_{OUT}");
|
||||
pf.setDescY("U_{IN}");
|
||||
pf.setDescPara("");
|
||||
pf.setRefX(5);
|
||||
pf.setRefY(5);
|
||||
pf.setParaFirstCurve(0);
|
||||
pf.setParaStepWidth(0);
|
||||
|
||||
uint8_t curve = 0;
|
||||
|
||||
|
||||
drv.analogSequence(0, &ba[0], 0, 1, &bb[0], 0, 0, delta, sample_count);
|
||||
|
||||
for(uint16_t x = 0; x < sample_count * delta; x += delta)
|
||||
{
|
||||
pf.addDot(Dot(x, ba[x], curve));
|
||||
}
|
||||
|
||||
// speichern und plotty starten
|
||||
pf.writeToFile("test_plot");
|
||||
pf.startPlotty("test_plot");
|
||||
}
|
BIN
control/examples/pegel/test_plot
Normal file
BIN
control/examples/pegel/test_plot
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue