[修改] 增加Led、Oled目录

This commit is contained in:
2023-06-29 23:32:14 +08:00
parent da536c73f3
commit f42618de4e
12 changed files with 491 additions and 27 deletions

33
main.py Normal file
View File

@ -0,0 +1,33 @@
import os
import sys
import time
import RPi.GPIO as GPIO
import spidev as SPI
sys.path.append(os.path.join(os.path.dirname(__file__),'Oled'))
import SSD1306
from PIL import Image,ImageDraw,ImageFont
# Raspberry Pi pin configuration:
OLED_GPIO_RST = 19
OLED_GPIO_DC = 16
OLED_SPI_BUS = 0
OLED_SPI_CS = 0
LED_GPIO_RED = 26
# 128x64 display with hardware SPI:
disp = SSD1306.SSD1306(OLED_GPIO_RST, OLED_GPIO_DC, SPI.SpiDev(OLED_SPI_BUS, OLED_SPI_CS))
def main():
try:
while True:
time.sleep(1)
except:
print("except")
if __name__=='__main__':
main()