Cov txheej txheem:
- Kauj Ruam 1: Yam Koj Xav Tau..
- Kauj ruam 2: Kev sib txuas
- Kauj ruam 3: Code
- Kauj ruam 4: Cov ntawv thov..:
Video: Raspberry Pi MCP9803 Kub Sensor Java Qhia: 4 Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:26
MCP9803 yog 2-xaim siab qhov ntsuas kub. Lawv tau suav nrog cov npe siv tau-programmable uas pab txhawb kev thov ntsuas kub. Qhov ntsuas no haum rau kev siv ntau qhov chaw ntsuas kub ntau. Nov yog qhov ua piv txwv nrog java code siv Raspberry Pi.
Kauj Ruam 1: Yam Koj Xav Tau..
1. Raspberry Pi
2. MCP9803
3. I²C Cable
4. I²C Shield rau Raspberry Pi
5. Ethernet Cable
Kauj ruam 2: Kev sib txuas
Siv I2C daim thaiv rau raspberry pi thiab maj mam thawb nws hla gpio pins ntawm raspberry pi.
Tom qab ntawd txuas ib qho kawg ntawm I2C cable rau MCP9803 sensor thiab lwm qhov kawg rau I2C daim ntaub thaiv.
Kuj txuas Ethernet cable rau pi lossis koj tuaj yeem siv WiFi module. Kev sib txuas tau qhia hauv daim duab saum toj no.
Kauj ruam 3: Code
Tus lej java rau MCP9803 tuaj yeem rub tawm los ntawm peb qhov chaw cia khoom github- Dcube Store
Nov yog qhov txuas rau tib yam:
github.com/DcubeTechVentures/MCP9803/blob/master/Java/MCP9803.java
Peb tau siv pi4j tsev qiv ntawv rau java code, cov kauj ruam rau nruab pi4j ntawm raspberry pi tau piav qhia ntawm no:
pi4j.com/install.html
Koj tseem tuaj yeem luam cov cai los ntawm no, nws tau muab raws li hauv qab no:
// Faib nrog daim ntawv tso cai yuav dawb.
// Siv nws txhua txoj hauv kev uas koj xav tau, muaj txiaj ntsig lossis pub dawb, muab nws haum rau hauv daim ntawv tso cai ntawm nws cov haujlwm ua haujlwm.
NPE MC9803
// Cov cai no tau tsim los ua haujlwm nrog MCP9808_I2CS I2C Mini Module
ntshuam com.pi4j.io.i2c. I2CBus;
ntshuam com.pi4j.io.i2c. I2CDevice;
ntshuam com.pi4j.io.i2c. I2CFactory;
ntshuam java.io. IOException;
pej xeem hauv chav kawm MCP9803
{
pej xeem zoo li qub tsis muaj dab tsi tseem ceeb (Txoj hlua args ) cuam tshuam zam
{
// Tsim I2C npav
I2CBus Bus = I2CFactory.getInstance (I2CBus. BUS_1);
// Tau txais I2C ntaus ntawv, MCP9803 I2C chaw nyob yog 0x48 (72)
I2CDevice ntaus ntawv = Bus.getDevice (0x48);
// Xaiv cov npe sau npe
// Kev hloov pauv tas li, Lub zog hloov pauv, hom sib piv, 12-ntsis kev daws teeb meem
ntaus ntawv.write (0x01, (byte) 0x60);
Xov.sleep (500);
// Nyeem 2 bytes ntawm cov ntaub ntawv los ntawm chaw nyob 0x00 (0)
// temp msb, kub lsb
byte cov ntaub ntawv = tshiab byte [2];
device.read (0x00, cov ntaub ntawv, 0, 2);
// Hloov cov ntaub ntawv mus rau 12-ntsis
int temp = ((cov ntaub ntawv [0] & 0xFF) * 256 + (data [1] & 0xF0)) / 16;
yog (temp> 2047)
{
temp -= 4096;
}
ob cTemp = temp * 0.0625;
ob fTemp = cTemp * 1.8 + 32;
// Cov ntaub ntawv tso tawm rau lub vijtsam
System.out.printf ("Kub hauv Celsius yog: %.2f C %n", cTemp);
System.out.printf ("Kub hauv Fahrenheit yog: %.2f F %n", fTemp);
}
}
Kauj ruam 4: Cov ntawv thov..:
MCP9803 tuaj yeem ua haujlwm hauv thaj chaw dav ntawm cov khoom siv uas suav nrog lub khoos phis tawj ntiag tug thiab lwm yam khoom siv, hard disk drive, ntau yam kev lom zem, kev ua haujlwm hauv chaw haujlwm thiab cov ntaub ntawv sib txuas lus. Qhov ntsuas no tuaj yeem suav nrog hauv ntau lub tshuab ntse.
Pom zoo:
Raspberry Pi MCP9805 Kub Sensor Java Qhia: 4 Kauj Ruam
Raspberry Pi MCP9805 Kub Sensor Java Qhia: MCP9805 yog lub cim xeeb ntsuas cov ntsuas kub. Nws tau suav nrog cov neeg siv cov ntawv sau npe uas muab kev yooj yim rau kev ntsuas qhov ntsuas kub. Qhov ntsuas no tau tsim los koom nrog hauv mobile platform memory module tem
Raspberry Pi - TMP100 Kub Sensor Java Qhia: 4 Kauj Ruam
Raspberry Pi-TMP100 Kub Sensor Java Qhia: TMP100 Qhov Tseeb, Tsawg-Lub Hwjchim, Cov Kub Kub Sensor I2C MINI module. TMP100 yog qhov zoo tshaj rau kev ntsuas kub ntxiv. Cov cuab yeej no muab qhov tseeb ntawm ± 1 ° C yam tsis tas yuav ntsuas qhov ntsuas lossis sab nrauv tiv thaiv teeb liab. Nws
ESP32 Raws M5Stack M5stick C Huab Cua Saib Nrog DHT11 - Saib Xyuas Qhov Kub Kub & Qhov Kub Kub ntawm M5stick-C Nrog DHT11: 6 Cov Kauj Ruam
ESP32 Raws M5Stack M5stick C Huab Cua Saib Nrog DHT11 | Saib Xyuas Qhov Kub thiab Qhov Ntsuas Kub ntawm M5stick-C Nrog DHT11: Nyob zoo cov neeg, hauv cov lus qhia no peb yuav kawm paub yuav ua li cas cuam tshuam DHT11 ntsuas kub nrog m5stick-C (pawg tswj hwm kev txhim kho los ntawm m5stack) thiab tso tawm ntawm cov zaub ntawm m5stick-C. Yog li hauv qhov kev qhia no peb yuav nyeem qhov ntsuas kub, av noo & heat kuv
Yuav Ua Li Cas Siv DHT11 Kub Sensor Nrog Arduino thiab Luam Kub Kub thiab Vaum: 5 Kauj Ruam
Yuav Ua Li Cas Siv DHT11 Kub Sensor Nrog Arduino thiab Luam Kub Kub thiab Vaum: Lub DHT11 sensor tau siv los ntsuas kub thiab av noo. Lawv yog cov khoom siv hluav taws xob nrov tshaj plaws.Qhov DHT11 cov av noo thiab ntsuas kub ua rau nws yooj yim ntxiv cov av noo thiab ntsuas kub rau koj li DIY cov phiaj xwm hluav taws xob. Nws yog rau
ESP32 NTP Kev Ntsuas Kub Ua Haujlwm Kub Kub Nrog Steinhart-Hart Kho thiab Tswb Kub: 7 Kauj Ruam (nrog Duab)
ESP32 NTP Kev Ntsuas Kub Ua Haujlwm Ntsuas Kub nrog Steinhart-Hart Kev Kho thiab Tswb Kub: Tseem tab tom taug kev kom ua tiav "qhov haujlwm yuav los tom ntej", "ESP32 NTP Kev Ntsuas Kub Kev Ntsuas Kub Ua Noj Nrog Steinhart-Hart Kev Kho thiab Tswb Kub" yog Cov Ntawv Qhia qhia yuav ua li cas kuv ntxiv NTP ntsuas kub, piezo b