From d9f7332824527c3d9bfbeed4e596fdde71db4021 Mon Sep 17 00:00:00 2001 From: smayzy Date: Thu, 14 May 2026 12:32:12 +0200 Subject: [PATCH] set for hall sensor --- cocomobile-arduino/cocomobile-arduino.ino | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cocomobile-arduino/cocomobile-arduino.ino b/cocomobile-arduino/cocomobile-arduino.ino index f4fc254..cc52b2c 100644 --- a/cocomobile-arduino/cocomobile-arduino.ino +++ b/cocomobile-arduino/cocomobile-arduino.ino @@ -1,6 +1,6 @@ #include const float TENSION_SCALE = 15.701; -const float CURRENT_SCALE = 27.322; +const float CURRENT_SCALE = 31.25; const float ADC_TO_VOLT = 5.0 / 1023.0; SoftwareSerial lora(8, 9); // RX, TX @@ -17,7 +17,9 @@ void setup() { void loop() { tens = (analogRead(A1) * ADC_TO_VOLT * TENSION_SCALE); - amp = (analogRead(A0) * ADC_TO_VOLT * CURRENT_SCALE); + amp = analogRead(A2); + if (amp < 505) amp = 505; + amp = (amp - 505) * ADC_TO_VOLT * CURRENT_SCALE; Serial.print(tens); Serial.print(","); @@ -33,4 +35,4 @@ void loop() { line += c; } } -} +} \ No newline at end of file