Shop OBEX P1 Docs P2 Docs Learn Events
How to use adc0831 chip for BS2? — Parallax Forums

How to use adc0831 chip for BS2?

TonyATonyA Posts: 226
edited 2005-08-06 23:29 in BASIC Stamp
Hi,

I am currently using the rctime command to read a pot with my BS2.

I notice it's going to be too slow this way.

Does anyone know of any references for using the adc0831 with the BS2 in this way? (replacing rctime, etc.)

Thanks for any info,

Tony

Post Edited (TonyA) : 8/6/2005 11:17:07 PM GMT

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-08-06 21:22
    I don't know of anyone using the ADC0831 as a MIDI controller but it is certainly possible.· The code is very simple; see attached.· Assuming your Vref and pot source are the same, you'll get an output of 0 - 255 from the ADC0831.· If you divide this by two you can use it as a MIDI note value (0 = 127).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    462 x 317 - 23K
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-08-06 23:29
    Easy:
    · 1. Read the ADC0831 -- you get a value between 0 and 255
    · 2. Divide value from step #1 by 2;·you now have a value between 0 and 127
    ····· -- use this as your MIDI note


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.