Hi there, How can I connect sensors with Axoloti? Will I need some extra components? Resistors, capacitors, etc? I would like to connect it to a joystick, a light resistor and a potenciometer, and this: https://www.adafruit.com/products/164
Assuming that you know how protoboards work in themselves (i e rows connected). If not, google it. The connections of the protoboard <> axoloti is that the axoloti is probably expected to sit on a long or several pin headers going vertically all way down of all rows. That way it is easy to setup prototype circuits on the protoboard, as well as the axoloti core board being easy to remove if needed.
Pin headers exists in different sizes/formats and looks like:
Yeah the sketch in this link http://www.axoloti.com/examples/general-input-and-output/ assumes a long pinheader on the bottom of Axoloti Core. The advantage of this setup is that it avoids a dozen jumper cables between a circuit board and solderless breadboard (common approach with Arduino), those jumper cables jump out when you look away. And it is easy to separate and reconnect Axoloti to the solderless breadboard.
But male pinheaders on the bottom is just one option. Female pinheaders on the top, tiny screw terminals, or a board-to-wire connectors are also possible. That's why I left the GPIO pads unpopulated.
So what is still needed is simple and clear diagrams of how to connect common components like potentiometers, ldr's, leds, switches etc, to the Axoloti GPIO's. Anyone cares to sketch this out and bundle all information? Thanks!
I've planned to write about buttons/switches, potentiometers, distance sensors and joystick buttons in chapter 6 of my book. Should be available in January 2016.
I'm trying to get the hc-sr04 sensor to work, but no luck so far.
Looking at how it works with Arduino, I think the patch is going to need a custom script. Don't think there is any other option. Haven't figured out how the script code fully works since there is no API documentation.
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 ?