Hirdetés
- Hobby elektronika
- Milyen videókártyát?
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Bambu Lab 3D nyomtatók
- Vezeték nélküli fülhallgatók
- AMD Ryzen 9 / 7 / 5 / 3 5***(X) "Zen 3" (AM4)
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- 5.1, 7.1 és gamer fejhallgatók
- Nvidia GPU-k jövője - amit tudni vélünk
- Milyen monitort vegyek?
-
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
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
- One otthoni szolgáltatások (TV, internet, telefon)
- ASUS routerek
- Milyen routert?
- Youtube Android alkalmazás alternatívák reklámszűréssel / videók letöltése
- Hobby elektronika
- PlayStation 4
- E-roller topik
- Milyen videókártyát?
- LEGO klub
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- További aktív témák...
- Eladó két darab JBL PartyBox 520 hangszóró újszerű állapot, 34hónap garanciával!
- Megválnék a fotós arzenálomtól 6D MkII, Sigma üvegek, vakuk, és még sok más
- DELL T3620 WORKSTATION INTEL XEON I7-6700 / NVME SSD / DDR4 - vga tápkábel
- Gamer PC - R5 5500, RTX 2060 és 16gb RAM + GARANCIA
- 2025-Ös 10 Magos Legújabb Intel Core Ultra 5 225F 10x4.9Ghz RTX 5060TI 16/32Gb DDR5 5600Mhz 1TB M.2
- Új Dell 13 Inspiron 5310 FHD+ IPS i5-11300H 4.4Ghz 8GB 256GB Intel Iris XE Graphics Win11 Garancia
- HIBÁTLAN iPhone 13 Pro Max 128GB Graphite -1 ÉV GARANCIA - Kártyafüggetlen, MS3391
- Azonnali készpénzes nVidia RTX 5000 sorozat videokártya felvásárlás személyesen / csomagküldéssel
- Motorola E40 64GB, Kártyafüggetlen, 1 Év Garanciával
- Ha országosan a legmagasabb áron szeretnéd eladni a laptopodat, akkor az ELITRO a Te partnered
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest