Hi, I want to control my PC volume with a potentiometer using an Arduino. How am I meant to do it, using a keyboard library and ifs or by somehow using cases?
I'm using an Arduino Uno but I can also work with an ESP8266 and a raspberry pi pico
Hi, I want to control my PC volume with a potentiometer using an Arduino. How am I meant to do it, using a keyboard library and ifs or by somehow using cases?
I'm using an Arduino Uno but I can also work with an ESP8266 and a raspberry pi pico
Can you control the volume from the PC keyboard ? If so, which keys do you use ?
Which Arduino board do you have ?
yeah you can control volume from your keyboard, for me is the FN key and F2 or F3
I use an Arduino Uno
Then you cannot use the Keyboard library to emulate a keyboard and send keypresses to the PC
You need a different board. See https://www.arduino.cc/reference/en/language/functions/usb/keyboard/
I also have a raspberry pi pico, do you think that can work?
Sorry, but I know nothing about that device
What about ESP8266, it has a micro USB port
Let's say I have an Arduino nano what would I do? (i also said above I have an ESP8266 that must work with what I need it for )
I don't know, and this is really a Windows question about what data/command is sent by a keyboard that has a volume function...
But I just realized something... A pot won't work!!! A keyboard doesn't know the current loudness setting... It just sends "up" & "down" messages. The pot could be fully clockwise (maximum) without the volume being maximum, and then you can't turn it up. Same thing if the pot is fully counterclockwise and the volume it's actually zero... You wouldn't be able to turn it down.
So, you'd need a rotary encoder or up & down buttons.
No, sorry. Neither of those have a "native usb interface" which is what you need to simulate a multi-media keyboard. Arduino Pro Micro is a good choice (don't confuse with Pro Mini).
So my only choice is an Arduino Pro Micro
True,I didn't think about that
But lets say that I only change the volume from the potentiometer,then it does work
Eh? What do you mean? It's just been explained that there is no direct link between the PC's volume and the position of the pot. That's why @DVDdoug suggested a rotary encoder - they don't have a position, just a direction of rotation. They can send as many "louder" or "quieter" signals as you want.
I thought that if I set my volume to 0 and my potentiometer to 0 it would work (also on restarts the sound volume might reset so No again)
Yeah I understand, I will look it up
Is it? Why?
Yes, but then you would have to do that every time you start it up.
Just not convenient.
What other boards I can use?
See reply #4
Yeah I was just reading it, ty