Created
February 26, 2025 03:00
-
-
Save futureshocked/7bf17392aa56d1eece1063049c2ec845 to your computer and use it in GitHub Desktop.
Photosensor tester for techexplorations.com/blog/course/advanced-pcb-design-kicad
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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