Hello everyone i would like to reverse the value that read from potentiometer. When it gets to 1023 value i would like to read 0 and when it gets to 0 i would like to read 1023 values from serial screen and same way with all other values between 0 and 1023.
Simple arithmetic.
Please ask a moderator to move this topic - it is not any kind of tutorial.
serial.println(TheAnalogReadingTaken);
(1023 - value), have you tried that?
Hello thebestengineer
Take a view here.
Have a nice day and enjoy coding in C++.
Why such a tendency to be snide on this website?
I can't tell you how many times I've wanted to ask a question here but didn't because I thought I'd be mocked or talked down to.
I think it would behoove everyone here to embrace what we in Hawaii call aloha.
Hi, @projecthal
The hardware solution;
To reverse the output from your potentiometer, swap the gnd(0v) and 5V connections on the pot.
Leave the centre connection in place.
The other suggestions are software solutions.
Tom...
Now your voltage output will be in the reverse direction for the rotation of your pot.
I don't see "snide" - can you show us?
Thanks Tom. I understand the hardware solution, I am looking to do it by software in the IDE. I have been looking for several hours online studying stuff and to be frank, I'm a musician and don't really care about learning Arduino, I just want want to get it to work so I can get back to playing. I know that doesn't sit well with many people here. So yes, kill me for simply wanting free help. Is that really so evil?
If anybody would care to kindly share their knowledge with me I'd really appreciate it. If you want to be mean please just go play with your dog.
Sorry to vent but there does seem to be a problem on this site with a lack of aloha.
If you can't see snide here you are blind.
Hi,
y = map(x, 0, 1023, 1023, 0 );
Write a simple bit of code using serial print and see the result.
Thanks.. Tom...
No, I'm not visually-impaired
Or maybe "snide" means something different in Hawaii.
What's wrong with the answer from post#4?
Thanks for the replies. I was able to accomplish what I needed in MidiPipe by changing the MIDI CC to a note on, inverting the keyboard in Key Mapping and then changing it back to a MIDI CC.
Also, and I didn't try this 'cause I solved it in MidiPipe but there is a CC invert method in Surface Control (duh).
I have hundreds of tweaks already going on in MidiPipe so I prefer to use Arduino as more of an adapter as much as I can, otherwise the tweaks are spread between two programs.
Thanks
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.