That's mostly the same code any Arduino example uses with that sensor. Converting that sketch probably won't work at the moment. I've looked through the Axoloti firmware and didn't find any function similar to the delayMicroseconds().
Arduino promotes a lot of bad practice in my opinion. DelayMicroseconds() burns away time without making it available to other processes. Arduino does not have "threads". Fine for simple things but unsuitable for more complex things.
There is chThdSleepMicroseconds but this is not the right approach. To get more or less deterministic timing at microsecond level it 'd require to use the highest priority level.
The right way to do it, is to use a hardware timer to produce the start trigger pulse and measure the incoming pulse length, without using any processor cycles for the time measurement. But these sort of tricks are hard to abstract from the underlying hardware, the full documentation of all the timers spans over 180 pages in the processor reference manual.
Anyway, those sharp IR distance sensors are way better than ultrasonic distance sensors, the ultrasonic sensor will have a slow update rate, and likely disturbed by nearby sound sources.
hej janvantomme! Is your book already available? I'm trying to connect a simple physical button to toggle mod_Organs simpleLooper Patch and I just can't figure it out. I'm sure it very basic knowledge and probably covered in there.
ah and just to make it clear, its rather a question of what to do in the patch. So far I used gipo/digital/in and connected it to a disp/kscope 128p trig, but it doesn't show whether the button is pushe or not. (in arduino it works withe the hardware connections). Apparently I also can't just change the ctr/toggle to a digital in. I can turn it into a ctr/button but still i can't map that to the digitil/in. also tried the convert a to b...
I'm still writing the chapter on connecting LEDs, buttons and sensors, so it's not covered in the book yet. This chapter will be available by the end on January.
The kscope and scope objects are useful to display waveforms, not to see if a button is pushed. You can use a disp/bool object for this. The mode of the gpio/in/digital object should be set to pulldown.
Ah! thanks!! Apparently I also can't just change the ctr/toggle to a digital in. I can turn it into a ctr/button but still i can't map that to the digitil/in. also tried the convert a to b... sorry to bother with stupid basic questions. but I'll definitely get your book!
Ultrasonic distance sensors might work, but they will require a script or custom object.
PIR motion sensors may be handy when you use Axoloti as a standalone interactive audio installation, but don't have any value when using it as an instrument, since they only act as a pushbutton when motion is detected.
Talking about sensors, I'm also thinking about creating a clock from my heart beat. The simplest way I've found (unless someone tells me it wouldn't work), would be using this pulse sensor plugged into an analog Gpio and filtered / converted into a square wave LFO using a simple ">c" object.
Does anyone see anything that could go wrong is the component and simple interfacing (directly into the Gpio's, sometimes with resistors) with the axoloti board ?
For the SpectraSymbol position sensing ribbon, check this thread https://sebiik.github.io/community.axoloti.com.backup/t/softpot-ribbon-controller/902/3 it's actually duo-touch if you wire it up the right way. The Interlink pressure sensor, I belief is a common component in keybeds to sense channel pressure. The Doepfer ribbon is also a stack of the SpectraSymbol ribbon and the Interlink FSR I believe. The accelerometer looks fine too. In terms of interaction, gyroscopes are more interesting than accelerometers, but that is just my opinion, consider a 3 axis accelerometer + 3 axis gyro sensor module, though it seems those modules do not have analog outputs but need to be interfaced through SPI or I2C. The pulse sensor, the way they soldered wires to that board (on surface mount pads) looks fragile to me, stress on the wires could easily lift the solder pads from circuit board, so handle with care. Other than that, looks great.
Thanks a lot Johannes, I now understand the double touch trick, very interesting indeed and well more than I expected. I also saw that the pulse sensor looked a bit fragile, but I can see myself solidifying it as well as attaching the wire to some ear piece so that the weight of it doesn't pull my ear off (I need to keep my hands free). Anyway, I think October will be a augmented sensor month for me, if I don't waste too much of my time in fire wood cutting (winter is approaching).
i used four softpots for my bass-guitar like midi controller. see below... i also wired them in double touch, but only measure the "top" position. that way i can do hammer on and pull offs like on a real bass...
Great project lokki, must be a blast to play I just received my softpot today, so I'll be testing it, while trying to understand the maths in @johannes demo axoloti patch. I read about some people that damaged the ribbon by miss wiring it somehow. Does anyone know what I must NOT do ?
it is a blast, i'm still exploring all the possibilities! it's so reactive to touch (the fsr side) just great to modulate sounds. i will post soundsamples at some point, made with the axoloti of course! regarding your question, i did read those comments as well. i think they mostly concern the round softpots (look like a pot) and the standard wiring with ground and v+ on the outer terminals and reading in the middle. if you would press the softpot both in maximum and minimum position, you could create a "short" and the pot would heat up. this will not happen with the wiring i and johannes use.
Hi ... I'm thinking of using the Sharp GP2Y0A60SZ which I can't tell if this is the one you are connecting there. Its specs claim that a range of 10-150 cm .... Are you using a specially tuned object to interpret the signal in the Axoloti patcher? Any further advice on using this analog distance sensor? Thanks for sharing your project
there are basically two different methods to wire a soft pot to measure position, either you connect 5v and ground to the outer two connectors and measure at the middle point, or you do it this way: