Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Gmeter - C Code Bank


Gmeter
Gmeter with arduino mini pro 386 3.3v and hd44870 lcd screen.
                #include <LiquidCrystal.h>
const int x=0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  pinMode(x,INPUT);
  lcd.begin(16, 2);
  lcd.print("   -=Gmeter=-   ");
}

void loop() {
  int v=map(analogRead(x),0,1023,0,16);
  int i=0;
  if(v<8){
    while(i<v){
      lcd.print(" ");
      i++;
    }
    while(i<8){
      lcd.print("#");
      i++;  
    }
    lcd.print("        ");
  }else if(v>8){
    i=8;
    lcd.print("        ");    
    while(i<v){
      lcd.print("#");
      i++;
    }
    while(i<8){
      lcd.print(" ");
      i++;
    }
  }
  delay(100);
  lcd.setCursor(0,1);
  lcd.print("                ");
  lcd.setCursor(0,1);
}

            
Comments
Sorry but there are no comments to display