Untitled - ARDUINO 0.72 KB
                                
                                    // Include two libraries required to work
// with the module. Download at
// https://amperka.com/my/octoliner
#include <Wire.h>
#include <Octoliner.h>

// Sensor on the standard bus and address
Octoliner octoliner;

void setup() {
  Serial.begin(115200);
  octoliner.begin();
  // Setup lightness parameters
  octoliner.setSensitivity(200);
  octoliner.setBrightness(255);
}

void loop() {
  // Every 0.5 seconds. scan all 8 channels and
  //  output the values to Serial Monitor
  delay(500);
  for (int i = 0; i < 8; i++) {
    Serial.print(octoliner.analogRead(i));
    Serial.print("\t"); // separate with TABs
  }
  Serial.println(); // line feed at the end
}
                                
                            

Paste Hosted With By Paste.ly