Shop OBEX P1 Docs P2 Docs Learn Events
declaring variables — Parallax Forums

declaring variables

RosthstlRosthstl Posts: 2
edited 2009-10-07 01:29 in BASIC Stamp
Hi all; I'm new to this and having read What's a Microcontroller and searching the forums, I'm still stumped.
I have a basic stamp 2 with a serial 4x20 lcd. I've got the lcd to read and backlight etc. and I've got 2 led's
to light alternately. But, I cannot get the pin outputs to show on the lcd.
When led 1 lights, I want the lcd to read ' LED NUMBER·· *· IS ON'· when led 2 lights I want the number on the lcd to change reflecting the led change. I've tried IN1, OUT1, PIN1, IF THEN, If I define lednum as a CON then that is the only number that shows on the lcd. I've attached what I have already. Any help is appreciated.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-10-06 22:41
    You can't define lednum1 and 2 as constants and then treat them as variables. The stamp editor has a help file that will explain how to assign variables.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • RosthstlRosthstl Posts: 2
    edited 2009-10-06 23:02
    Thank you Stephen,
    But, because led1 and led2 are output pins wouldn't they be constants? and lednum, because it changes, would be a Var.?
  • $WMc%$WMc% Posts: 1,884
    edited 2009-10-07 01:29
    Rosthstl

    led1 PIN 1
    led2 PIN 2

    not

    led1 CON 1
    led2 CON 2


    try this

    ____$WMc%___

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Truth is out there············································ BoogerWoods, FL. USA
Sign In or Register to comment.