-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_test
executable file
·95 lines (76 loc) · 2.05 KB
/
run_test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
here=$(pwd)
prereq=1
# if RPi
# need spi_serial, PIL, Adafruit_GPIO, Adafruit SSD1306
echo "**CHECKING HAT EEPROM"
echo "You should see 'Enhanced Radio Devices' on the next line."
cat /proc/device-tree/hat/vendor
echo
echo "You should see the name of the hat on the next line."
cat /proc/device-tree/hat/product
echo
# get spi_serial and install
if ! $(python -c "import spi_serial"); then
echo "**INSTALLING SPI_SERIAL"
if [[ $prereq ]]; then
apt-get update
apt-get install build-essential python-pip python-dev python-imaging python-smbus git
prereq=0
fi
if ! $(python -c "import mraa"); then
git clone https://github.com/intel-iot-devkit/mraa.git libs/mraa
cd libs/mraa
mkdir build
cd build
cmake ..
make
make install
cd $here
fi
git clone https://github.com/EnhancedRadioDevices/spi_serial.git libs/spi_serial
cd libs/spi_serial
python setup.py install
cd $here
fi
reset_spi_serial.py
# get Adafruit_GPIO
if ! $(python -c "import Adafruit_GPIO"); then
if [[ $prereq ]]; then
apt-get update
apt-get install build-essential python-pip python-dev python-imaging python-smbus git
prereq=0
fi
echo "**INSTALLING ADAFRUIT_GPIO"
git clone https://github.com/adafruit/Adafruit_Python_GPIO.git libs/Adafruit_Python_GPIO
cd libs/Adafruit_Python_GPIO
python setup.py install
cd $here
fi
# get Adafruit_SSD1306
if ! $(python -c "import Adafruit_SSD1306"); then
if [[ $prereq ]]; then
apt-get update
apt-get install build-essential python-pip python-dev python-imaging python-smbus git
prereq=0
fi
echo "**INSTALLING RPi.GPIO"
pip install RPi.GPIO
git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git libs/Adafruit_Python_SSD1306
cd libs/Adafruit_Python_SSD1306
python setup.py install
cd $here
# get PIL and install
echo "**INSTALLING PIL"
pip install pillow
fi
# run shapes
echo "**RUNNING shapes.py"
echo "You should see some shapes and a hello world message on your screen."
python shapes.py
#if Edison
#end if
# run cc1110 test
echo "**RUNNING cc1110_set_leds.py"
echo "You should see the two Explorer LEDs blink, then stay on."
python cc1110_set_leds.py