This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt update | |
sudo apt upgrade -y | |
# PIP | |
sudo apt install python3-pip -y | |
# Jetson Fan | |
sudo apt install python3-dev -y | |
git clone https://github.com/Pyrestone/jetson-fan-ctl.git | |
cd jetson-fan-ctl | |
sudo ./install.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
def get_master_volume(): | |
proc = subprocess.Popen('/usr/bin/amixer sget Master', shell=True, stdout=subprocess.PIPE) | |
amixer_stdout = proc.communicate()[0].split('\n')[4] | |
proc.wait() | |
find_start = amixer_stdout.find('[') + 1 | |
find_end = amixer_stdout.find('%]', find_start) | |
return float(amixer_stdout[find_start:find_end]) |