Using FOR..NEXT to build a small table


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: Using FOR..NEXT to build a small table

    Hi Bob,
    You need to create an array to store the readings in, this is untested but here goes:
    Code:
    n    CON 5            ' Number of sample
    Readings VAR [n]   ' Create array of size n
    i VAR BYTE
     
    ' Get values
    For i = 0 to (n-1)        ' Take n readings 
      ADCIN 0, Readings[i]
      Pause 10
    NEXT
     
    ' Display values
    For i = 0 to (n-1)
      HSEROUT ["Reading ", #i, ": ", #Readings[i],13
    Next
    /Henrik.

  2. #2
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Using FOR..NEXT to build a small table

    Can't get my dumb phone to select for quote, but you will need a closing bracket in the hserout line after the 13. 13]
    (not henriks day for brackets )
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: Using FOR..NEXT to build a small table

    No it certainly isn't...thanks for spotting that!

  4. #4
    Join Date
    May 2006
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Re: Using FOR..NEXT to build a small table

    Henrik:

    Thanks for the reply although some delayed

    Bob

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