ad pot fastest response!


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    moyejw's Avatar
    moyejw Guest


    Did you find this post helpful? Yes | No

    Default

    I'm not familiar with pbp syntax but try something like this IF...THEN statement in place of yours--

    IF RESULT[J] = ADRES THEN NoCHANGE
    CHANGE RESULT[J] = ADRES
    /calculate mididata :see below
    /send mididata
    NoCHANGE NEXT J

    To convert your AD input to proportional value between 0 and 127---
    /this is simiiar to Farenheit to Centigrade temp conversion

    You need these values from when you calibrate your pots. JCALLOW, JCALHI
    are values received @ CALIBRATE BUTTON1. BUTTON2

    JMIDIVALUE=127(ADRES - JCALLOW)/(JCALHI - JCALLOW)

  2. #2
    blainecf's Avatar
    blainecf Guest


    Did you find this post helpful? Yes | No

    Cool One more method (unless you're an octopus):

    If you make the assumption that only one pot at a time is changing (unless you're an octopus and have 8 hands on 7 pots), you could do this:

    [Pseudocode]

    1. read one pot
    2. compare to previous reading (see above threads)
    3. if a pot changes
    3a. Act on the change
    3b. (now for the assumption) Instead of advancing on to the next pot, decrement your pot pointer so that the same pot will be read again (which will cancel out step #4, below)
    4. increment your pot pointer
    5. loop to #1

    Why? If you assume one hand on a pot, once you start changing, probability suggests that you'll continue changing that pot. Assuming that that one pot is still changing, and therefore, re-reading, you'll save time NOT READING 6 other pots that, in all likelihood, are not changing!

    Regards,

Similar Threads

  1. Using the Pot command.
    By timseven in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 17th August 2009, 20:23
  2. A/D, Pot, Input, A,B So lost now....
    By Helmutt in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th March 2008, 22:23
  3. "quantizing" AD values
    By dar303 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st February 2007, 21:49
  4. Replies: 4
    Last Post: - 24th January 2007, 22:20
  5. pot controlled pwm -- help
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 29th January 2006, 12:29

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