Hello
I need to build a little basic trigger with 8 possibilities (buttons or knob) that could be hide on a wardrobe.
I think to make in with arduino. I manage to find a code (on the wiki page) to receive one value with the serial module in usine.
But it seems to me more complex if i'd like to receive several values on the same time.
Any experience ?
Thanks
JF
usine with arduino
Hi,
You can use the fonction "map" to split the analog inputs.
then in Usine, all datas between 0-1023 are coming from A0, datas between 2000-3023 are coming from A1, etc.
SB
You can use the fonction "map" to split the analog inputs.
Code: Select all
void loop() {
// read the input on analog pin 0:
int sensor1Value = analogRead(A0);
// print out the value you read:
Serial.println(sensor1Value);
delay(10); // delay in between reads for stability
// read the input on analog pin 1:
int sensor2Value = analogRead(A1);
// transform values from 0-1023 to 2000-3023
sensor2Value = map(sensor2Value, 0, 1023, 2000, 3023);
// print out the value you read:
Serial.println(sensor2Value);
delay(10); // delay in between reads for stability
// read the input on analog pin 2:
int sensor3Value = analogRead(A2);
sensor3Value = map(sensor3Value, 0, 1023, 4000, 5023);
// print out the value you read:
Serial.println(sensor3Value);
delay(10); // delay in between reads for stabilitySB
you can as well use a Teensy in USBMIDI, more straigth forward than comport IMHO
Olivar
Olivar
http://oli-lab.org
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces
follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social
Who is online
Users browsing this forum: Google [Bot] and 22 guests
