Skip to content

Commit

Permalink
example comments
Browse files Browse the repository at this point in the history
  • Loading branch information
siteswapjuggler committed Feb 5, 2020
1 parent 165bdbf commit eaf635c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions examples/grain_test/grain_test.ino
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
#include <Ramp.h>
#include <Ramp.h> // include library

int lastValue;
rampInt myRamp;
int lastValue; // global variable
rampInt myRamp; // new int ramp object

void setup() {
Serial.begin(2000000);
myRamp.setGrain(1);
myRamp.go(5000,0,LINEAR);
myRamp.go(0, 15);
Serial.println();
Serial.begin(115200); // begin Serial communication
myRamp.setGrain(1); // set grain to 1 ms
myRamp.go(5000); // set value to directly to 5000
myRamp.go(0, 15, LINEAR, LOOPFORWARD); // go to 0 in 15 ms
}

void loop() {
int val = myRamp.update();
if (val != lastValue) {
int val = myRamp.update(); // store updated value
if (val != lastValue) { // print updated value and completion percentage
Serial.print(val);
Serial.print("\t|\t");
Serial.print(myRamp.getCompletion());
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_test/simple_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ void setup() {
void loop() {
Serial.print("Actual value is: "); //
Serial.println(myRamp.update()); // update() return the actual interpolation value
delay(100);
delay(100); //
}

0 comments on commit eaf635c

Please sign in to comment.