#include #include /*************************************************** /MINDS-i Calibration. mymindsi.com / /Encoder Calibration / /This Encoder Calibration code is used to test /and adjust your encoder as well as to establish /the measurement that it’s reading. / /To learn more about the encoder visit: /http://www.usdigital.com/products/encoders/incremental/rotary/kit/e2 /***************************************************/ float val; int dist; void setup() { Serial.begin(9600); //start a serial connection startEncoder(); //start the encoder counter } void loop() { val = getRPM(); //read the average rpm of the last 50th of a second dist = getSteps(); //read the total steps the encoder has moved Serial.print("RPM: "); //send a string or value on the serial connection Serial.print(val,DEC); Serial.print(" Steps: "); Serial.println(dist); }