PDA

View Full Version : How to use adc0831 chip for BS2?



TonyA
08-07-2005, 03:13 AM
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

Jon Williams
08-07-2005, 04:22 AM
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

Jon Williams
08-07-2005, 06:29 AM
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