#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2011
    Posts
    3
    Rep Power
    0

    Which module to use to record value change over time?


    Here is my task. I have a Rasberry PI connected to 2 servo-motors. I want to develop a GUI application which will contain nothing but a record button and 2 slders of Tkinter. Now what I want to do is I want to have a record button which, after being pressed will record all the value changes of the sliders over time of the app. So it will be almost like animating/automatng

    This will give me a value over time change. Now I will apply those values to the servomotor and thus they will reproduce the movement based on the recorded values over time. My question is which module do I use to do so?

    Thank you.
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,837
    Rep Power
    480
    The toplevel tkinter widgets (if a toplevel is a widget, that is) have an "after" method. The delay, as i recall, is in milliseconds. The function called by the after method could record data then reinstall itself.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    605
    Rep Power
    65
    You might have to write data to a file with a time stamp attached.
    Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2009
    Posts
    474
    Rep Power
    33
    You will first have to decide how often you want to test for a value change. Usually some experimenting gets close enough. You can then sample every 0.00X seconds, and save (however you wish) the time and the event. It does not matter if you save the clock time or the difference since the start since difference can be easily calculated. Note that Python can get time down to the micro-second on Linux, but only?? 1000th of a second on Windows. Show us some code to work with for more detailed info.

IMN logo majestic logo threadwatch logo seochat tools logo