Operácie

MEMS cvičenie 1

Z SensorWiki

Verzia z 18:31, 5. marec 2016, ktorú vytvoril Balogh (diskusia | príspevky) (Vytvorená stránka „ * Príklad na pripojenie analógového senzora: http://ap.urpi.fei.stuba.sk/sensorwiki/index.php/Acrob007 * Riadiaca doska Acrob http://ap.urpi.fei.stuba.sk/sensorwiki...“)
(rozdiel) ← Staršia verzia | Aktuálna úprava (rozdiel) | Novšia verzia → (rozdiel)


#define SerialSpeed 9600   //typical values are 9600 or 115200
#define SampFrequency 10   //sampling frequency in Hz (cycles per second)
#define positionSensor 5        //define your pin here
 
int mDelay;
int adcValue;
float outputValue;

void setup()
{
 Serial.begin(SerialSpeed);
 mDelay = 1000/SampFrequency; //calculate delay for proper sampling rate
}
 
void loop()
{
 adcValue = analogRead(positionSensor);
 /*  =============================================== */
 outputValue = adcValue;   // replace this line with your code 
 /*  =============================================== */
 Serial.print( outputValue ); //reads the analog port and prints value over serial
 Serial.print('\r');
 delay(mDelay); //delay in milliseconds

}


Odovzdať:

  • Chyby podľa EN 60 770
    • Nepresnosť
    • Meraná chyba
    • Nelinearita
    • Hysteréza
    • Neopakovateľnosť
  • Graf 1: prevodová charakteristika
  • Graf 2: chybové krivky (viď obr.)

Example1-1.png