Cov txheej txheem:

Raspberry Pi Oled Moos Saib Nws hnov Nws thiab hnov Nws: 5 Kauj Ruam (nrog Duab)
Raspberry Pi Oled Moos Saib Nws hnov Nws thiab hnov Nws: 5 Kauj Ruam (nrog Duab)

Video: Raspberry Pi Oled Moos Saib Nws hnov Nws thiab hnov Nws: 5 Kauj Ruam (nrog Duab)

Video: Raspberry Pi Oled Moos Saib Nws hnov Nws thiab hnov Nws: 5 Kauj Ruam (nrog Duab)
Video: Musicians talk about Buckethead 2024, Kaum ib hlis
Anonim
Image
Image
Raspberry Pi Oled Moos Saib Nws hnov Nws thiab hnov Nws
Raspberry Pi Oled Moos Saib Nws hnov Nws thiab hnov Nws

Nov yog lub moos ntse uas qhia lub sijhawm ntawm OLED cov duab thiab koj tseem tuaj yeem hnov lub sijhawm ntawm lub sijhawm sib txawv uas yog pab puv rau qhov muag tsis pom thiab Nws tseem hloov cov xim coj nrog lub sijhawm zoo li lub teeb tsaus ntuj thaum tsaus ntuj mus rau txiv kab ntxwv rau daj thiab zoo li qhov ntawd. Qhov haujlwm no tawm mus heev peb yuav siv OLed nrog nws thiab lom zem heev nrog nws.

Kauj Ruam 1: Cov ntaub ntawv peb xav tau los sau

Cov ntaub ntawv peb xav tau los sau
Cov ntaub ntawv peb xav tau los sau
Cov ntaub ntawv peb xav tau los sau
Cov ntaub ntawv peb xav tau los sau
Cov ntaub ntawv peb xav tau los sau
Cov ntaub ntawv peb xav tau los sau
Cov ntaub ntawv peb xav tau los sau
Cov ntaub ntawv peb xav tau los sau

Cov ntaub ntawv peb xub xav tau los sau

  • 2 lub thawv zoo li hauv daim duab lossis koj tuaj yeem xaiv raws li koj xaiv
  • Raspberry pi txhua version (Kuv tau siv A+)
  • Hais lus nrog amplifier
  • Roj teeb lossis lub hwj chim mini
  • O LED zaub (Kuv tau siv OLED ssd1063)
  • R. G. B coj
  • Kua nplaum thiab Kub kua nplaum
  • Cov ntawv dawb los yog cov ntawv tuab

Kauj ruam 2: SOFTWERE NEEDED

  • Rasbiam lossis Noobs ntawm Raspberry pi
  • Python Gpio tsev qiv ntawv tau teeb tsa hauv pi
  • Python ssd oled Library

Nruab Ssd OLed txuas los ntawm muab txuas oled liberary txuas

github.com/adafruit/Adafruit_Python_SSD130…

Tau txais font siv hauv txoj haujlwm los ntawm qhov txuas hauv qab no

github.com/xxlukas42/RPI_SSD1306

Kauj Ruam 3: Tus Kheej PIN thiab QHOV CHAW TSHWJ XEEB

KEV TXHAWJ XEEB PIN thiab QHOV CHAW TSHAJ PLAWS
KEV TXHAWJ XEEB PIN thiab QHOV CHAW TSHAJ PLAWS
Kev Txuas Tus Kheej thiab QHOV CHAW TSHAJ PLAWS
Kev Txuas Tus Kheej thiab QHOV CHAW TSHAJ PLAWS
Kev Txuas Tus Kheej thiab QHOV CHAW TSHAJ PLAWS
Kev Txuas Tus Kheej thiab QHOV CHAW TSHAJ PLAWS
KEV TXHAWJ XEEB PIN thiab QHOV CHAW TSHAJ PLAWS
KEV TXHAWJ XEEB PIN thiab QHOV CHAW TSHAJ PLAWS

Txuas thiab kho qhov O. Led zaub thiab R. G. B coj hauv lub thawv raws li qhia hauv pics.

