Initial commit
This is just the 2018 code configured for PlatformIO
This commit is contained in:
20
lib/RotaryEncoder/examples/VelocityTest/VelocityTest.ino
Normal file
20
lib/RotaryEncoder/examples/VelocityTest/VelocityTest.ino
Normal file
@ -0,0 +1,20 @@
|
||||
#include <RotaryEncoder.h>;
|
||||
int val = 0;
|
||||
RotaryEncoder encoder(A0,A2,5,6,3000);
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(57600);
|
||||
}
|
||||
void loop()
|
||||
{
|
||||
int enc = encoder.readEncoder();
|
||||
int changevalue = 1;
|
||||
if(enc != 0) {
|
||||
val = val + (enc);
|
||||
val = min(val,4095);
|
||||
val = max(val,0);
|
||||
Serial.println(val);
|
||||
}
|
||||
delayMicroseconds(5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user