Cov txheej txheem:

Web Txuas Cov Sijhawm Digital: 7 Kauj Ruam
Web Txuas Cov Sijhawm Digital: 7 Kauj Ruam

Video: Web Txuas Cov Sijhawm Digital: 7 Kauj Ruam

Video: Web Txuas Cov Sijhawm Digital: 7 Kauj Ruam
Video: Tsis xav ua neeg 7/8/2018 2024, Kaum ib hlis
Anonim
Web Txuas Txuas Digital
Web Txuas Txuas Digital

Pom $ 10 lub moos digital ntawm Amazon. Tam sim no los kho nws kom tau sijhawm los ntawm internet.

Khoom siv

ARM Stamp programmable hauv BASIC muaj nyob ntawm no

Kauj Ruam 1: Txuas Digit Drive thiab Segment Drive rau Multiplexed Display

Txuas Digit Drive thiab Segment Drive rau Multiplexed Display
Txuas Digit Drive thiab Segment Drive rau Multiplexed Display

Kuv pib nrog qhov pheej yig tawm ntawm tus lej loj tus lej digital. Ua ntej kuv tshem lub moos uas twb muaj lawm. Tom qab ntawd tau ua qee qhov kev soj ntsuam ib puag ncig thiab nyob ntawm 7 ntu kev sib txuas, uas tuaj yeem tsav ncaj qha los ntawm microprocessor. Tom qab ntawd pom 4 tus lej tsav tsheb uas yog transistors uas microprocessor tuaj yeem tsav tau. Thiab tom qab ntawd txuas cov ntawd.

Kauj Ruam 2: Xeem Kev Sib Txuas

Kuaj Cov Kev Sib Txuas
Kuaj Cov Kev Sib Txuas

Raws li kev sim kuv tau sau BASIC txoj haujlwm txhawm rau tsav txhua txoj kab, txhawm rau txheeb xyuas cov kab hluav taws xob thiab ntsuas qhov tam sim no, uas qhov no yog 82 mA

Tom ntej no yog sau cov cai los luam kab.

'web moos tso saib tsav

IO (7) = 0 'PMOS tsav - yuav yog PWM ib hnub

rau y = 45 rau 48

IO (y) = 0 'tus lej tsav

rau x = 8 rau 15

IO (x) = 0 'ntu tsav

tos (500)

IO (x) = 1

ntej x

DIR (y) = 0 'lov tes taw tsav ntawm ntu

tom ntej y

Kauj Ruam 3: Txoj Cai Los Zaub Lub Sijhawm thiab PWM los Tswj Lub Teeb

Code rau Zaub Lub Sijhawm thiab PWM los Tswj Lub Teeb
Code rau Zaub Lub Sijhawm thiab PWM los Tswj Lub Teeb
Code rau Zaub Lub Sijhawm thiab PWM los Tswj Lub Teeb
Code rau Zaub Lub Sijhawm thiab PWM los Tswj Lub Teeb

Tom ntej no kuv ntxiv PMOS transistor hauv lub zog muab rau txhua tus lej tsav tsheb. Nrog qhov uas tau tsav los ntawm kev ntsuas dav dav mem tes yuav tswj qhov ci ntawm cov zaub. Nov yog BASIC code los tso saib lub sijhawm.

'web moos tso saib tsav #include "LPC11U3x.bas"

'ntiaj teb

hr = 0 'txhais teev

min = 0 'txhais feeb

#define SEG_0 & HBB00

#define SEG_1 & H1800

#define SEG_2 & HD300

#define SEG_3 & HD900

#define SEG_4 & H7800

#define SEG_5 & HE900

#define SEG_6 & HEB00

#define SEG_7 & H9800

#define SEG_8 & HFB00

#define SEG_9 & HF800

#define SEG_o & H4B00

#define SEG_f & HE200

const DIGarray = {SEG_0, SEG_1, SEG_2, SEG_3, SEG_4, SEG_5, SEG_6, SEG_7, SEG_8, SEG_9, SEG_o, SEG_f}

#define DIG_WAIT 1

#Txheeb xyuas US_TIME

sub display_time (yuam kev, teev, min)

