Created
June 26, 2015 19:30
-
-
Save mithi/eafb654a88cce62d43fc to your computer and use it in GitHub Desktop.
testing infrared reflectance sensors and the ultrasonic rangefinder sensor in arbotics sparki
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Sparki.h> | |
void infraredReflectanceSensorsTest(){ | |
sparki.clearLCD(); | |
sparki.print("Edge Left: "); | |
sparki.println(sparki.edgeLeft()); | |
sparki.print("Line Left: "); | |
sparki.println(sparki.lineLeft()); | |
sparki.print("Line Center: "); | |
sparki.println(sparki.lineCenter()); | |
sparki.print("Line Right: "); | |
sparki.println(sparki.lineRight()); | |
sparki.print("Edge Right: "); | |
sparki.println(sparki.edgeRight()); | |
sparki.updateLCD(); | |
delay(200); | |
} | |
void rangeFinderTest(){ | |
sparki.beep(); | |
sparki.clearLCD(); | |
sparki.print(sparki.ping()); | |
sparki.updateLCD(); | |
delay(3000); | |
} | |
void setup(){ | |
} | |
void loop(){ | |
//rangeFinderTest(); | |
infraredReflectanceSensorsTest(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment