Hello,
I am trying to make an software to control pc volume from Arduino with C#. I have made almost all the soft but i have stuck at Volume Bar.
The buttons works just fine.
I want to control the volume with Potentiometer connected to Arduino and send signal to the soft on pc.
I think to connect with TrackBar or ScrollBar. I have made the code to control the volume on soft but can't make it to work with Arduino.
Thank you
The trackbar and Count are declared up
I am trying to make an software to control pc volume from Arduino with C#. I have made almost all the soft but i have stuck at Volume Bar.
The buttons works just fine.
I want to control the volume with Potentiometer connected to Arduino and send signal to the soft on pc.
I think to connect with TrackBar or ScrollBar. I have made the code to control the volume on soft but can't make it to work with Arduino.
Thank you
The trackbar and Count are declared up
C:
public void trackBar1_Scroll(object sender, EventArgs e)
{
label3.Text = trackBar1.Value.ToString();
if (Count == 1)
{
if (trackBar1.Value > trackBar)
{
keybd_event(VK_VOLUME_UP, 0, KEYEVENTF_EXTENTEDKEY, IntPtr.Zero);
}
if (trackBar1.Value < trackBar)
{
keybd_event(VK_VOLUME_DOWN, 0, KEYEVENTF_EXTENTEDKEY, IntPtr.Zero);
}
}
trackBar = trackBar1.Value;
Count = 1;
}
Last edited by a moderator: