From 21b81aa20cdb3950e223d8b9d8c3a62ec34a2102 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 4 Aug 2020 13:33:10 +0200 Subject: [PATCH] send voltage --- trigorilla/src/main.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/trigorilla/src/main.cpp b/trigorilla/src/main.cpp index 5508538..9362415 100644 --- a/trigorilla/src/main.cpp +++ b/trigorilla/src/main.cpp @@ -75,11 +75,21 @@ void setup() pinMode(LED_PIN, OUTPUT); digitalWrite(LED_PIN, HIGH); + pinMode(A12, INPUT); // TEMP 3 + + //pinMode(BEEPER_PIN, OUTPUT); + //digitalWrite(BEEPER_PIN, LOW); + pinMode(TRIGORILLA_HEATER_0_PIN, OUTPUT); digitalWrite(TRIGORILLA_HEATER_0_PIN, HIGH); lcd.begin(20, 4); + lcd.setCursor(6,0); lcd.print("ROBERTO"); + lcd.setCursor(0,2); + lcd.print("https://"); + lcd.setCursor(3,3); + lcd.print("roberto.xd0.de"); stepper[0].begin( X_DIR_PIN, X_STEP_PIN, X_ENABLE_PIN); stepper[1].begin( Y_DIR_PIN, Y_STEP_PIN, Y_ENABLE_PIN); @@ -173,6 +183,18 @@ void loop() stepper[2].disable(); stepper[3].disable(); } + + if (millis() - lastMillis >= 5000) { + //analogReadResolution(12); + int val = analogRead(A12); + float voltage = val*0.055458515; + lastMillis = millis(); + Serial.print("B "); + Serial.println(voltage); + lcd.setCursor(14,1); + lcd.print(voltage, 1); + lcd.print(" V"); + } /* stepper[0].setSpeed(-4000); stepper[1].setSpeed(-4000);