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

  • Finally, you can manage your Google Docs, uploads, and email attachments (plus Dropbox and Slack files) in one convenient place. Claim a free account, and in less than 2 minutes, Dokkio (from the makers of PBworks) can automatically organize your content for you.


Reading Light Sensor data on an Amber Display

Page history last edited by Dora 9 years 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.