Cov txheej txheem:

Ua Si PONG Game Nrog Arduino Uno thiab OLED 0.96 SSD1306 Zaub: 6 Kauj Ruam
Ua Si PONG Game Nrog Arduino Uno thiab OLED 0.96 SSD1306 Zaub: 6 Kauj Ruam

Video: Ua Si PONG Game Nrog Arduino Uno thiab OLED 0.96 SSD1306 Zaub: 6 Kauj Ruam

Video: Ua Si PONG Game Nrog Arduino Uno thiab OLED 0.96 SSD1306 Zaub: 6 Kauj Ruam
Video: Peb pab kwv tij mus ua si play game so hlwb ua si 15/10/2022 2024, Kaum ib hlis
Anonim
Ua Si PONG Game Nrog Arduino Uno thiab OLED 0.96 SSD1306 Zaub
Ua Si PONG Game Nrog Arduino Uno thiab OLED 0.96 SSD1306 Zaub

Nyob zoo cov menyuam hnub no peb yuav ua PONG Game nrog Arduino. Peb yuav siv adafruit's 0.96 oled zaub los tso saib cov game & laub khawm kom tswj tau qhov kev ua si.

Kauj Ruam 1: Yam Koj Xav Tau

Yam Koj Xav Tau
Yam Koj Xav Tau

Rau txoj haujlwm no koj xav tau cov khoom hauv qab no: 1x Arduino uno: https://www.utsource.net/itm/p/9221687.html2x laub khawm 1x oled zaub 0.96 ssd1306 i2c: https://www.utsource.net/itm/ p/9221021.html1x breadboard:.: https://www.utsource.net/itm/p/8031572.html Muaj ob tus dhia:

Kauj Ruam 2: Txuas Cov Zaub rau Arduino

Txuas cov Zaub rau Arduino
Txuas cov Zaub rau Arduino

Ua ntej koj yuav tsum txuas cov zaub rau Arduino. Connect vcc rau 5v. Gnd rau gnd pin. Sda ntawm coj mus rau A4 ntawm Arduino & scl/sck ntawm cov zaub rau A5 ntawm arduino.

Kauj Ruam 3: Txuas Push Buttons

Txuas Laub Khawm
Txuas Laub Khawm

Tam sim no cia peb txuas cov nyees khawm ib yam nkaus. Ib qho kawg ntawm ob qho UP & DOWN khawm yuav txuas nrog Gnd thiab ib kawg ntawm UP khawm yuav txuas nrog tus pin 2 ntawm Arduino & ib kawg ntawm DOWN khawm yuav txuas nrog tus pin 3 ntawm Arduino li qhia hauv daim duab.

Kauj ruam 4: Rub lub Tsev Qiv Ntawv

Rub tawm Lub Tsev Qiv Ntawv
Rub tawm Lub Tsev Qiv Ntawv
Rub tawm Lub Tsev Qiv Ntawv
Rub tawm Lub Tsev Qiv Ntawv

Nco ntsoov tias koj rub tawm SD1306 cov tsev qiv ntawv hauv Koj li Arduino lub tswv yim raws li qhia hauv duab thiab kom ntseeg tau tias koj Adafruit GFX lub tsev qiv ntawv ib yam, yog tias tsis yog ces nruab ob lub tsev qiv ntawv no.

Kauj ruam 5: Code

Code
Code

Nthuav cov cai los ntawm qhov muab txuas & upload rau koj arduino uno. Download code:

Kauj Ruam 6: Kauj Ruam Kawg

Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg
Kauj Ruam Kawg

Yog li peb ua tiav txhua yam ua tiav thiab raws li koj tuaj yeem pom kuv tab tom ua si kuv Pong game hauv daim duab nrog kev pab ntawm UP & Down thawb khawm. Yog li ua koj tus kheej Pong game & muaj kev lom zem. Yog li hmoov zoo ua koj tus kheej Pong game.

Pom zoo: