Cov txheej txheem:

Yooj Yim CloudX M633 Digital Stopwatch: 4 Kauj Ruam
Yooj Yim CloudX M633 Digital Stopwatch: 4 Kauj Ruam

Video: Yooj Yim CloudX M633 Digital Stopwatch: 4 Kauj Ruam

Video: Yooj Yim CloudX M633 Digital Stopwatch: 4 Kauj Ruam
Video: FF7 Advent Children 2024, Kaum ib hlis
Anonim
Yooj Yim CloudX M633 Digital Stopwatch
Yooj Yim CloudX M633 Digital Stopwatch

Hauv txoj haujlwm no, peb tab tom tsim ib lub moos digital uas tuaj yeem khaws cov teev teev, feeb thiab vib nas this, ib yam li lub tswb moos ntawm koj lub xov tooj ntawm tes! Peb yuav siv LCD los tso saib lub sijhawm

Kauj Ruam 1: Cov Cheeb Tsam Xav Tau

Cheeb Tsam Xav Tau
Cheeb Tsam Xav Tau
Cheeb Tsam Xav Tau
Cheeb Tsam Xav Tau
Cheeb Tsam Xav Tau
Cheeb Tsam Xav Tau
  • CloudX M633
  • CloudX SoftCard
  • Zaub Zaub
  • Potentiometer
  • Laub Khawm
  • Pawg Mov Ci
  • Jumper Hlau
  • V3 USB kab
  • 10k ua

Koj tuaj yeem tau txais koj cov khoom ntawm no

Kauj ruam 2: HARDWARE

HARDWARE
HARDWARE

Kauj Ruam 1: Txhim kho lub LCD zaub hauv lub rooj noj mov thiab txuas rau CloudX M633 Board raws li cov hauv qab no

  • R/S rau tus pin 1
  • ENA to pin 2
  • D4 to pin 3
  • D5 pin 4
  • D6 pin 5
  • D7 pin 6

Ib qho ntxiv, xaim 10k lauj kaub rau +5V thiab GND, nrog nws lub wiper (tso tawm) rau LCD cov ntxaij vO pin.

  • txuas Vss thiab K rau GND
  • txuas Vdd thiab A rau +5v
  • txuas R/W rau GND

NB: A yog Anode, K yog Cathode

Kauj ruam 2

  • Kho thawj lub laub khawm (Pib thiab Nres) hauv lub rooj noj mov thiab txuas thawj ceg mus rau 10k thiab Pin7 ntawm CloudX Board thiab lwm ceg rau GND.
  • Txhim Kho Qhov Thib Ob Laub khawm (rov pib dua) hauv breadBoard thiab txuas thawj ceg mus rau 10k thiab pin8 ntawm CloudX Board thiab lwm ceg rau GND.

Kauj ruam 3: CODING

Luam cov cai no rau koj li CloudX IDE

#include #include #include

#define START_PAUSE 7

#define RESET 8 #define START 1 #define PAUSE 0

char timer = "00: 00: 00: 0";

unsigned char HH, MM, SS, mSS, mscount, RFlag = 0; ntsis OmSF = 0, S_PFlag = 0;

cuam tshuam TimerOmSD () {

yog (INTCONbits. T0IF) {

INTCONbits. T0IF = 0; TMR0 += 60; yog (mscount ++ == 10) {mscount = 0; OmSF = 1; }}}

teeb tsa () {

// teeb tsa ntawm no

pinMode (START_PAUSE, INPUT);

pinMode (RESET, INPUT); lcdSetting (1, 2, 3, 4, 5, 6); lcdCmd (meej); lcdCmd (cursorOff); lcdWriteText (1, 1, "CLOUDX STOPWATCH");

rov () {

// Program ntawm no

yog (! readPin (START_PAUSE)) {

yog (S_PFlag == pib) {delayMs (200); INTCON = 0b00000000; OPTION_REG = 0b00000000; mSS-; }

yog (S_PFlag == PAUSE && RFlag == 1) {

delayMs (200); INTCON = 0b11100000; OPTION_REG = 0b00000111; }

yog (S_PFlag == PAUSE && RFlag == 0) {

delayMs (200); INTCON = 0b11100000; OPTION_REG = 0b00000111; TMR0 += 60; mscount = 0; OmSF = 0; } S_PFlag = ~ S_PFlag; RFlag = 1; }

yog (! readPin (RESET)) {

delayMs (200); HH = 0; MM = 0; SS = 0; MSS = 0; INTCON = 0b00000000; OPTION_REG = 0b00000000; mscount = 0; OmSF = 0; RFlag = 0; S_PFlag = PAUSE;

}

yog (OmSF) {

OmSF = ~ OmSF; mSS ++; yog (mSS == 10) SS ++; yog (SS == 60) MM ++; yog (MM == 60) HH ++; }

yog (HH == 100) HH = 0; yog (MM == 60) MM = 0; yog (SS == 60) SS = 0; yog (mSS == 10) mSS = 0; timer [1] = (HH%10) +48; timer [0] = (HH/10) +48; timer [4] = (MM%10) +48; timer [3] = (MM/10) +48; timer [7] = (SS%10) +48; timer [6] = (SS/10) +48; timer [9] = mSS +48; lcdWriteText (2, 2, timer);

}

}

Pom zoo: