And to further explain, the buttons, when pressed control the speed and direction of a motor connected to the laptop via a usb cable using the Win32::SerialPort module....that part works. What is happening when the direction button is pressed it gets faster in the forward direction and when pressed again it gets faster and faster...and when the reverse button is pressed the motor stops and proceeds to going in the reverse direction and each time that button is pressed it gets faster and faster....here is what is happening....if the forward button is pressed again....instead of starting at speed 0....it picks up where the last forward button press left off...lets say it stopped at 40 when we first pressed the reverse button....when the forward button is pressed again it goes to speed 50 instead of starting back at zero....same holds true if the reverse button was pressed again.


In reply to Re^3: Tk Buttons by PilotinControl
in thread Tk Buttons by PilotinControl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.