Mundarija:

CLOUDX MICROCONTROLLER dan foydalanadigan 7 ta segmentli kalit tugmasi: 4 qadam
CLOUDX MICROCONTROLLER dan foydalanadigan 7 ta segmentli kalit tugmasi: 4 qadam

Video: CLOUDX MICROCONTROLLER dan foydalanadigan 7 ta segmentli kalit tugmasi: 4 qadam

Video: CLOUDX MICROCONTROLLER dan foydalanadigan 7 ta segmentli kalit tugmasi: 4 qadam
Video: Nyobain Aplikasi Video Conference CloudX Telkomsel, Ternyata... #ITTALK 2024, Noyabr
Anonim
CLOUDX MICROCONTROLLERDAN FOYDALANILGAN 7 SEGMENTLI KEYPAD
CLOUDX MICROCONTROLLERDAN FOYDALANILGAN 7 SEGMENTLI KEYPAD

Ushbu loyiha uchun biz Matrix klaviaturasidan raqamli kirishni qabul qilamiz va keyin uni etti segmentli displey modulida ko'rsatamiz. 8 ta svetodiod A dan G gacha va DP (o'nlik kasr uchun) deb etiketlanganligi sababli, agar siz 6 raqamini ko'rsatishni xohlasangiz, siz A, C, D, EF va G segmentlariga oqim joriy qilasiz. Shuning uchun 6 ga teng 0b01111101 (DP), G, F, E, D, C, B, A) ikkilikda va o'n oltilikda 0x7D.

1 -qadam: MATERIALLAR

MATERIALLAR
MATERIALLAR
MATERIALLAR
MATERIALLAR
MATERIALLAR
MATERIALLAR
  1. CLOUDX MICROCONTROLLER
  2. CLOUDX SOFTCARD
  3. 7 -QISM
  4. JUMPER TEL
  5. V3 CORD
  6. 4x3 klaviatura
  7. 330 ohm
  8. 10K qarshilik

BU YERDA KOMPONENTINGIZGA Buyurtma Bersangiz bo'ladi

2-qadam: QURILMALARNI O'RNATISH

Ushbu qadamni bajaring:

ulang:

Segmentning A pinini CloudX ning 1 -piniga

Segmentning B pinini CloudX ning 2 -piniga ulang

Segmentning DP -ni CloudX -ning 3 -piniga ulang

Segmentning C pinini CloudX -ning 4 -piniga

Segmentning D pinini CloudX -ning 5 -piniga ulang

Segmentning E pinini CloudX -ning 6 -piniga ulang

Segmentning F pinini CloudX -ning 7 -piniga ulang

Segmentning G pinini CloudX -ning 9 -piniga ulang

umumiy katod pinini GND ga ulang

Klaviatura qator pinining pinA 10k rezistorga va mikrokontrollerning pin12 ga ulangan.

Klaviatura qator pinining pinB 10k rezistorga va mikrokontroller pin 13 ga ulangan.

Klaviatura qator pinining pinC 10k rezistorga va mikrokontrollerning pin 14 ga ulangan.

Klaviatura qator pinining pinD 10k rezistorga va mikrokontroller pin15 ga ulangan.

Rezistorning oxiri GND bilan birlashtirilgan.

Klaviatura qatori pin 1 -pin mikrokontroller pin10 -ga ulangan.

Klaviatura qatori pin 2 -bandi mikrokontroller pin11 -ga ulangan.

Klaviatura qatori pin pin3 mikrokontroller pin 12 ga ulangan.

3 -qadam: KODLASH

Ushbu kodni CloudX IDE -ga nusxalash.

#include #include #include #define NumberOfRows 4 #deofine NumberOfColumns 3 char KeypadCharacters [NumberOfRows] [NumberOfColumns] = {'1', '2', '3', '4', '5', '6', '7 ',' 8 ',' 9 ','*',' 0 ','#'}; // klaviatura tugmachalari char RowPins sxemasi [NumberOfRows] = {12, 13, 14, 15}; char ColumnsPins [NumberOfColumns] = {9, 10, 11}; char kalitlari; // O'nta alohida char o'zgaruvchini yaratish o'rniga, biz ularni imzosiz char seg = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F} guruhlash uchun massiv yaratamiz; setup () {// bu erda sozlash Keypad_setting (PULLDOWNROW, RowPins, ColumnsPins, NumberOfRows, NumberOfColumns, KeypadCharacters); // klaviaturani ushbu ma'lumotlar bilan ishga tushirish // Segment_setting (CCathode, NumberOfDigit, segmentScanPins, segmentDataPins); portMod (1, OUTPUT); // raqamli kirish -chiqish 1 portini OUTPUT portWrite (1, OFF_ALL) sifatida sozlash; // 1 -portni o'chirish/o'chirish () {// Bu erda dastur

Kalitlar = getKey (); // klaviatura tugmachalarini bosishni tekshiring

if (Keys! = 0) portWrite (1, seg [Keys - 48]); // yozish tugmasi 7 segmentda bosiladi

}

}

4 -qadam: BIZ BILAN ULASHING

Bu erda o'z yutuqlaringizni biz bilan baham ko'ring

Tavsiya: