PWM ansteuerbar und TOP wird returned

This commit is contained in:
Tristan Krause 2019-05-28 12:32:31 +02:00
parent 1f53117577
commit 2c47159df3
78 changed files with 459 additions and 148 deletions

View 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) *.bin gnuplotscript.gp
.cpp.o:
$(COMPILE) -c $< -o $@

View file

@ -0,0 +1,14 @@
#include <iostream>
#include <cmath>
#include <b15f/b15f.h>
#include <b15f/plottyfile.h>
const char PLOT_FILE[] = "plot.bin";
int main()
{
B15F& drv = B15F::getInstance();
std::cout << "TOP: " << (int) drv.pwmSetFrequency(100000) << std::endl;
drv.pwmSetValue(40);
}