Australia
Asked — Edited
Resolved Resolved by DJ Sures!

How To Write A Code To Save The Servo Data As Text With Timestamps?

Hi I am trying to write a code for JD Humanoid where I can track the data coming from the servo. First I tried to write the following ode with EZ-Script. It serves my initial purpose but I also need a proper timestamp in "ddmmyyyyhhmmssffff" format. Apparently it seems that I can't do it with EZ-Script. So, I am thinking to write a similar code in Python as I can make the required timestamp formatting there. So, can anyone help me with this? Thanks.

ControlCommand("Graphy", RemoveAllSeries)

:loop

$pos0 = getservo(d0)
ControlCommand("Graphy", AddData, "Servo D0", $pos0)

$pos1 = getservo(d1)
ControlCommand("Graphy", AddData, "Servo D1", $pos1)

controlCommand("Camera", "CameraMovementTrackEnable")
ControlCommand("Graphy", AddData, "Servo D4", $pos)

FileWriteLine("c:\temp\mylog.txt", $time + ", servo D0: " + $pos0 + ", servo D1: " + $pos1)

sleep(10)

goto(loop)


Related Hardware (view all EZB hardware)
JD Humanoid by EZ-Robot
JD humanoid robot kit - WiFi-enabled, 16 DOF with metal-gear servos; easy, fun, educational, available from the EZ-Robot online store.
Wi-Fi / USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 24

Related Robot Skill (view all robot skills)
Graphy by Synthiam
Plot live data with ControlCommand scripts: multi-series charts, many chart types, legend toggle, add/remove series, export graph data to CSV

ARC Pro

Upgrade to ARC Pro

Join the ARC Pro community and gain access to a wealth of resources and support, ensuring your robot's success.

Author Avatar
Australia
#9  

Thanks a lot. Now I can extract the data just as I wanted!