When you need to make very tiny measurements, even noise in closed relays can throw you off. [Marco]...
seen from South Africa
seen from United States
seen from Netherlands
seen from Malaysia
seen from United States

seen from South Africa

seen from Netherlands
seen from Netherlands
seen from China
seen from United States

seen from United States

seen from United States

seen from United States
seen from United States

seen from Singapore

seen from Israel
seen from United Kingdom
seen from Israel

seen from Venezuela
seen from Canada
When you need to make very tiny measurements, even noise in closed relays can throw you off. [Marco]...
When you need to make very tiny measurements, even noise in closed relays can throw you off. [Marco]...
The global market for Automotive Control Panel is projected to reach US$129.4 billion by 2025, driven by electronification and electrification trends, and the resulting increased interactions in a connected semi-autonomous car. Intuitive and safe automotive controls are gaining significant importance in automobile designs. An adroit balance of usability, performance and safety are key features for vehicle interfaces that need to be balanced for a successful control system design. Today, the key selling point for auto OEMs is performance of the electronics, unlike earlier when a car’s road performance took precedence. The transition to motorized controls increases the importance of automotive control systems. The growing proliferation of touchscreen vehicle head units and center console units has created a safety challenge for OEMs. Automotive touchscreens have hit the peak of inflated expectations in their hype cycle, driven mostly by vendor assisted marketing and promotional strategies. Emerging signs of the technology being a failure in cars indicates that touchscreens are heading towards the trough of disillusionment where inflated expectations begin to die down. The scenario creates a tipping point for the traditional keyboard based systems. Interestingly, major reasons that make touchscreens a distraction in an automobile are also the same reasons why physical controls and control panel units are making a comeback. Few of the disadvantages of automotive touchscreens include high distraction index; lack of tactile feedback requires the driver to look at the touchscreen; necessitates the driver to take eyes off the road compounding the risk of accidents; longer cognitive processing for image based interfaces; requires multiple steps to complete a single operation; lower driver performance and higher task completion times; difficult to use and beset with a steep learning curve. More number of cars in the coming years will therefore come out with touchscreens embedded alongside a set of fixed, physical buttons. Read More…
Rotary switch for adjusting loop length in VirtualDJ
Here are the definition and mapping files which take the MIDI notes from this sketch and uses them to set the length of the auto-loop on Deck 1. Lengths are (in beats): 16, 8, 4, 1, 1/2, 1/4, 1/8, 1/16. These are defined in decimals in the Mapping file.
Initially I was using loop_length to define the length of the loop, but this wouldn’t show the length in the UI until Auto Loop was activated. I then discovered loop_select, which is more aligned with what I wanted to do, and does update the length in the Loop section on the skin:
Definition:
<device name="Teensy MIDI" author="TS" description="Teensy MIDI Teensy MIDI Rot Switch MIDI02" version="800" type="MIDI" singledeck="yes" padColumns="1" padRows="1" padSides="1" motor="no" decks="1" drivername="Teensy MIDI" vid="0x16C0 " pid="0x0485"> <button note="0x3c" name="LoopSel00" deck="1" channel="0" /> <button note="0x3e" name="LoopSel01" deck="1" channel="0" /> <button note="0x40" name="LoopSel02" deck="1" channel="0" /> <button note="0x41" name="LoopSel03" deck="1" channel="0" /> <button note="0x43" name="LoopSel04" deck="1" channel="0" /> <button note="0x45" name="LoopSel05" deck="1" channel="0" /> <button note="0x47" name="LoopSel06" deck="1" channel="0" /> <button note="0x48" name="LoopSel07" deck="1" channel="0" /> </device>
Mapping:
<?xml version="1.0" encoding="UTF-8"?> <mapper device="Teensy MIDI" version="802" date="2018-05-05"> <map value="LoopSel00" action="loop_select 16" /> <map value="LoopSel01" action="loop_select 8" /> <map value="LoopSel02" action="loop_select 4" /> <map value="LoopSel03" action="loop_select 1" /> <map value="LoopSel04" action="loop_select 0.5" /> <map value="LoopSel05" action="loop_select 0.25" /> <map value="LoopSel06" action="loop_select 0.125" /> <map value="LoopSel07" action="loop_select 0.0625" /> </mapper>
Rotary switch to MIDI code
This sketch reads 8 of the pins on the rotary switch via a mux, and sends note on/off messages depending which pin is active. I’ve also started thinking about how all these pieces of code will work together, which is why the functions to send the data are now very generic - hopefully I can call it for any of the note on/off inputs, and make an adapted one for sending MIDI CC.
Rot_Switch_Test_MIDI03
/****************************************************************************** Hacked together by Thomas S May 2018 For Teensy 3.2 plus 74HC4051 mux 8x pins of a 10-position rotary switch attached to 10K pullups (to ground)
Also including MIDI code from here https://ask.audio/articles/how-to-build-a-simple-diy-usb-midi-controller-using-teensy
Mux_Analog_Input SparkFun Multiplexer Analog Input Example Jim Lindblom @ SparkFun Electronics August 15, 2016 https://github.com/sparkfun/74HC4051_8-Channel_Mux_Breakout
This sketch demonstrates how to use the SparkFun Multiplexer Breakout - 8 Channel (74HC4051) to read eight, separate analog inputs, using just a single ADC channel.
Hardware Hookup [EDITED FOR TEENSY]: Mux Breakout ———– teensy S0 ——————- 0 S1 ——————- 1 S2 ——————- 2 Z ——————– 3 VCC ——————- 3.3V GND ——————- GND (VEE should be connected to GND) Rotary switch: Common pin --- 3.3V Output pins --- inputs on mux --- 10K resistor to GND
The multiplexers independent I/O (Y0-Y7) can each be wired up to a potentiometer or any other analog signal-producing component.
Development environment specifics: Arduino 1.6.9
SparkFun Multiplexer Breakout - 8-Channel(74HC4051) v10 (https://www.sparkfun.com/products/13906) Rotary switch https://nz.rs-online.com/web/p/rotary-switches/8779883/ ******************************************************************************/
#include <C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\MIDI\MIDI.h> #include <midi_Defs.h> #include <midi_Message.h> #include <midi_Namespace.h> #include <midi_Settings.h>
const int MaxNoPins = 8; //total number of switchable pins from rotary switch int pinState[8]; //array to store state of each pin int pinCurrent; //pin currently being checked
const int MIDI_CHAN = 1; //set MIDI channel const int MIDI_NOTES[MaxNoPins] = {60, 62, 64, 65, 67, 69, 71, 72}; // C4 D4 E4 F4 G4 A4 B4 C5 const int MIDI_NOTE_VEL = 100;
//variables to store current MIDI message data int sendNOTE; int sendVEL; int sendCHAN;
const int selectPins[3] = {0, 1, 2}; // S0~2, S1~3, S2~4 const int zInput = 3; // Connect common (Z) to 3 (digital input)
void setup() {
for (int i=0; i<3; i++) //set up mux channel select pins { pinMode(selectPins[i], OUTPUT); digitalWrite(selectPins[i], HIGH); }
pinMode(zInput, INPUT); // Set up Z as an input
for (int i=0; i<MaxNoPins; i++) //set all pin states as LOW to start { pinState[i] = 0; }
Serial.begin(9600); // Initialize the serial port
}
void loop() { for (pinCurrent=0; pinCurrent<MaxNoPins; pinCurrent++) //cycle through all pins attached to the mux { check_send(); } while(usbMIDI.read()); //discard incoming MIDI messages }
void check_send (){ //check each pin, send MIDI note change if the pin state has changed selectMuxPin(pinCurrent); // Select one pin at a time int inputValue = digitalRead(zInput); // and read Z { if (inputValue != pinState[pinCurrent]) //if pin state has changed { if(inputValue == HIGH) //if pin is HIGH { sendNOTE = MIDI_NOTES[pinCurrent]; sendVEL = MIDI_NOTE_VEL; sendCHAN = MIDI_CHAN; sendnoteON(); } else //if pin is not HIGH { sendNOTE = MIDI_NOTES[pinCurrent]; sendVEL = 0; sendCHAN = MIDI_CHAN; sendnoteOFF(); } } pinState[pinCurrent] = inputValue; //set new state for current pin } }
void selectMuxPin(byte sPin) //write to select pins to select mux pin to read from { for (int i=0; i<3; i++) { if (sPin & (1<<i)) digitalWrite(selectPins[i], HIGH); else digitalWrite(selectPins[i], LOW); } }
void sendnoteON() { usbMIDI.sendNoteOn (sendNOTE, sendVEL, sendCHAN); Serial.print(pinCurrent); Serial.print(" ON \t"); Serial.print(sendNOTE); Serial.print(" "); Serial.print(sendVEL); Serial.print(" "); Serial.println(sendCHAN); }
void sendnoteOFF(){ usbMIDI.sendNoteOff (sendNOTE, sendVEL, sendCHAN); Serial.print(pinCurrent); Serial.print(" OFF \t"); Serial.print(MIDI_NOTES[pinCurrent]); Serial.print(" "); Serial.print("0"); Serial.print(" "); Serial.println(MIDI_CHAN); }
Electronics setup for testing the rotary switch.
A ribbon cable connects to the rotary switch - red is VCC, and the rest are the output pins 1-9 (the ribbon cable is only 10-pole).
Each output pin has a 10K pullup resistor to GND. They are then also connected via jumpers to the inputs on the multiplexer ( SparkFun Multiplexer Breakout - 8 Channel (74HC4051) ). The mux is then connected to VCC, GND, and the Teensy as described in the comments of the code.
The green blocks are screw terminals which kinda fit into the breadboard, but don’t really stay so it’s all a little bit flaky. To prevent this, I’d ideally have crimped some nice headers onto the ribbon cable but couldn’t find any ferrels lying around. However, everything works well enough to prove the concept.
Auto loop length select using a rotary switch
Find Great Deals on illuminated Push Buttons & Push Button Switches, illuminated rocker switch &non-illuminated push buttons, rotary switch, indicator lights &more
A wide selection of illuminated push button switch, including miniature and ultra-miniature varieties. Powerjet parts Products is able to supply a range of illuminated rocker switch and indicators, including pushbutton, illuminated pushbutton, toggle, rocker, miniature, rotary, limit, proximity, foot and snap action. Shop industrial illuminated push button switch and push button switches at Powerjet parts. Your source for high-quality push buttons, switches, LED indicator lights and more. Contact us- +1 (702) 641-3500