Cov txheej txheem:

Ntau 7 Segment Display Counter Nrog CloudX Microcontroller: 4 Cov Kauj Ruam
Ntau 7 Segment Display Counter Nrog CloudX Microcontroller: 4 Cov Kauj Ruam

Video: Ntau 7 Segment Display Counter Nrog CloudX Microcontroller: 4 Cov Kauj Ruam

Video: Ntau 7 Segment Display Counter Nrog CloudX Microcontroller: 4 Cov Kauj Ruam
Video: Next War: Vietnam - advanced system rules step by step 3 2024, Kaum ib hlis
Anonim
Ntau 7 Segment Display Counter Nrog CloudX Microcontroller
Ntau 7 Segment Display Counter Nrog CloudX Microcontroller

Txoj Haujlwm no piav qhia yuav ua li cas tso saib cov ntaub ntawv ntawm Ob 7-Segment siv CloudX microcontroller

Kauj ruam 1: Tau txais cov khoom no

Tau txais cov ntaub ntawv no
Tau txais cov ntaub ntawv no
Tau txais cov ntaub ntawv no
Tau txais cov ntaub ntawv no
Tau txais cov ntaub ntawv no
Tau txais cov ntaub ntawv no

CLOUDX MICROCONTROLLER

CLOUDX SOFTCARD

V3 kab

JUMPER WIRE

2 SEVEN SEGMENT

330ohm resistor

Yuav koj cov khoom siv online ntawm no

Kauj ruam 2: Teem HARDWARE

Teem HARDWARE
Teem HARDWARE

Hauv qhov no peb yuav tsum ua multiplexing

txuas A, B, DP, C, D, E, F, G tus pin ntawm ob ntu ua ke, Pin A ntawm ntu rau pin1 ntawm CloudXPin B ntawm ntu rau pin2 ntawm CloudX

Pin DP ntawm ntu rau pin3 ntawm CloudX

Pin C ntawm ntu rau pin4 ntawm CloudX

Pin D ntawm ntu rau pin5 ntawm CloudX

Pin E ntawm ntu rau pin6 ntawm CloudX

Pin F ntawm ntu rau pin7 ntawm CloudX

Pin G ntawm ntu rau pin9 ntawm CloudX

txuas ntau cathode ntawm thawj ntu rau pin10 thiab

txuas ntau cathode ntawm ntu thib ob rau tus pin11

download CloudX IDE ntawm no

Kauj ruam 3: CODING

Luam cov cai no rau CloudX IDE

#include #include #include

char txee [2] = {'0', '0'};

teeb () {// teeb tsa no char NumberOfDigit = 2; // teeb tsa tus lej 7 ntu qhia kom siv // txuas cov CloudX pins rau Cov Ntaub Ntawv Pins A, B, C, D, E, F, G thiab H pins ntawm Display char segmentDataPins = {1, 2, 3, 4, 5, 6, 7, 8}; // txuas cov CloudX pins mus rau Common Anode lossis Cathode ntawm txhua 7-ntu tso saib char segmentScanPins = {9, 10}; // pib ua 7 ntu Zaub nrog cov ntaub ntawv Segment_setting (CCathode, NumberOfDigit, segmentScanPins, segmentDataPins); loop () {// Qhov program no rau (int i = 0; i <100; i ++) {// xam i /10 thiab ntxiv 48 (los hloov nws mus rau tus yam ntxwv) tom qab ntawd thauj khoom hauv txee [0] txee [0] = (kuv/10) + 48; txee [1] = (i%10) + 48; // thauj qhov kev suav no rau hauv txee [0]

Segment_writeText (txee, 1000); // Zaub cov ntsiab lus hauv txee array ntawm

7 ntu} rau (int i = 99; i> 0; i-) {// hloov tus nqi hauv i qhov sib txawv (input) rau txoj hlua (tso tawm) hauv paus 10 intTostr (txee, i, DEC); yog (i <10) // ua raws seem no ntawm cov cai yog tias tus nqi hauv i qhov txawv txav tsawg dua 10 {counter [1] = counter [0]; // hloov lub txee [1] nrog cov ntsiab lus ntawm lub txee [0] txee [0] = '0'; // hloov lub txee [0] sib txawv nrog cov cim '0'} Segment_writeText (txee, 1000); // Zaub cov ntsiab lus hauv cov txee sib npaug rau 1 sec}}}

Kauj ruam 4: Koj puas tau ua tiav

Qhia tawm nrog peb ntawm no

Pom zoo: