diff --git a/Debug/beaglebone-cpp-PWM b/Debug/beaglebone-cpp-PWM index 8f33805..24fcbcd 100755 Binary files a/Debug/beaglebone-cpp-PWM and b/Debug/beaglebone-cpp-PWM differ diff --git a/Debug/cPWM.o b/Debug/cPWM.o index f1145e4..9fb8eb3 100644 Binary files a/Debug/cPWM.o and b/Debug/cPWM.o differ diff --git a/Debug/main.o b/Debug/main.o index c4e7249..a7303b2 100644 Binary files a/Debug/main.o and b/Debug/main.o differ diff --git a/Debug/makefile b/Debug/makefile index 01a83ce..042e460 100644 --- a/Debug/makefile +++ b/Debug/makefile @@ -46,13 +46,19 @@ beaglebone-cpp-PWM: $(OBJS) $(USER_OBJS) arm-linux-gnueabihf-g++ -L/usr/arm-linux-gnueabihf/lib -o "beaglebone-cpp-PWM" $(OBJS) $(USER_OBJS) $(LIBS) @echo 'Finished building target: $@' @echo ' ' + $(MAKE) --no-print-directory post-build # Other Targets clean: -$(RM) $(C++_DEPS)$(OBJS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) beaglebone-cpp-PWM -@echo ' ' +post-build: + -@echo 'copy binary over to beaglebone' + -scp /home/claus/workspace/beaglebone-cpp-PWM/Debug/beaglebone-cpp-PWM beaglebone.local: + -@echo ' ' + .PHONY: all clean dependents -.SECONDARY: +.SECONDARY: post-build -include ../makefile.targets diff --git a/main.cpp b/main.cpp index 5860005..b1389de 100644 --- a/main.cpp +++ b/main.cpp @@ -7,6 +7,7 @@ */ #include "cPWM.h" #include +#include using namespace std; int main() @@ -20,13 +21,12 @@ int main() a[i] = new cPWM::cPWM(i); } - a[0]->DutyA(100); - a[0]->DutyB(150); - a[0]->Period(120); + a[0]->Period(20000000); + a[0]->DutyA( 1000000); a[0]->Polarity(1); a[0]->Run(); - a[0]->DutyB(160); - a[0]->DutyA(231); + usleep(100000); //pausa de 0.1s=100,000us + a[0]->DutyA( 1500000); a[0]->Stop(); for (int i=0; i<3; i++) {