Lookup table or Math?


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Dec 2003
    Location
    Storrs, Ct.
    Posts
    91


    Did you find this post helpful? Yes | No

    Default Thanks Ace!

    Thanks for the quick reply. After reading your post I took a closer look at the data I am sending to the serial window. I see that while the volume increases the gain setting is also increasing up to 65531 and then overruns to "0". From there up to full volume the gain numbers track as expected if divided by 10.

    Left = 188
    Right = 188
    Gain = 65516
    Left = 189
    Right = 189
    Gain = 65521
    Left = 190
    Right = 190
    Gain = 65526
    Left = 191
    Right = 191
    Gain = 65531
    Left = 192
    Right = 192
    Gain = 0 HERE!!!!!!!!!!!!!!!!!!!
    Left = 193
    Right = 193
    Gain = 5
    Left = 194
    Right = 194
    Gain = 10
    Left = 195
    Right = 195
    Gain = 15
    Left = 196
    Right = 196
    Gain = 20
    /////////////////////////////////////////////////////////
    \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\
    Left = 253
    Right = 253
    Gain = 305
    Left = 254
    Right = 254
    Gain = 310
    Left = 255
    Right = 255
    Gain = 315

    This tells me that I need to send the remainder of (65536 - gain) up to gain = 0 and then send the actual gain value/10.

    I think.

    Am I on the right track?
    "It will never happen here!" just happened here.
    My thoughts and prayers for Sandy Hook victims and families.

  2. #2
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Smile

    Yes,
    remember: PBP up to 2.47 couldn't calculate with negative numbers.

    Check out the twos-complement for negative numbers,
    check the MSB of the result and get the twos-complement of the result, print a "-" in front and print the rest of the result.
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  3. #3
    Join Date
    Dec 2003
    Location
    Storrs, Ct.
    Posts
    91


    Did you find this post helpful? Yes | No

    Talking Thanks,

    Thanks for the reply.
    My brain is starting to hurt.

    I'll work on this for a while and get back with my results.

    Was that up to and including PBP2.47 for the negative numbers?
    Thanks again for the help.
    "It will never happen here!" just happened here.
    My thoughts and prayers for Sandy Hook victims and families.

Similar Threads

  1. Lookup table syntax.....
    By TerdRatchett in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th May 2009, 04:45
  2. Lookup Table
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 11th March 2008, 10:38
  3. problem with USART
    By leemin in forum Serial
    Replies: 4
    Last Post: - 11th December 2006, 17:56
  4. Need help with lookup table or direct calculation
    By nverma in forum mel PIC BASIC Pro
    Replies: 24
    Last Post: - 11th October 2006, 18:27
  5. Real Time Clock & Eeprom
    By smart_storm in forum General
    Replies: 8
    Last Post: - 17th February 2006, 19:03

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