dim hr10, hr1, min10, min1, i

#ifdef US_TIME

yog hr> 12 ces hr -= 12

yog hr = 0 ces hr = 12

#ib

hr10 = hr / 10

hr1 = hr MOD 10

min10 = min / 10

min1 = min MOD 10

rau kuv = 0 rau 1

os hr10

IO (45) = 0

endif

GPIO_DIR (0) = (GPIO_DIR (0) & HFFFF00FF) + DIGarray (hr10)

GPIO_CLR (0) = DIGarray (hr10)

tos (DIG_WAIT)

NTUJ (45)

IO (46) = 0

GPIO_DIR (0) = (GPIO_DIR (0) & HFFFF00FF) + DIGarray (hr1) + IF (i, & H400, 0)

GPIO_CLR (0) = DIGarray (hr1) + YOG (i, & H400, 0)

tos (DIG_WAIT)

NTUJ (46)

IO (47) = 0

GPIO_DIR (0) = (GPIO_DIR (0) & HFFFF00FF) + DIGarray (min10)

GPIO_CLR (0) = DIGarray (min10)

tos (DIG_WAIT)

NTUJ (47)

IO (48) = 0

GPIO_DIR (0) = (GPIO_DIR (0) & HFFFF00FF) + DIGarray (min1)

GPIO_CLR (0) = DIGarray (min1)

tos (DIG_WAIT)

NTUJ (48)

tom ntej i

xaus

'neeg siv TIMER1 (32 ntsis) los cuam tshuam txhua feeb

INTERRUPT SUB TIMER1IRQ

T1_IR = 1 'Tshem tawm kev cuam tshuam

min += 1

yog min> 59 ces

min = 0 hli

hr = np

yog tias hr> 23 ces

hr = 0 os

endif

endif

ENDSUB

SUB ON_TIMER (max_cnt, dothis)

TIMER1_ISR = dothis + 1 'teeb tsa kev ua haujlwm ntawm VIC - xav tau +1 rau kev ua haujlwm ntiv tes xoo

SYSCON_SYSAHBCLKCTRL LOS YOG = (1 << 10) 'pab TIMER1

T1_PR = 0 'tsis muaj prescale - yuav kho tus nqi kom raug rau lub sijhawm

VICIntEnable LOSSIS = (1 << TIMER1_IRQn) 'Pab kom cuam tshuam

T1_MR0 = max_cnt-1 'teeb tsa tus lej sib tw ntawm ms

T1_MCR = 3 'cuam tshuam thiab rov pib dua

MR0 T1_IR = 1 'meej cuam tshuam

T1_TC = 0 'timer timer tseeb

T1_TCR = 1 'TIMER1 Pab kom

ENDSUB

#define MINUT_PCLK 2880000000 '60 vib nas this ntawm 48 MHz

lub ntsiab:

hnu = 9

min = 33 hli

ON_TIMER (MINUT_PCLK, ADDRESSOF TIMER1IRQ)

IO (7) = 0 'PWM qee hnub - xav tau txav mus rau P0_22 ??

thaum 1

display_time (0, teev, min)

voj

Kauj Ruam 4: Ua Kev Sib Txuas Internet

Ua Kev Sib Txuas Internet
Ua Kev Sib Txuas Internet

Siv ESP8266 rau kev sib txuas WiFi. Tom qab poking ncig lub vev xaib ib ntus qhov kev daws teeb meem zoo tshaj plaws yog nodemcu version 0.9.6 thiab cov laus esp8266_flasher ua haujlwm tau zoo tshaj plaws.

www.electrodragon.com/w/File:Nodemcu_20150704_firmware.zip

Tom qab ntawd yooj yim PHP webpage los ua haujlwm lub sijhawm los ntawm internet-

Coridium Sijhawm Server

<? php cov

$ timezone = htmlspecialchars ($ _ GET ["cheeb tsam"]); yog ($ timezone == "")

$ timezone = 'America/Los_Angeles';

$ tz_object = DateTimeZone tshiab ($ sijhawm zone);

$ datetime = tshiab DateTime ();

$ datetime-> setTimezone ($ tz_object);

