![]() Looking at your code, it appears to be quite simple. This is not directly related to your question, but it addresses theĬriticism you received for posting too large a program. Lower the detection threshold (your total constant) until you are at Make the pads as big as practically possible Make sure both you and the Arduino are properly grounded There are a few things you can do to increase the sensitivity though: Setup, as we are talking about fractions of a picofarad. “from at least a few inches away” is probably impossible with this You have to realize that you are trying to measure tinyĬapacitances, which is not completely trivial. If(yes10 = true & previous10 = false & c) We will only be using Minim to play music and sound effects. Apply sound effects in real time to sound files. via a microphone) sounds and store them in files. If(yes11 = true & previous11 = false & b) Minim is a sound library that comes with Processing, and with it you can do the following sorts of things: Play many different kinds of sound files, including MP3s. If(yes12 = true & previous12 = false & a) Long total13 = cs_2_3.capacitiveSensor(sensor) Long total14 = cs_2_4.capacitiveSensor(sensor) Long total15 = cs_2_5.capacitiveSensor(sensor) Long total16 = cs_2_6.capacitiveSensor(sensor) Long total17 = cs_2_7.capacitiveSensor(sensor) Long total18 = cs_2_8.capacitiveSensor(sensor) Long total19 = cs_2_9.capacitiveSensor(sensor) Long total110 = cs_2_10.capacitiveSensor(sensor) Long total111 = cs_2_11.capacitiveSensor(sensor) Long total112 = cs_2_12.capacitiveSensor(sensor) #define replay 40 //define debouncing, high value will increase stability while increasing response timeĬapacitiveSensor cs_2_12 = CapacitiveSensor(2,12) // 2.2M resistor between pins 2 & 12, pin 2 is send pin, pin 12 is sensor pinĬapacitiveSensor cs_2_11 = CapacitiveSensor(2,11) // 2.2M resistor between pins 2 & 11, pin 2 is send pin, pin 11 is sensor pinĬapacitiveSensor cs_2_10 = CapacitiveSensor(2,10) // 2.2M resistor between pins 2 & 10, pin 2 is send pin, pin 10 is sensor pinĬapacitiveSensor cs_2_9 = CapacitiveSensor(2,9) ĬapacitiveSensor cs_2_8 = CapacitiveSensor(2,8) ĬapacitiveSensor cs_2_7 = CapacitiveSensor(2,7) ĬapacitiveSensor cs_2_6 = CapacitiveSensor(2,6) ĬapacitiveSensor cs_2_5 = CapacitiveSensor(2,5) ĬapacitiveSensor cs_2_4 = CapacitiveSensor(2,4) ĬapacitiveSensor cs_2_3 = CapacitiveSensor(2,3) Ĭs_2_12.set_CS_AutocaL_Millis(0xFFFFFFFF) //Calibrate the sensor.Ĭs_2_11.set_CS_AutocaL_Millis(0xFFFFFFFF) Ĭs_2_10.set_CS_AutocaL_Millis(0xFFFFFFFF) Ĭs_2_9.set_CS_AutocaL_Millis(0xFFFFFFFF) Ĭs_2_8.set_CS_AutocaL_Millis(0xFFFFFFFF) Ĭs_2_7.set_CS_AutocaL_Millis(0xFFFFFFFF) Ĭs_2_6.set_CS_AutocaL_Millis(0xFFFFFFFF) Ĭs_2_5.set_CS_AutocaL_Millis(0xFFFFFFFF) Ĭs_2_4.set_CS_AutocaL_Millis(0xFFFFFFFF) Ĭs_2_3.set_CS_AutocaL_Millis(0xFFFFFFFF) #define sensor 1 //define number of samples Arduino takes, high value will increase stability while increasing response time #define total 30 //define sensitivity, high value for decreases sensitivity, low value increases MyPort = new Serial(this, portName, 115200) String portName = "/dev/cu.usbmodem1411" //Change COM48 to the port number that your Arduino is connected, you can check the port number from arduino program. String val // Data received from the serial port Serial myPort // Create object from Serial class I've posted the schematic and code for Arduino and Processing below. I want it to start detecting my finger from at least a few inches away. Even after using a 10M ohm resistor, my program is only responding when I'm touching the electrodes. I went according to my design and tried it out. Return mouseX > pos.x & mouseX pos.y & mouseY < pos.I've made use of the cap sense library in Arduino to make a touch less piano. Player_1 = minim.loadFile("emotional_rescue.mp3") ![]() Player_2 = minim.loadFile("down_in_the_hole.mp3") I made this very stupid example, is it any help? It is stupid, specially the button class and event handling, but as I don't know which RadioButtons you are using I putted those lines together. If(mouseX>695 & mouseX 106 & mouseY 695 & mouseX 106 & mouseY height-60)Īt the moment both sounds play at the same time. Draw the image to the screen at coordinate (0,0) Player_2 = minim.loadFile("soun2d2.wav") R = new RadioButtons(radioNames.length, 20,700,50,30, HORIZONTAL) When button 1 press I want sound 1 played when button 2 pressed i want only sound2 played.
0 Comments
Leave a Reply. |