tweak voltage divider for my config
[digitaldcpower] / ddcp-script-example.sh
1 #!/bin/sh
2 # Example showing how to control the tuxgraphics digital power supply
3 # by scripts.
4 if [ -z "$1" ]; then
5         echo "USAGE: ddcp-script-example.sh /dev/ttyUSB0"
6         echo "or     ddcp-script-example.sh /dev/ttyUSB1"
7         exit 0;
8 fi
9 dev="$1"
10 # included the current directory to have access to the command
11 # ddcp-script-getval to make testing easier. Normally you would
12 # install ddcp-script-getval  in /usr/bin and then delete the
13 # line that sets the PATH
14 PATH="${PATH}:."
15 ddcp-script-ttyinit "$dev"
16 echo "current settings are:"
17 ddcp-script-getval "$dev"
18 echo "setting voltage to 3.3 V"
19 ddcp-script-setval "u=33" "$dev"
20 echo "new settings are:"
21 ddcp-script-getval "$dev"
22 echo "wait one sec, it takes a moment for the display values to adjust as they are polled in the avr software"
23 sleep 1
24 echo "print settings again:"
25 ddcp-script-getval "$dev"