-
PROHARDVER!
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
#96292352
törölt tag
válasz
#96292352 #1146 üzenetére
Ebben van a baj:
int DHpin = 7;
int DH2pin = 9;
byte dat [5];
byte dat2 [5];
byte read_data () {
byte data;
for (int l = 0; l < 8; l ++) {
if (digitalRead (DHpin) == LOW) {
while (digitalRead (DHpin) == LOW); // wait for 50us
delayMicroseconds (30); // determine the duration of the high level to determine the data is '0 'or '1'
if (digitalRead (DHpin) == HIGH)
data |= (1 << (7-l)); // high front and low in the post
while (digitalRead (DHpin) == HIGH); // data '1 ', wait for the next one receiver
}
}/* 2nd sensor */
byte dat2;
for (int i = 0; i < 8; i ++) {
if (digitalRead (DH2pin) == LOW) {
while (digitalRead (DH2pin) == LOW); // wait for 50us
delayMicroseconds (30); // determine the duration of the high level to determine the data is '0 'or '1'
if (digitalRead (DH2pin) == HIGH)
data |= (1 << (7-i)); // high front and low in the post
while (digitalRead (DH2pin) == HIGH); // data '1 ', wait for the next one receiver
}
}
return data;
}
Új hozzászólás Aktív témák
- AKCIÓ! GIGABYTE AORUS MASTER RX 6800 XT 16GB videokártya garanciával hibátlan működéssel
- Motorola G72 128GB, Kártyafüggetlen, 1 Év Garanciával
- Apple iPhone 13 128GB, Kártyafüggetlen, 1 Év Garanciával
- Samsung Galaxy S23 Ultra 256GB, Kártyafüggetlen, 1 Év Garanciával
- iKing.Hu - Samsung S25 Ultra - Titanium Black - Használt, karcmentes
Állásajánlatok
Cég: PC Trade Systems Kft.
Város: Szeged
Cég: PC Trade Systems Kft.
Város: Szeged