Shop OBEX P1 Docs P2 Docs Learn Events
need help UV exposure controller its almost finished — Parallax Forums

need help UV exposure controller its almost finished

Tony_tsiTony_tsi Posts: 98
edited 2011-10-04 18:23 in Robotics
I am building a uv exposure I am almost finished.

here is a video explaining my problems.

http://www.youtube.com/watch?v=FpWVMd4as58&feature=channel_video_title

thanks for your help!

Comments

  • Tony_tsiTony_tsi Posts: 98
    edited 2011-10-02 14:26
    I almost forgot to post the code!
  • RDL2004RDL2004 Posts: 2,554
    edited 2011-10-04 16:02
    The problems you have with the LCD display are because of the way they work. Once a character is written to a specific location, it stays there until over-written. That's why you get the extra % sign when it changes from 2 digits to 1 digit. You either have to write a space over the extra %, or send the leading zero manually when your number is in the 0-9 range.
    This is what's happening...
    1%
    2%
    ...
    8%
    9%
    10%
    9%%
    8%%
    

    I don't know that much about the propeller, but I'v used LCDs a lot with Stamps, the formatting can give you headaches until you understand what's going on.

    If you are using an object to send data to the LCD maybe it has a way to force the digits to a fixed number of decimal places.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2011-10-04 16:23
    Tony_tsi,

    Welcome to the forum!!!

    On your lines that display the numbers, just place a simple condition... for example...
        lcd.str(num.dec(time_m))
    

    ... becomes ...
        if time_m < 10
           lcd.str(string("0")) 
        lcd.str(num.dec(time_m))
    


    ... similar for this line...
        lcd.str(num.dec(time_s))
    

    ...change it to ...
        if time_s < 10
           lcd.str(string("0")) 
        lcd.str(num.dec(time_s))
    


    As far as your question to use the RTC or the Propeller counter. This depends on your personal preference. For this application, the Propeller counter will be accurate enough, but again, that's your decision.

    One COG versus two or more... again this is a personal preference, neither will affect the accuracy. Since the Propeller Counter is finite across one COG or many COGs the timing should not be affected for this application.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-10-04 18:23
    Tony,

    The two links to LCDs are to the same item. Did you mean for one of the links to point to a different LCD?

    Have you seen Rayman's color LCDs with touchscreen?

    The price of the breakout board is about the same as the one you linked to and does a whole lot more. I have a couple of Rayman's touchscreens and really like them. They are more complicated to interface with than the serial display you're using but the are so much cooler.

    Duane
Sign In or Register to comment.