LOOKUP2 please help


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Perhaps something like this ...
    Code:
    Freq        var word
    say         var byte
    countera    var byte
    PlayButton  var PORTB.7
    SoundOut    var PORTA.0
    
    loop:
        If PlayButton = 0 THEN 
          For countera = 0 to 70                ; Siren UP
              Gosub PlayTone
              if PlayButton = 1 then ButtonUp
          Next countera 
    
          For countera = 69 to 1 step -1        ; Siren Down
              Gosub PlayTone
              if PlayButton = 1 then ButtonUp
          Next countera 
        endif
     ButtonUp:
        Pause 50  
    goto loop 
    
    PlayTone:
        LOOKUP2 CounterA,[902,902,902,884,884,884,851,851,835,820,820,806,806,_
        792,778,765,752,740,740,716,716,705,705,683,683,653,663,663,644,635,_
        618,627,602,594,578,578,557,564,549,531,531,519,513,501,492,475,465,_
        465,456,442,434,422,414,406,389,389,373,373,352,334,329,318,307,296,_
        283,279,263,252,249,238,232],Freq
    
        For say=1 to 25
          High SoundOut
          PauseUS Freq
          Low SoundOut
          PauseUS Freq
        Next say
    Return
    DT

  2. #2
    Join Date
    Apr 2009
    Posts
    29


    Did you find this post helpful? Yes | No

    Default thanks for help

    Thanks Darrel I have done slightly different way I will post it in few days may be usefull to some body

Similar Threads

  1. need help! to beginner
    By emilhs in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 6th May 2009, 18:44
  2. Kind of "customisable" LOOKUP(2), possible?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th May 2009, 19:45
  3. lookup2?
    By jonas2 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 28th February 2009, 12:26
  4. Lookup2 & Lookdown2
    By saladlee in forum Serial
    Replies: 1
    Last Post: - 4th February 2008, 20:41
  5. PIC 16F84A and 7segment LED dispay
    By select in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 21st November 2007, 21:01

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