From 980b310b6431840775317cdacb7c9a2048e013e4 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 21 Aug 2025 16:23:28 -0400 Subject: [PATCH] Update sensor_extension.c add sensor_buffer and sensor count --- sensor_extension.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sensor_extension.c b/sensor_extension.c index a53c6a3b..63961b37 100644 --- a/sensor_extension.c +++ b/sensor_extension.c @@ -16,13 +16,17 @@ void sensor_setup() { // put your loop code here // Very Important: only use print, not println!! -void sensor_loop() { +int sensor_loop(char *sensor_buffer) { - printf("Reading new sensor!"); + int sensors = 3; // set to the number of sensor readings adding. + sensor_buffer[0] = 0; // make sure buffer is empty + + printf("Reading new sensors!\n"); + + strcpy(sensor_buffer, "NEW 0.0 0.0 0.0"); + + printf("New sensor string: %s\n", sensor_buffer); -/* - printf(" NEW 0.0"); // send sensor data over serial to Pi Zero - printf(" NEW 0.0"); // send sensor data over serial monitor for testing -*/ + return(sensors); }