Hello, welcome to our forum.

It looks like you have registered but you have not yet posted and messages. Our requirements are that you must post at least two messages, to allow the moderators to review your registration, before you will be allowed access to the full range of forum areas.

Please make a couple of posts, until then you may see a notice that says you are banned from certain forum areas.


Thank you.

Remove Text Formatting
Loading...

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    736

    Default how to use a variable for pulsout command

    Hi guys , is there away to use a variable for the pulsout command , or a way around the same

    eg

    time var word

    one con 1000

    time = one

    pulsout GPIO.0,time

    regards

    sheldon

  2. #2
    Join Date
    May 2004
    Location
    Le Treport 76 FRANCE
    Posts
    3,334

    Default Re: how to use a variable for pulsout command

    Hi, Sheldon

    That's exactly what you do here ...

    1) you first set a constant to 1000
    2) you set a variable equal to this constant
    3) you output signal of the variable length ...

    so, step 1) is not necessary ...


    writing

    Code:
    Time VAR Word ; create your variable
    
    Time = 1000     ; set it to 1000
    
    PULSOUT pin, Time ; output your signal
    is the shortest way ... using a variable.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    736

    Default Re: how to use a variable for pulsout command

    cheers for that

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts