Shop OBEX P1 Docs P2 Docs Learn Events
Experiment#5: LED Graph (dot or Bar) trouble - please help — Parallax Forums

Experiment#5: LED Graph (dot or Bar) trouble - please help

rh3drh3d Posts: 14
edited 2009-02-26 04:43 in Learn with BlocklyProp
I'm following the instructions in the Stamp Works: Experiments and BASIC stamp Source Code, using BS2 RevJ
·
I have a picture of the circuit and my copied code from the book.· As I turn the 10k Pot I'm expecting the LEDs to turn on, nothing is happening.· The code loads onto the BS2 without issues, I have tried both 10K pots... I can even run my previous experiments without any issues .
·
If some can have a look at my code and attached Picture I would very much appreciate it!
·
Thanks

Comments

  • MikerocontrollerMikerocontroller Posts: 310
    edited 2009-02-23 18:20
    · Your code has the conditional compiler directive omitted.· This would make your troubleshooting easier.· If you re-insert that section of code in the Initialization routine and change the #DEFINE Testing directive so that it equals one, you'll be able to read the raw data in the debug screen.· Asswuming that you copied and pasted from the Stampworks Manual PDF, you'll probably find that the problem is in your wiring or supplied power.·Did you try a different value capacitor?
  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2009-02-23 18:24
    Hi rh3d,

    It seems in your initialization code you've set LEDs = %11111111 and you should set LEDsDirs = %11111111. Right now you're not setting the direction of the pins. When working with the BASIC Stamp, the default direction is to set all pins to inputs, and in order for the LEDs to light up, they need to be set to outputs.

    Hope this helps!

    Jessica

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jessica Uelmen
    Education Department
    Parallax, Inc.
  • rh3drh3d Posts: 14
    edited 2009-02-24 04:09
    Perfect, thank you Jessica! It works now.

    Mike, I'm actually not using a PDF, I'm copying from a book and it does not contain the "conditional compiler directive" in its example. If you have that code handy or the PDF I would love to have a look and give it a try.

    Additional Question:
    Now that this is working I am finding that my LEDs start at 11111111 when the pot is at 695 (HiScale) expected,
    when my pot is turned allmost all the way Lo at say 11 (inbetween lo -to- hi) the LEDs are 00000001, expected
    But when the pot is turned ALL the way Lo 10 LoScale the LEDs jump back to 11111111... I didn't expect this

    I am new to the coding part of electronics and I am curiouse what would be done differently to have the LEDs show 00000000 when the pot is all the way off?
  • MikerocontrollerMikerocontroller Posts: 310
    edited 2009-02-24 20:31
    rh3d, I'm glad Jessica could help you. I know that they tell you its best to hand-code all your exercises but you can find links to the PDF files for the Stamp Works experiments on the Parallax website. Look up the Stamp Works Manual and you'll find the downloadable PDF's on the same page. Since you are genuinely interested in the subject I don't feel that some copying and pasting is bad when it serves a purpose (like troubleshooting). Sorry I can't help you with the other problem because I have to go (this sounds better than "I don't know") Hint, check the raw RCTIME data.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-02-25 01:27
    The potentiometer·wiper is being physically/literally driven past the extreme of the resistance track and at that point going open-circuit.· It probably does that on the other end, too, only you don't notice it because that's your R-max end anyway.· You could confirm this with an ohmmeter (it won't be resistive, it'll be Open.)
  • rh3drh3d Posts: 14
    edited 2009-02-26 04:43
    yes, confirmed. Thanks.
Sign In or Register to comment.