12345678910111213141516171819202122232425262728293031 |
- #!/bin/bash
- sudo apt-get update
- sudo apt-get install python3-pip -y
- sudo apt-get install python3-pil -y
- sudo pip3 install adafruit-circuitpython-ssd1306
- pip3 install RPI.GPIO
- pip3 install adafruit-blinka
- sudo apt-get install -y python3 git python3-pip
- sudo update-alternatives --install /usr/bin/python python $(which python2) 1
- sudo update-alternatives --install /usr/bin/python python $(which python3) 2
- sudo update-alternatives --config python
- sudo raspi-config
- git clone https://github.com/adafruit/Adafruit_CircuitPython_SSD1306.git
- cat <<'EOF'>> check.py
- import board
- import digitalio
- import busio
- print("Hello PiCore!")
- # Try to great a Digital input
- pin = digitalio.DigitalInOut(board.D4)
- print("Digital IO ok!")
- # Try to create an I2C device
- i2c = busio.I2C(board.SCL, board.SDA)
- print("I2C ok!")
- # Try to create an SPI device
- spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
- print("SPI ok!")
- print("done!")
- EOF
- clear
- python check.py
|