2025-03-23 23:41:54 +03:00

14 lines
491 B
C++

//==========================================================
// JOYSTIC
//==========================================================
// Helper function
float average(uint16_t pin, unsigned int times) { // Changed to uint16_t
unsigned long readings = 0;
for(int i=0; i<times; i++) readings += analogRead(pin);
return readings / times;
}
//==========================================================
// JOYSTIC
//==========================================================