Overclock.net - An Overclocking Community - View Single Post - Arduino code help, way out of my depth

View Single Post
post #2 of (permalink) Old 03-01-2018, 02:13 AM - Thread Starter
5291Crash
New to Overclock.net
 
5291Crash's Avatar
 
Join Date: Dec 2004
Location: Landsowne, Ontario, Canada
Posts: 563
Rep: 26 (Unique: 26)
Where i am now
Code:
 if (vin0 < 0.09) {
    vin0 = 0.0; //statement to quash undesired reading !
  }
  lcd.setCursor(0, 1);
  lcd.print("PSU V= ");
  lcd.print(vin0);
  lcd.setCursor(0, 2);
  lcd.print("EXT BATT V= ");
  lcd.print(vin1);
  lcd.setCursor(0, 3);
  lcd.print("INT BATT V= ");
  lcd.print(vin2);
  if (vin0 < 14.4 && vin0 > 11.8) {
    digitalWrite(led_d11, HIGH);
  } 
  else {
    digitalWrite(led_d11, LOW);
  }
  if (led_d11 = LOW && vin1 < 11.8 && vin1 > 14.4) {
    digitalWrite(led_d12, HIGH);
  } 
  else {
    digitalWrite(led_d12, LOW);
  }
  if (led_d11 = LOW && led_d12 = LOW && vin2 < 11.8 && vin2 > 14.4) {
    digitalWrite(led_d13, HIGH);
  } 
  else {
    digitalWrite(led_d13, LOW);
  }
  delay(500);
fails at my attempt to look at the outputs

Edit:
up to this now
Code:
  if (vin0 < 0.09) {
    vin0 = 0.0; //statement to quash undesired reading !
  }
  lcd.setCursor(0, 1);
  lcd.print("PSU V= ");
  lcd.print(vin0);
  lcd.setCursor(0, 2);
  lcd.print("EXT BATT V= ");
  lcd.print(vin1);
  lcd.setCursor(0, 3);
  lcd.print("INT BATT V= ");
  lcd.print(vin2);
  if (vin0 < 14.4 && vin0 > 11.8) {
    digitalWrite(led_d11, HIGH);
  } 
  else {
    digitalWrite(led_d11, LOW);
  }
  if (vin0 > 14.4 && vin0 < 11.8 && vin1 < 11.8 && vin1 > 14.4) {
    digitalWrite(led_d12, HIGH);
  } 
  else {
    digitalWrite(led_d12, LOW);
  }
  if (vin0 > 14.4 && vin0 < 11.8 && vin1 > 14.4 && vin1 < 11.8 && vin2 < 11.8 && vin2 > 14.4) {
    digitalWrite(led_d13, HIGH);
  } 
  else {
    digitalWrite(led_d13, LOW);
  }
  delay(500);

Ryzen
(12 items)
CPU
Ryzen 5 2600X
Motherboard
MSI x470 Gaming Plus
GPU
MSI Armour RX 570 8GB OC
RAM
Team Group TDGED416G3000HC16CDC01 2x8GB 3000Mhz C16
Hard Drive
WD Black 500 GB NVMe
Power Supply
Rosewill Capstone 750
Cooling
Cheap 240 AIO
Case
Rosewill Rise
Operating System
Win 10 Pro
Keyboard
Microsoft Sidewinder x4
Mouse
Logitech G300s
Audio
Audio Technica M50xBT
▲ hide details ▲

Last edited by 5291Crash; 03-01-2018 at 02:28 AM.
5291Crash is offline