Cov txheej txheem:

7-ntu rau Zaub ADC #Arduino Qhov Tseem Ceeb, #Arduino: 4 Kauj Ruam
7-ntu rau Zaub ADC #Arduino Qhov Tseem Ceeb, #Arduino: 4 Kauj Ruam

Video: 7-ntu rau Zaub ADC #Arduino Qhov Tseem Ceeb, #Arduino: 4 Kauj Ruam

Video: 7-ntu rau Zaub ADC #Arduino Qhov Tseem Ceeb, #Arduino: 4 Kauj Ruam
Video: Dais thiab nab qa sib xeem tsheb kauj vab 2024, Kaum ib hlis
Anonim
7-ntu rau Zaub ADC #Arduino Qhov Tseem Ceeb, #Arduino
7-ntu rau Zaub ADC #Arduino Qhov Tseem Ceeb, #Arduino
7-ntu rau Zaub ADC #Arduino Qhov Tseem Ceeb, #Arduino
7-ntu rau Zaub ADC #Arduino Qhov Tseem Ceeb, #Arduino

Hauv kab lus no kuv yuav ua qhov haujlwm uas tseem cuam tshuam nrog tsab xov xwm dhau los. Namely ua cov ntaub ntawv ADC.

yog li koj tsis tas yuav muaj tus saib xyuas kom pom tus nqi ntawm cov ntaub ntawv adc. hauv kab lus no kuv yuav ua ADC Tus saib tus nqi saib. yog li koj tsis tas yuav muaj tus saib xyuas kom pom tus nqi ntawm cov ntaub ntawv adc. hauv kab lus no kuv yuav ua tus saib xyuas ADC Tus Nqi Zoo.

Koj tuaj yeem nyeem kab lus hauv qab no kom paub seb yuav siv "7-Segment" Module li cas

"MAX7219 7-Segment Siv Arduino"

Kauj Ruam 1: Cov Cheeb Tsam Xav Tau

Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam
Yuav tsum tau Cheebtsam

Cheebtsam xav tau rau kab lus no:

  • MAX7219 7-Segment Module
  • Arduino Nano Cov
  • hlau Jumper
  • USB mini tso
  • Potentiometer

Kauj Ruam 2: Sib Sau Ua Ke

Sib sau ua ke
Sib sau ua ke
Sib sau ua ke
Sib sau ua ke

Saib cov txheej txheem saum toj no los ua ke cov khoom kom raug.

Aeduino rau Cheeb Tsam

+5V ==> 3. Potentiometer & VCC

GND ==> 1. Potentometer & GND

A0 ==> 2. Potensio

D12 ==> Cov ntaub ntawv IN

D11 ==> CLK

D10 ==> CS

Kauj ruam 3: Programming

Luam thiab paste cov cai hauv qab no:

#suav nrog "LedControl.h"

LedControl lc = LedControl (12, 11, 10, 1);

void teeb tsa () {

Serial.begin (9600); lc.shutdown (0, tsis tseeb); lc.setIntensity (0, 8); lc.clearDisplay (0); }

void voj () {

int adc = analogRead (A0);

lc.setDigit (0, 7, adc/1000, tsis tseeb);

lc.setDigit (0, 6, (adc/100)%10, tsis tseeb); lc.setDigit (0, 5, (adc/10)%10, tsis tseeb); lc.setDigit (0, 4, adc%10, tsis tseeb);

Serial.println (adc);

ncua (100); }

Cov ntaub ntawv qub tuaj yeem rub tawm hauv qab no:

Kauj Ruam 4: Qhov tshwm sim

rau cov txiaj ntsig tuaj yeem pom hauv video saum toj no.

thaum lub zog ntsuas tau tig mus rau sab xis, tus nqi yuav ntau dua thiab hais hauv 1023)

thaum lub zog txav tau txav mus rau sab laug, tus nqi yuav ntau dua thiab hais tawm ntawm 1023)

Pom zoo: