Skip to content

Commit

Permalink
Comments on full example.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Jun 27, 2023
1 parent 247e590 commit 7ced051
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/full_example/full_example.ino
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
/*
Full example for PH4502C_Sensor.h
By: Nathanne Isip
27/06/2023
*/

#include <ph4502c_sensor.h>

// Define the pH level pin and temperature pin
#define PH4502C_PH_LEVEL_PIN A0
#define PH4502C_TEMP_PIN A1

// Create an instance of the PH4502C_Sensor
PH4502C_Sensor ph4502(PH4502C_PH_LEVEL_PIN, PH4502C_TEMP_PIN);

void setup() {
Serial.begin(9600);
Serial.println("Starting PH4502C Sensor...");

// Initialize the PH4502 instance
ph4502.init();
}

void loop() {
// Read the temperature from the sensor
Serial.println("Temperature reading:"
+ String(ph4502.read_temp()));

// Read the pH level by average
Serial.println("pH Level Reading: "
+ String(ph4502.read_ph_level()));

// Read a single pH level value
Serial.println("pH Level Single Reading: "
+ String(ph4502.read_ph_level_single()));

Expand Down

0 comments on commit 7ced051

Please sign in to comment.