Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: HIDScope QEI mbed
Revision 2:1cd28768a9bf, committed 2015-10-28
- Comitter:
- yohoo15
- Date:
- Wed Oct 28 13:03:51 2015 +0000
- Parent:
- 1:cfcd4825fe81
- Commit message:
- Need to be fine tuned;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Oct 28 11:22:08 2015 +0000
+++ b/main.cpp Wed Oct 28 13:03:51 2015 +0000
@@ -339,10 +339,10 @@
double making_setpoint(double direction)
{
if ( cw == direction) {
- setpoint = setpoint + (pulses_per_revolution/40000);
+ setpoint = setpoint + (pulses_per_revolution/400000);
}
if ( ccw == direction) {
- setpoint = setpoint - (pulses_per_revolution/40000);
+ setpoint = setpoint - (pulses_per_revolution/400000);
}
return(setpoint);
@@ -381,7 +381,7 @@
}
-/*
+
//control for the keypress
void motor_key_Controller()
{
@@ -408,7 +408,7 @@
}
-}*/
+}
/*************************************************************END motor control******************************************************************************************************/
void HIDScope_kijken()
@@ -426,12 +426,12 @@
aansturen.attach( &Go_flag_motor, 0.01f ); // 100 Hz // timer 0.00001f motor keeps spinning
- HIDScope_timer.attach(&Go_flag_HIDScope, 0.2);//0.02 had worked
+ HIDScope_timer.attach(&Go_flag_HIDScope, 0.02);//0.02 had worked
Filteren_timer.attach(&Go_flag_filteren,0.4);// 0.04 had worked
while(1) {
- pc.printf("hi here, \n");
- // led_green = 1;
- // led_red = 1;
+
+ //led_green = 1;
+ //led_red = 0;
if(Flag_filteren) {
Flag_filteren = false;
@@ -473,18 +473,18 @@
// Pussing buttons to get input signal
- if( buttoncw.read() == Buttoncw_pressed) {
+ if( left_movement) {
setpoint = making_setpoint(cw);
//led_green = 0;
}
- if(buttonccw.read() == Buttonccw_pressed ) {
+ if(right_movement ) {
setpoint = making_setpoint(ccw);
}
- // if(/*right_movement and left_movement or */buttoncw.read() == Buttoncw_pressed and buttonccw.read() == Buttonccw_pressed) {
+ if(right_movement and left_movement) {
-/*
+
setpoint_key_press = 1050;
motor_key_Controller();
@@ -494,7 +494,7 @@
}
-*/
+
}
}