- Luck Dragon: Asszociációs játék. :)
- vrob: Az utolsó DOS játékok 1996 - 1997-ben, egy korszak lezárul
- Ndruu: Segíts kereshetővé tenni a PH-s arcképeket!
- Elektromos rásegítésű kerékpárok
- sziku69: Fűzzük össze a szavakat :)
- bitpork: Phautós tali a Balcsinál 2025 Augusztus 2 napján (szombat)
- f(x)=exp(x): A laposföld elmebaj: Vissza a jövőbe!
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- ldave: New Game Blitz - 2025
- sziku69: Szólánc.
Hirdetés
Talpon vagyunk, köszönjük a sok biztatást! Ha segíteni szeretnél, boldogan ajánljuk Előfizetéseinket!
-
LOGOUT
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
válasz
vargalex #15675 üzenetére
const byte PulsesPerRevolution = 2;
const unsigned long ZeroTimeout = 100000; // For high response time, a good value would be 100000.
// For reading very low RPM, a good value would be 300000.
// Calibration for smoothing RPM:
const byte numReadings = 2; // Number of samples for smoothing. The higher, the more smoothing, but it's going to
// react slower to changes. 1 = no smoothing. Default: 2.
/////////////
// Variables:
/////////////
volatile unsigned long LastTimeWeMeasured; // Stores the last time we measured a pulse so we can calculate the period.
volatile unsigned long PeriodBetweenPulses = ZeroTimeout+1000; // Stores the period between pulses in microseconds.
// It has a big number so it doesn't start with 0 which would be interpreted as a high frequency.
volatile unsigned long PeriodAverage = ZeroTimeout+1000; // Stores the period between pulses in microseconds in total, if we are taking multiple pulses.
// It has a big number so it doesn't start with 0 which would be interpreted as a high frequency.
unsigned long FrequencyRaw; // Calculated frequency, based on the period. This has a lot of extra decimals without the decimal point.
unsigned long FrequencyReal; // Frequency without decimals.
unsigned long RPM; // Raw RPM without any processing.
unsigned int PulseCounter = 1; // Counts the amount of pulse readings we took so we can average multiple pulses before calculating the period.
unsigned long PeriodSum; // Stores the summation of all the periods to do the average.
unsigned long LastTimeCycleMeasure = LastTimeWeMeasured;
unsigned long CurrentMicros = micros();
unsigned int AmountOfReadings = 1;
unsigned int ZeroDebouncingExtra; // Stores the extra value added to the ZeroTimeout to debounce it.
// The ZeroTimeout needs debouncing so when the value is close to the threshold it
// doesn't jump from 0 to the value. This extra value changes the threshold a little
// when we show a 0.
// Variables for smoothing tachometer:
unsigned long readings[numReadings]; // The input.
unsigned long readIndex; // The index of the current reading.
unsigned long total; // The running total.
unsigned long average; // The RPM value after applying the smoothing.Annyit szeretnék, hogy ami itt 3db const van, azokat az értékeket, kijelzőn keresztül szeretném módosítani. De nem működik.
Persze a const elhagyva, és itt van a Zerotimeoutnál a +1000
Új hozzászólás Aktív témák
- Őszre feketét ölt a THEC64 Mini
- Gaming notebook topik
- One otthoni szolgáltatások (TV, internet, telefon)
- Temu
- Napelem
- Ubiquiti hálózati eszközök
- Telekom otthoni szolgáltatások (TV, internet, telefon)
- Luck Dragon: Asszociációs játék. :)
- Új szintre emeli a csalók elleni védelmet a Battlefield 6
- Milyen monitort vegyek?
- További aktív témák...
- ÚJ Samsung OLED 4K Vision Smart TV-k (2025) - Gyári garanciával, számlával, ingyen szállítással
- Samsung S24D590PL 24" FHD monitor
- 2022 MacBook Air 13" / M2 / 8GB RAM / 256GB SSD / Ezüst / Garancia!
- LOQ 15APH8 15.6" FHD IPS Ryzen 7 7840HS RTX 4050 16GB 512GB NVMe magyar vbill gar
- MSI Cubi NUC 1M-072BCZ - wifi6E - 16GB DDR5 / 500GB SSD Win11 Pro
- BESZÁMÍTÁS! Gigabyte Z790 i7 14700KF 32GB DDR5 1TB SSD RTX 4070S 12GB Be Quiet! Pure Base 501 750W
- GYÖNYÖRŰ iPhone 13 mini 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3047, 94% Akkumulátor
- Új Dell 14 Inspiron 5435 FHD+ Ryzen7 7730U 4.5Ghz 16GB 512GB SSD Radeon RX Vega 8 Win11 Garancia
- Samsung Galaxy S23 128GB Kártyafüggetlen 1 év Garanciával
- Új FULL HD webkamera + Számla
Állásajánlatok
Cég: FOTC
Város: Budapest