From 87a69782e52eca1bf382367a96301b9c4cc016ef Mon Sep 17 00:00:00 2001 From: rafa Date: Sun, 18 May 2025 11:32:38 +0100 Subject: [PATCH] change to snake_case --- code/DistSensor.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/code/DistSensor.cpp b/code/DistSensor.cpp index 36ddef5..abe839b 100644 --- a/code/DistSensor.cpp +++ b/code/DistSensor.cpp @@ -3,34 +3,34 @@ class DistSensor { private: - int trigPin; - int echoPin; + int trig_pin; + int echo_pin; const int ULTRASONIC_CM_FACTOR = 58; void make_measurement(){ - digitalWrite(this->trigPin, HIGH); + digitalWrite(this->trig_pin, HIGH); delayMicroseconds(10); - digitalWrite(this->trigPin, LOW); + digitalWrite(this->trig_pin, LOW); } public: int duration; float default_distance; - DistSensor(int trigPin, int echoPin, float default_distance){ - this->trigPin = trigPin; - this->echoPin = echoPin; + DistSensor(int trig_pin, int echo_pin, float default_distance){ + this->trig_pin = trig_pin; + this->echo_pin = echo_pin; this->default_distance = default_distance; } void configure_pins(){ - pinMode(this->trigPin, OUTPUT); - pinMode(this->echoPin, INPUT); + pinMode(this->trig_pin, OUTPUT); + pinMode(this->echo_pin, INPUT); } int get_duration(){ this->make_measurement(); - this->duration = pulseIn(this->echoPin, HIGH); + this->duration = pulseIn(this->echo_pin, HIGH); return this->duration; }