setup.sh 946 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. sudo apt-get update
  3. sudo apt-get install python3-pip -y
  4. sudo apt-get install python3-pil -y
  5. sudo pip3 install adafruit-circuitpython-ssd1306
  6. pip3 install RPI.GPIO
  7. pip3 install adafruit-blinka
  8. sudo apt-get install -y python3 git python3-pip
  9. sudo update-alternatives --install /usr/bin/python python $(which python2) 1
  10. sudo update-alternatives --install /usr/bin/python python $(which python3) 2
  11. sudo update-alternatives --config python
  12. sudo raspi-config
  13. git clone https://github.com/adafruit/Adafruit_CircuitPython_SSD1306.git
  14. cat <<'EOF'>> check.py
  15. import board
  16. import digitalio
  17. import busio
  18. print("Hello PiCore!")
  19. # Try to great a Digital input
  20. pin = digitalio.DigitalInOut(board.D4)
  21. print("Digital IO ok!")
  22. # Try to create an I2C device
  23. i2c = busio.I2C(board.SCL, board.SDA)
  24. print("I2C ok!")
  25. # Try to create an SPI device
  26. spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
  27. print("SPI ok!")
  28. print("done!")
  29. EOF
  30. clear
  31. python check.py