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.
Dependents: CAN_Simple_Publisher CAN_Pub_actuator
Diff: MS9g_move_sin.cpp
- Revision:
- 3:9839ae432c26
- Parent:
- 2:3eadad0761e9
--- a/MS9g_move_sin.cpp Thu May 03 14:46:58 2018 +0000
+++ b/MS9g_move_sin.cpp Sat Jun 16 00:34:43 2018 +0000
@@ -21,7 +21,7 @@
}
void Servo_9g_Move::NextSin(){
- i += 0.1;
+ i += speed_inc;
if (i > 2) i = 0;
f = (sin(i * pi) + 1.0) / 2 + 1; //1..2
}
@@ -88,4 +88,7 @@
timer.attach(this, &Servo_9g_CAN::SendNextSin, val);
}
+void Servo_9g_CAN::sendPosition(char id, float pos){
+ can.write(CANMessage(id, (char*)&pos, sizeof(pos)));
+}
//end of class Servo_9g_CAN
\ No newline at end of file