Skip to content

Latest commit

 

History

History
61 lines (55 loc) · 2.97 KB

README.md

File metadata and controls

61 lines (55 loc) · 2.97 KB

VolumeChangerArduino

Summary: Designed for changing computer volume with potentiometer.

How do you setup?

1) Make your Arduino connections as I show in the pictures.
2) If you use different analog input don't forget to change Arduino code.
3) In python import the project (also you can use the program with running VolumeChangerArduino.py but this is not recommended):

from VolumeChangerArduino import VolumeChangerArduino

4) Assign the class object to your variable:

yourVariable = VolumeChangerArduino(port, baudrate, sleeptime)

port: Arduino port as string. (port="COM6")
baudrate: Arduino baudrate as int. (baudrate=115200)
sleeptime: Waiting time before passing next loop to get serial input in seconds as int. (sleeptime=0.001)

5) Run the app:

yourVariable.run()

Special Methods

Show the Volume in Widget (.useWidget)

yourVariable.useWidget(widget_latency=10, position="brb", taskbar_thick=0.03, size=0.08, transparency=1, margin=0)

widget_latency: Widget refresh rate in ms. (widget_latency=10)
position: Which side of your screen? (position="brb")

1st char for b:bottom, t:top;
2nd char for r:right, l:left;
3rd char for where is your taskbar? b:bottom, t:top, l:left, r:right.

taskbar_thick: Ratio of taskbar to resolution. This value should be: (taskbar_thick=0.03)

If your taskbar at left or right: taskbar_thick = (taskbar width)/(width of desktop resoulution)
If your taskbar at bottom or top: taskbar_thick = (taskbar height)/(height of desktop resoulution)

size: Widget size. Source code: (size=0.08)

    if size <= 1:
        fontsize = math.floor(height_of_desktop_resoulution*size)
    else:
        fontsize = math.floor(size)

transparency: Widget transparency. (transparency=1)

transparency must be between 0 and 1.

margin: Screen edge-widget margin in pixel. (margin=0)

Images

Arduino Circuit

1kOhm constant resistor used | 100kOhm potentiometer used.


Finding Arduino Port

 In Device Manager go to Ports (COM & LPT) then find your Arduino port.




Why are there too much function created with curve_fit?

 Because if single function used, it's error rises too much as shown in the picture.