forked from DhrBaksteen/ArduinoOPL2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnecting
More file actions
executable file
·31 lines (28 loc) · 1.35 KB
/
connecting
File metadata and controls
executable file
·31 lines (28 loc) · 1.35 KB
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
#!/bin/sh
if ! type "gpio" > /dev/null
then
echo "WiringPi was not found!"
echo "Please run the build script to install your OPL2 Audio Board first."
echo ""
exit
fi
PIN_LATCH=$(gpio readall | awk -F\| '{if ($3==1) print $7} {if ($13==1) print $9}')
PIN_A0=$(gpio readall | awk -F\| '{if ($3==4) print $7} {if ($13==4) print $9}')
PIN_RESET=$(gpio readall | awk -F\| '{if ($3==5) print $7} {if ($13==5) print $9}')
PIN_DATA=$(gpio readall | awk -F\| '{gsub(/ /, "", $4) ; if ($4=="MOSI") print $7} {gsub(/ /, "", $12) ; if ($12=="MOSI") print $9}')
PIN_SHIFT=$(gpio readall | awk -F\| '{gsub(/ /, "", $4) ; if ($4=="SCLK") print $7} {gsub(/ /, "", $12) ; if ($12=="SCLK") print $9}')
echo ""
echo "Connect the OPL2 Audio Board to your Raspberry Pi like this:"
echo ""
echo "+------------+------+"
echo "| OPL2 Board | GPIO |\tGPIO header orientation:"
echo "+------------+------+"
echo "| Reset | $PIN_RESET |\t |"
echo "| Shift | $PIN_SHIFT |\t ... 5 3 1 |"
echo "| Latch | $PIN_LATCH |\t -----------+ |"
echo "| Data | $PIN_DATA |\t o o o o o | |"
echo "| A0 | $PIN_A0 |\t o o o o o o | |"
echo "| GND | 6 |\t -------------+ |"
echo "| +5v | 2 |\t ... 6 4 2 | <-- Raspberry Pi"
echo "+------------+------+\t ------------------' board edge"
echo ""