Cov txheej txheem:

Yooj Yim thiab Txuj Ntsuas Nrog CloudX: 5 Kauj Ruam
Yooj Yim thiab Txuj Ntsuas Nrog CloudX: 5 Kauj Ruam

Video: Yooj Yim thiab Txuj Ntsuas Nrog CloudX: 5 Kauj Ruam

Video: Yooj Yim thiab Txuj Ntsuas Nrog CloudX: 5 Kauj Ruam
Video: Yasmi - Txiv Nraug Ntsuag ft. JN Vang (Music Video) 2024, Hlis ntuj nqeg
Anonim
Yooj Yim thiab Txuj Ci Nrog CloudX
Yooj Yim thiab Txuj Ci Nrog CloudX

Hauv qhov kev qhia no, peb yuav kawm paub yuav ua li cas kom yooj yim thiab tus lej suav nrog CloudX, Thov nyem Yog tias koj tsis tau nyeem dab tsi ntawm Kev cuam tshuam cov keyboard nrog CloudX ua ntej, Ntawm no, Peb lub hom phiaj yog qhia koj li cas koj tuaj yeem txhim kho koj li cas tus kheej lub laij lej kho vajtse siv cloudX M633.

Peb lub hom phiaj yog txhawm rau tuaj yeem tsim lub tshuab xam zauv uas tuaj yeem ua Ntxiv (+), Rho Tawm (-), Sib Cais (*) thiab faib (/) nrog Cov Ntsiab Lus hauv zauv tsawg li 0.0000001 thiab tag nrho cov lej txog 90000000. Lub tshuab xam zauv muaj peev xwm txheeb xyuas qhov ua lej yuam kev thiab lwm yam.

Kauj ruam 1: HARDWARE YUAV TSUM MUAJ

HARDWARE YUAV TSUM TAU
HARDWARE YUAV TSUM TAU
HARDWARE YUAV TSUM TAU
HARDWARE YUAV TSUM TAU

1x CloudX Microcontroller

1x CloudX SoftCard

1 x USB Cable

1 x 4x4 Matrix Keypad

1x 16x2 LCD Jumper Wires

1 x 1 kΩ Resistor

4x 10 kΩ Resistors

Kauj Ruam 2: Tus lej PIN

LUS QHIA PIN
LUS QHIA PIN
LUS QHIA PIN
LUS QHIA PIN
LUS QHIA PIN
LUS QHIA PIN

CloudX Kev Txuas Txuas nrog LCD thiab CloudX Kev Txuas Txuas nrog Keypad

Kauj Ruam 3: CIRCUIT DIAGRAM

CIRCUIT DIAGRAM
CIRCUIT DIAGRAM

Kauj ruam 4: SOFTWARE

/ * * Cov Ntaub Ntawv: Ntse KeyPad Xauv System.c

* Sau: hoodie

*

* Tsim thaum Lub Peb Hlis 20, 2018, 11:21 AM

*/

#suav nrog

#suav nrog

#suav nrog

#suav nrog

#define NumberOfRows 4 // teeb tsa ua plaub kab

#define NumberOfColumns 4 // teeb tsa zaub rau peb kab

char KeypadCharacters [NumberOfRows] [NumberOfColumns] = {

'1', '2', '3', '+', '4', '5', '6', '-', '7', '8', '9', '*', 'C', '0', '=', '/' Cov

};

char RowPins [NumberOfRows] = {7, 8, 9, 10};

char ColumnsPins [NumberOfColumns] = {11, 12, 13, 14};

char Keys, a = 0, kos = 0, ua haujlwm = 0, kos npe = 0, kos = 0;

kos npe ntab teb;

char * Panswer;

char Aanswer [10];

kos npe ntev inputa;

char Ainputa [10];

kos npe ntev inputb;

char Ainputb [10];

teeb tsa () {

KeypadSetting (PULLDOWNCOL, RowPins, ColumnPins, NumberOfRows, NumberOfColumns, KeypadCharacters);

lcdSetting (1, 2, 3, 4, 5, 6);

lcdCmd (lcd_clear);

lcdCmd (cursor_off);

lcdWriteText (1, 1, "CALCULATOR NROG");

lcdWriteText (2, 1, "CLOUDX");

delayMs (2000);

lcdCmd (lcd_clear);

lcdCmd (cursor_blink);

rov () {

Cov yuam sij = getKey ();

yog (Keys! = 0 && Keys == 'C') {

lcdCmd (lcd_clear);

lcdCmd (cursor_blink);

rau (a = 0; a <10; a ++) {

Ainputa [ib] = 0;

Ainputb [ib] = 0;

Aanswer [tau] = 0;

}

ua = 0;

kev ua haujlwm = 0;

khij = 0;

signa = 0;

signb = 0;

}

yog (kos == 1 && Keys! = 0 && Keys == '=') {

lcdCmd (cursor_off);

inputa = atoi (Ainputa);

inputb = atoi (Ainputb);

yog (signa == '-') {

inputa = -(inputa);

}

yog (signb == '-') {

inputb = -(inputb);

}

yog tias (ua haujlwm == '+') {

teb = inputa + inputb;

longTostr (Aanswer, teb, DEC);

}

yog tias (ua haujlwm == '-') {

teb = inputa - inputb;

longTostr (Aanswer, teb, DEC);

}

yog tias (ua haujlwm == '*') {

teb = inputa * inputb;

longTostr (Aanswer, teb, DEC);

}

yog tias (ua haujlwm == '/') {

teb = (ntab) inputa / (ntab) inputb;

Panswer = floatTostr (teb);

yog (inputa> inputb) {

Panswer [5] = 0;

}

}

yog tias (ua haujlwm == '/') {

lcdWriteText (2, 1, "ANS:");

lcdWriteTextCP (Panswer);

}

lwm tus {

lcdWriteText (2, 1, "ANS:");

lcdWriteTextCP (Aanswer);

}

}

yog (Keys! = 0 && (Keys == '+' || Keys == '-' || Keys == '*' || Keys == '/')) {

yog (ua haujlwm! = 0 && a == 0 && signb == 0 && (Keys == '-' || Keys == '+')) {

lcdWriteCP (Cov yuam sij);

yog (Keys == '-' || Keys == '+') {

signb = Cov yuam sij;

}

}

yog (ua haujlwm == 0 && a == 0 && signa == 0 && (Keys == '-' || Keys == '+')) {

lcdWriteCP (Cov yuam sij);

yog (Keys == '-' || Keys == '+') {

signa = Cov yuam sij;

}

}

yog (ua haujlwm == 0 && a! = 0) {

lcdWriteCP (Cov yuam sij);

lag luam = Keys;

ua = 0;

}

}

yog (Keys! = 0 && (Keys == '0' || Keys == '1' || Keys == '2' || Keys == '3' || Keys == '4' || Keys = = '5' || Keys == '6' || Keys == '7' || Keys == '8' || Keys == '9')) {

yog (ua haujlwm! = 0) {

lcdWriteCP (Cov yuam sij);

Ainputb [a] = Cov yuam sij;

ib ++;

khij = 1;

}

yog (ua haujlwm == 0) {

lcdWriteCP (Cov yuam sij);

Ainputa [a] = Cov yuam sij;

ib ++;

}

}

}

}

Pom zoo: