• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Whenever you search in PBworks or on the Web, Dokkio Sidebar (from the makers of PBworks) will run the same search in your Drive, Dropbox, OneDrive, Gmail, Slack, and browsed web pages. Now you can find what you're looking for wherever it lives. Try Dokkio Sidebar for free.


Reading Light Sensor data on an Amber Display

Page history last edited by Dora 10 years, 9 months ago













The code uploaded to the Arduino is here:

 * PrintTest
 * Arduino example by Mike Gionfriddo and Chris Ladden
 * This example demonstrates sending analog
 * values to the serial port. This sketch
 * is simply broadcasting an analog value
 * as a packet.
 * Notes:
 *      1.) Set the baud rate
 *      2.) Read some analog value
 *      3.) Print the value to the serial port

void setup()
    Serial.begin(115200);//setup a serial port with a baud of 115200
    pinMode(18, OUTPUT);
    pinMode(19, OUTPUT);
    digitalWrite(18, HIGH);
    digitalWrite(19, LOW);

void loop()
    int value = analogRead(3); //read arduino analog pin 3 and save it as an int to value
    delay(1000);//delay 1,000ms
    char out[200];//create a 200 integer array
    sprintf(out, "hi\nLight=%d\n", value);//prep the out file
    Serial.print(out);//print the out array






Comments (0)

You don't have permission to comment on this page.