Skip to content

Commit

Permalink
Added pause
Browse files Browse the repository at this point in the history
  • Loading branch information
clausqr committed Jun 14, 2012
1 parent d8b59f2 commit ed362e1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
Binary file modified Debug/beaglebone-cpp-PWM
Binary file not shown.
Binary file modified Debug/cPWM.o
Binary file not shown.
Binary file modified Debug/main.o
Binary file not shown.
8 changes: 7 additions & 1 deletion Debug/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
#include "cPWM.h"
#include <iostream>
#include <unistd.h>
using namespace std;

int main()
Expand All @@ -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++)
{
Expand Down

0 comments on commit ed362e1

Please sign in to comment.