Hirdetés
- sziku69: Fűzzük össze a szavakat :)
- Luck Dragon: Asszociációs játék. :)
- droidic: Safe Mode az agyban
- urandom0: Száműztem az AI-t az életemből
- GoodSpeed: Munkaügyi helyzet Hajdú-Biharban: észak és dél
- Sapphi: StremHU | Source – Self-hostolható Stremio addon magyar trackerekhez
- Peter Kiss: Somogyi internet rádió INR 5000/BK
- Gurulunk, WAZE?!
- sziku69: Szólánc.
- droidic: [Memory Leak] Az agy defragmentálása
-
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
- E-book olvasók
- AMD Ryzen 9 / 7 / 5 7***(X) "Zen 4" (AM5)
- Vezeték nélküli fejhallgatók
- Tőzsde és gazdaság
- Nem indul és mi a baja a gépemnek topik
- Star Trek
- Billentyűzet-választó: mechanikus vs membrános – kinek melyik a jobb?
- Az SK Hynix elárulta, hogy meddig nem lesz elég memória
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Soundbar, soundplate, hangprojektor
- További aktív témák...
- Crucial Pro 48GB (2x24GB) DDR5 5600MHz CL46 - XMP/EXPO - 120 hó garancia
- Corsair VENGEANCE RGB 64GB (2x32GB) DDR5 6000MHz CL30 - XMP/EXPO - 120 hó garancia
- Kingston FURY Beast 64GB (2x32GB) DDR5 5200MHz CL40 - XMP - 99 hó garancia
- Sony G 24-105 f/4 - Sigma 50mm f/1.4 Art (SONY E)
- Összeszerelésre váró komplett gépezet várja új gazdáját!
- ÁRGARANCIA!Épített KomPhone i7 14700KF 32/64GB RAM RTX 5070 Ti 16GB GAMER PC termékbeszámítással
- BESZÁMÍTÁS! ASUS H510M i7 11700 16GB DDR4 500GB SSD RTX 3060 Ti OC 8GB Zalman Z1 PLUS ADATA 600W
- Dell Latitude 7210 2-in-1 12" FHD touch, i7 10610U, 16GB RAM, 512GB SSD, jó akku, számla, 6 hó gar
- HP Thunderbolt 4 kábel
- Eladó egy oneplus 9 pro 256/12
Állásajánlatok
Cég: ATW Internet Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
ekkold
