Shop OBEX P1 Docs P2 Docs Learn Events
I need help with project — Parallax Forums

I need help with project

dummie95dummie95 Posts: 1
edited 2008-08-01 02:11 in BASIC Stamp
hey im new to all of this.. just went out and bought a bs2 and am trying to do something and cant figure this out..

first it takes an input kinda like this.

lines   VAR     Nib
idx     VAR     Nib

Main:
  DEBUG CLS, "press 1any number between 1 and 5 to go on"
  DEBUGIN DEC1 lines

  IF ((lines >= 1) AND (lines <= 5)) THEN
   

  
    PULSIN 0, 1, value                          ' measure pulse input
    DEBUG DEC value, CR
    IF (value > 4000) THEN                      ' evaluate duration
      DEBUG "Value was greater than 4000"
    ELSEIF (value = 4000) THEN
      DEBUG "Value was equal to 4000"
    ELSE
      DEBUG "Value was less than 4000"
    ENDIF
    DEBUG CR, CR
    PAUSE 1000
  

                                      
  ELSE
    DEBUG CR, "Invalid entry!"                 
    PAUSE 2000                              
    GOTO Main                                  
  ENDIF


·this is just like kinda an example if ny1 could correct my code or help me out on this i would be grateful... thanks

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-08-01 02:11
    Looks good, but then I have no idea what it is you are trying to accomplish. you don't use idx and you waven't declared value and lines so it wouldn't work. Could we get more information on what you are trying to do?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.