- AMD K6-III, és minden ami RETRO - Oldschool tuning
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Intel Core i3 / i5 / i7 / i9 10xxx "Comet Lake" és i3 / i5 / i7 / i9 11xxx "Rocket Lake" (LGA1200)
- Milyen belső merevlemezt vegyek?
- Kezdő fotósok digitális fényképei
- Milyen processzort vegyek?
- Milyen monitort vegyek?
- Vezetékes FÜLhallgatók
- Házimozi belépő szinten
- Home server / házi szerver építése
-
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
-
Tomika86
senior tag
// Fordulatszám méréshez
const int hallPin = 2; // pin 2 = int 0
volatile unsigned long cntTime = 0;
volatile unsigned long cnt = 0;
volatile unsigned long rpm = 0;
unsigned long readings[numReadings];
unsigned long readIndex;
unsigned long total;
unsigned long average;
const byte numReadings = 2;
unsigned long measureTime = 0, curTime, startTime = 0;
int dispCnt = 0, measureCnt = 0;
const int resetTime = 2000;
const int minRotNum = 1; // 1 - calc after every rotation
void loop()
{
curTime = millis();
if ( curTime - cntTime > resetTime) // reset when less than 30RPM (dt>2s)
{
cnt = measureCnt = 0;
rpm = 0;
}
if (cnt == 1) startTime = cntTime;
if (cnt - measureCnt >= minRotNum) {
rpm = 60000L * (cnt - measureCnt) / (cntTime - measureTime);
measureCnt = cnt;
measureTime = cntTime;
}
// Smoothing RPM:
total = total - readings[readIndex];
readings[readIndex] = rpm;
total = total + readings[readIndex];
readIndex = readIndex + 1;
if (readIndex >= numReadings)
{
readIndex = 0;
}
average = total / numReadings;
}
void doCount()
{
cnt++;
cntTime = millis();
}
Új hozzászólás Aktív témák
- Audi, Cupra, Seat, Skoda, Volkswagen topik
- Fotók, videók mobillal
- Le Mans Ultimate
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Xbox Series X|S
- Battlefield 4
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Intel Core i3 / i5 / i7 / i9 10xxx "Comet Lake" és i3 / i5 / i7 / i9 11xxx "Rocket Lake" (LGA1200)
- Intel Dual Core 2000 felhasználók barátságos offolós topikja
- EAFC 25
- További aktív témák...
- Bomba ár! Dell Inspiron 15 5578 2in1: i7-7GEN I 16GB I 256SSD I 15,6" FHD Touch I Cam I W11 I Gari!
- Dell OptiPlex MT/SFF 3040, 3050, 7050, 3060, 3070, 5070, 7060 /WIN 11 - SZÁMLA- GARANCIA
- Bomba ár! Lenovo IdeaPad V110 - i3-6GEN I 4GB I 128GB SSD I 15,6" I HDMI I Cam I W10 I Garancia!
- BESZÁMÍTÁS! MSI B450M R5 5600 16GB DDR4 512GB SSD RTX 3060 12GB THERMALTAKE Core V21 Enermax 650W
- AKCIÓ! Lenovo Thinkpad P15 Gen1 15 FHD notebook - i7 10750H 16GB RAM 512GB SSD Quadro T1000 W11
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: PC Trade Systems Kft.
Város: Szeged