ncha "sijhawm yog", $ datetime-> hom ntawv ('H: i: s');

ncha "";

ncha "date is-", $ datetime-> format ('m/d/Y');

?>

Lub vev xaib ntawd yog li koj tuaj yeem thov

coridium.us/time.php - thiab koj tau txais Asmeskas thaj tsam sijhawm Pacific

los yog

coridium.us/time.php?zone=Europe/London

Tsis muaj qhov yuam kev tshawb xyuas thiab feem ntau yuav tsis yog

Thiab Lua los nyeem qhov ntawd -

wifi.sta.config ("your_SSID", "your_PASSWORD")> wifi.sta.connect () …

sk = net.createConnection (net. TCP, 0)

sk: on ("tau txais", muaj nuj nqi (sck, c) luam tawm (c) kawg)

sk: txuas (80, "coridium.us")

sk: xa ("GET/time.php HTTP/1.1 / r / nHost: coridium.us / r / nConnection: khaws-ciaj sia / r / nAccept: */ *\ r / n / r / n")

Thiab koj tau txais lub sijhawm rov qab zoo li

sij hawm yog-09: 38: 49 hnub tim yog -2018-31-12

Kauj Ruam 5: Ntxiv BASIC Code txhawm rau txheeb xyuas Lub Sijhawm Los Ntawm Lub Vev Xaib

Ntxiv BASIC Code txhawm rau txheeb xyuas Lub Sijhawm Los Ntawm Lub Vev Xaib
Ntxiv BASIC Code txhawm rau txheeb xyuas Lub Sijhawm Los Ntawm Lub Vev Xaib

Nov yog ntu me me ntawm kev ua tiav BASIC, qhov kev zov me nyuam tuaj yeem pom ntawm qhov txuas hauv qib kawg.

yog strstr (build_gets, "lub sij hawm yog-") = 0 ces

hr = build_gets (8) - "0"

yog build_gets (9) = ":" ces

min = (build_gets (10) - "0")*10

min += build_gets (11) - "0"

lwm tus

hr = hr * 10 + build_gets (9) - "0"

min = (build_gets (11) - "0")*10

min += build_gets (12) - "0"

endif

endif

Kauj Ruam 6: Ntxiv Lub Teeb Sensor thiab Code kom Dim Zaub

Ntxiv Lub Teeb Sensor thiab Code kom Dim Zaub
Ntxiv Lub Teeb Sensor thiab Code kom Dim Zaub
Ntxiv Lub Teeb Sensor thiab Code kom Dim Zaub
Ntxiv Lub Teeb Sensor thiab Code kom Dim Zaub
Ntxiv Lub Teeb Sensor thiab Code kom Dim Zaub
Ntxiv Lub Teeb Sensor thiab Code kom Dim Zaub

Ib daim duab transistor tau ntxiv los nkag siab lub teeb pom kev hauv chav. Tsis muaj nws cov zaub yog ci txaus kom sawv tuag (kuv) thaum hmo ntuj.

Qhov sib piv qhov hluav taws xob ntawm qhov tso tawm ntawm daim duab transistor tau nyeem thiab qhov ntsuas qhov dav ntawm tes taw tes teeb tsa tag nrho qhov ci ntawm cov zaub.

Kauj Ruam 7: Khawm Up Clock thiab Pib Siv Nws

Khawm Sijhawm thiab Pib Siv Nws
Khawm Sijhawm thiab Pib Siv Nws

Qhov kawg version qhia lub sijhawm, thiab nyob ib puag ncig 3 teev sawv ntxov nws tawm mus rau lub vev xaib los nyeem lub sijhawm tam sim no. Qhov no tseem ua haujlwm lub sijhawm txuag hnub.

Kev txhawb siab rau txoj haujlwm no yog lub zog tsis ua tiav uas peb tau ntsib ntawm no hauv toj siab thiab xav tau hloov lub moos lossis hloov roj teeb kom lawv muaj txoj sia nyob.

Qhov no tau ua tiav nrawm ntawm txoj haujlwm.

Cov ncauj lus kom ntxaws ntawm DIY lub vev xaib txuas nrog lub moos.

Pom zoo: