Skip to content

Instantly share code, notes, and snippets.

@futureshocked
Created February 26, 2025 03:00
Show Gist options
  • Save futureshocked/7bf17392aa56d1eece1063049c2ec845 to your computer and use it in GitHub Desktop.
Save futureshocked/7bf17392aa56d1eece1063049c2ec845 to your computer and use it in GitHub Desktop.
Photosensor tester for techexplorations.com/blog/course/advanced-pcb-design-kicad
#define TEMT6000_PIN 1 // GPIO pin connected to the TEMT6000X01 sensor
void setup() {
// Start the serial communication
Serial.begin(115200);
while (!Serial);
// Configure the analog pin
pinMode(TEMT6000_PIN, INPUT);
}
void loop() {
// Read the value from the TEMT6000X01 sensor (analog reading)
int sensorValue = analogRead(TEMT6000_PIN);
// Print the sensor value to the Serial Monitor
Serial.print("Sensor Value: ");
Serial.println(sensorValue);
// Wait a bit before reading again
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment