Skip to content

Instantly share code, notes, and snippets.

@mithi
Created June 26, 2015 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mithi/eafb654a88cce62d43fc to your computer and use it in GitHub Desktop.
Save mithi/eafb654a88cce62d43fc to your computer and use it in GitHub Desktop.
testing infrared reflectance sensors and the ultrasonic rangefinder sensor in arbotics sparki
#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