Shop OBEX P1 Docs P2 Docs Learn Events
Tachyon newbie question re BLINKY — Parallax Forums

Tachyon newbie question re BLINKY

I have managed "Twinkle Twinkle Little Star" on your piano:
10 FOR 0 HIGH 20 ms 0 LOW 20 ms NEXT
The LED flashes... happy days!

However but when I try something a little harder such as:
:BLINKY 10 for 1 HIGH 100 ms 1 LOW 100ms NEXT;
The terminal reports back this:
...  :BLINKY  ??? 10 for  ??? 1 HIGH 100 ms 1 LOW 100ms  ??? NEXT; ???  -->  ok

It would seem that when I am issuing commands from my ESP to do something like PWM or generate tones I have to issue a series of a commands like a script rather than a single command.

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-02-17 14:20
    Remember that Forth words are delimited by spaces, so while : is a word and BLINKY could be a word, :BLINKY is not found in the dictionary. Use <colon> <space> <BLINKY> <space> etc and <NEXT> <space> <;> ;
    Tyoe WORDS to list out the dictionary and you will see : and ; have an entry. What you type can only be recognized if it is in the dictionary or it is a number, or some kind of special literal.
    BTW, taking into account that you need a space, have a look at Hello World and notice where the spaces are.
    : HELLO    PRINT" Hello World!" ;
    



    HINT: PRINT" or ." are words
  • That works Peter. So what is the capacity in the P1 for these routines? Would my ESP initialise a site of such routines into the P1 at startup?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-02-17 14:46
    You only really need to load these up once, and then you can do a BACKUP. You can also specify an autostart routine too and in fact this is how we lock in a turnkey application.

    Have a look at EXTEND.FTH source and you might be able to see where it starts up at boot, checks for any user init routines, and also starts up a background timing task in another cog etc.

    btw - try the inbuilt blinky routine and type
    0 BLINKY
    
    then speed it up
    15 HZ
    
  • MJBMJB Posts: 1,235
    pmulvey wrote: »
    I have managed "Twinkle Twinkle Little Star" on your piano:
    10 FOR 0 HIGH 20 ms 0 LOW 20 ms NEXT
    
    The LED flashes... happy days!

    However but when I try something a little harder such as:
    :BLINKY 10 for 1 HIGH 100 ms 1 LOW 100ms NEXT;
    
    The terminal reports back this:
    ...  :BLINKY  ??? 10 for  ??? 1 HIGH 100 ms 1 LOW 100ms  ??? NEXT; ???  -->  ok
    

    It would seem that when I am issuing commands from my @ to do something like PWM or generate tones I have to issue a series of a commands like a script rather than a single command.

    hi @pmulvey good to see new Tachyon users here.
    instead of having many little threads about Tachyon we have been using the thread for the current version like
    https://forums.parallax.com/discussion/167165/tachyon-neon-v5-fat32-and-ethernet-servers-in-32kb-eeprom#latest
    makes it easier to search and browse
Sign In or Register to comment.