Руслан Урядинский / MS9g_move_sin

Dependents:   CAN_Simple_Publisher CAN_Pub_actuator

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