koj tuaj yeem txuas thiab kho Oled zaub raws li koj tus kheej tsim

Kev Txuas Tus PIN ntawm O. LED DISPLAY OF RASPBERRY

Raspberry pi Board tus pin O.led Zaub

Pin 3 -------------- ---------------------- SDA

pin 5 ------------------------------- SCL

GND ------------------------------ GND

3V -------------------------------- VCC

RGB LED mus rau PI CONNECTION

comman +tus pin rau 3v raspberry pi

Liab ------------- 35

Ntsuab ----------- 33

Xiav ------------- 37

Kauj ruam 4:

PYTHON CODE LINK

github.com/ASHWINISINHA/pi-oled-intelligen…

Downlode Python cov ntawv sau los ntawm kab ntawv saum toj no thiab khiav cov ntawv run1.py los ntawm Terminal rau lub sijhawm xim xim

Khiav lub run2.py los ntawm lub davhlau ya nyob twg rau LED xim raws sijhawm

import timeimport os

sijhawm ntshuam Adafruit_GPIO. SPI li SPI i

mport Adafruit_SSD1306 los ntawm lub sijhawm ntshuam gmtime, strftime

los ntawm PIL ntshuam duab

los ntawm PIL ntshuam ImageDraw

los ntawm PIL ntshuam ImageFont

# Raspberry Pi tus pin teeb tsa:

RST = 24 # Nco tseg cov hauv qab no tsuas yog siv nrog

SPI: DC = 23 SPI_PORT = 0 SPI_DEVICE = 0

showtime = strftime (" %a %d %b %Y sijhawm %X thib ob", gmtime ())

def poj niam (ntawv nyeem):

os.system ("espeak" " + ntawv +" "")

poj niam (sijhawm ua yeeb yam) # 128x32 zaub nrog kho vajtse I2C: #

disp = Adafruit_SSD1306. SSD1306_128_32 (rst = RST)

disp = Adafruit_SSD1306. SSD1306_128_64 (rst = RST) disp.begin ()

# Ntshiab cov zaub. disp.clear () disp.display ()

dav = disp.width qhov siab = disp.height duab = Image.new ('1', (dav, qhov siab))

# Tau txais cov khoom kos los kos duab. kos = ImageDraw. Draw (duab)

# Kos lub thawv ntim dub kom pom cov duab. draw.rectangle ((0, 0, dav, qhov siab), tus qauv = 0, sau = 0)

# Kos ib co duab. # Ua ntej txhais qee qhov tsis tu ncua tso cai yooj yim hloov pauv ntawm cov duab. padding = 2 shape_width = 20 sab saum toj = padding hauv qab = qhov siab-padding # txav mus rau sab xis kom taug qab txoj haujlwm x tam sim no rau kev kos duab. x = padding # Kos tus ellipse.

# Thauj khoom font tsis raug. font = ImageFont.load_default () font = ImageFont.truetype ('Montserrat-Light.ttf', 14) font2 = ImageFont.truetype ('Montserrat-Light.ttf', 20) font_text_big = ImageFont.truetype ('Montserrat-Nruab Nrab. txf, 30)

thaum muaj tseeb: kos.rectangle ((0, 0, dav, qhov siab), tus qauv = 0, sau = 0) kos.text ((x, saum), str (strftime (" %a %d %b %Y", gmtime ())), font = font, fill = 455) kos.text ((x, saum+39), str (strftime (" %a %d", gmtime ())), font = font2, sau = 455) kos.text ((x, saum+12), str (strftime (" %X", gmtime ())), font = font_text_big, sau = 455) showtime = strftime (" %a %d %b %Y sijhawm %X thib ob ", gmtime ()) def poj niam (ntawv nyeem): os.system (" espeak "" + text + "'") poj niam (showtime) disp.image (duab) disp.display () time.sleep (1)

Downlode tag nrho nab hab sej tsab ntawv los ntawm no

github.com/ASHWINISINHA/pi-oled-intelligen…

github.com/ASHWINISINHA/pi-oled-intelligent-clock

Kauj Ruam 5: Nrog koj zoo siab Peb tes num tau npaj tam sim no

Pom zoo: