Browse Source

send voltage

main
Hendrik Langer 4 years ago
parent
commit
21b81aa20c
  1. 22
      trigorilla/src/main.cpp

22
trigorilla/src/main.cpp

@ -75,11 +75,21 @@ void setup()
pinMode(LED_PIN, OUTPUT); pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, HIGH); digitalWrite(LED_PIN, HIGH);
pinMode(A12, INPUT); // TEMP 3
//pinMode(BEEPER_PIN, OUTPUT);
//digitalWrite(BEEPER_PIN, LOW);
pinMode(TRIGORILLA_HEATER_0_PIN, OUTPUT); pinMode(TRIGORILLA_HEATER_0_PIN, OUTPUT);
digitalWrite(TRIGORILLA_HEATER_0_PIN, HIGH); digitalWrite(TRIGORILLA_HEATER_0_PIN, HIGH);
lcd.begin(20, 4); lcd.begin(20, 4);
lcd.setCursor(6,0);
lcd.print("ROBERTO"); 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[0].begin( X_DIR_PIN, X_STEP_PIN, X_ENABLE_PIN);
stepper[1].begin( Y_DIR_PIN, Y_STEP_PIN, Y_ENABLE_PIN); stepper[1].begin( Y_DIR_PIN, Y_STEP_PIN, Y_ENABLE_PIN);
@ -173,6 +183,18 @@ void loop()
stepper[2].disable(); stepper[2].disable();
stepper[3].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[0].setSpeed(-4000);
stepper[1].setSpeed(-4000); stepper[1].setSpeed(-4000);

Loading…
Cancel
Save