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: Adafruit-PWM-Servo-Driver MPU6050 RS300 mbed
Diff: Motion.cpp
- Revision:
- 13:711f74b2fa33
- Parent:
- 12:6cd135bf03bd
- Child:
- 14:522bb06f0f0d
diff -r 6cd135bf03bd -r 711f74b2fa33 Motion.cpp
--- a/Motion.cpp Sun Feb 03 04:53:44 2013 +0000
+++ b/Motion.cpp Sun Feb 03 21:22:21 2013 +0000
@@ -2,11 +2,11 @@
#include "PWM.h"
extern Ticker tick;
-PWM pwm;
+//PWM pwm;
Motion::Motion(uint16_t** data, unsigned short int size_idx, unsigned char size_num)
{
- //pwm = new PWM();
+ pwm = new PWM();
m_data = data;
@@ -33,7 +33,7 @@
Motion::~Motion()
{
- //delete pwm;
+ delete pwm;
}
void Motion::step()
@@ -101,8 +101,7 @@
m_dd_buf[i] = 0.0;
__disable_irq();
- //pwm->SetDuty(i, (uint32_t)m_buf[i]);
- pwm.SetDuty(i, (uint32_t)m_buf[i]);
+ pwm->SetDuty(i, (uint32_t)m_buf[i]);
__enable_irq();
}
m_brake_flg = 0.0;
@@ -118,8 +117,7 @@
m_buf[i] += m_d_buf[i];
__disable_irq();
- //pwm->SetDuty(i, (uint32_t)m_buf[i]);
- pwm.SetDuty(i, (uint32_t)m_buf[i]);
+ pwm->SetDuty(i, (uint32_t)m_buf[i]);
__enable_irq();
}
}