spectial charecter code!

I want to put a special character after a word
This is my Code

#include <LiquidCrystal.h>

#define ECHOPIN 3                            // Pin to receive echo pulse
#define TRIGPIN 4                            // Pin to send trigger pulse
#define STATUSPIN 13                        // Use for troubleshooting

int highWater = 30;        // These values allow to calculate % of full
int lowWater = 100;        // SRF04 hangs above water (lower distance = more water)
byte symbol[8] = {         // Custom character for LCD display
  B00000, 
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B00000,
};

byte eq[8] = { 
        B00000,
        B00000,
        B01001,
        B10110,
        B00000,
        B01001,
        B10110,
        B00000
};





LiquidCrystal lcd(7, 8, 9, 10, 11, 12);    // Assign pins

// Utility function for flashing STATUSPIN
void flashLed(int pin, int times, int wait) {

  for (int i = 0; i < times; i++) {
    digitalWrite(pin, HIGH);
    delay(wait);
    digitalWrite(pin, LOW);
    if (i + 1 < times) {
      delay(wait);
    }
  }
}

void setup() {
  
  lcd.begin(16,2);
  lcd.print("   AQUA LEVEL ");
  lcd.createChar(0, symbol);
  pinMode(ECHOPIN, INPUT);
  pinMode(TRIGPIN, OUTPUT);

  delay(3000);       // Show application name for 3 seconds.
}

void loop() {
  // Measure distance
  digitalWrite(TRIGPIN, LOW);                   // Set the trigger pin to low for 2uS
  delayMicroseconds(2);
  digitalWrite(TRIGPIN, HIGH);                  // Send a 10uS high to trigger ranging
  delayMicroseconds(10);
  digitalWrite(TRIGPIN, LOW);                   // Send pin low again
  int distance = pulseIn(ECHOPIN, HIGH);        // Read in times pulse
  distance= distance/58;                        // divide by 58 gives cm.
  
  // Convert measured value to value between 0-16, to display on LCD
  // Use Arduino built-in map and constrain functions
  int scaledValue = map(constrain(distance, highWater, lowWater), lowWater, highWater, 0, 16);
  lcd.clear();
  lcd.setCursor(0,0);
  while (scaledValue > 0) {
     lcd.print((char)0);
     scaledValue--;
}
// CM 
lcd.setCursor(0, 1); 
lcd.print(distance);
lcd.print(" CM - ");

// litres  
int litres;
litres = (100 * (200 * distance))/(1000); 
lcd.print(litres);
lcd.print(" L");





//send pulse every 3 second 
   delay(3000);
}

I want to call this character byte eq[8] to put it after this
lcd.print(" L");
I am using this to call it
lcd.write(eq);
and of course not working, can someone help me in this :roll_eyes: !

 lcd.createChar(0, symbol);
 lcd.createChar(1, eq);

you need to create the character in setup.

The print() method prints characters. Lie to it. Tell it that eq is a character array.

I'd suggest how to modify the code, if you had posted code that tried to actually use eq.

it’s weird actually !
This is my code

#include <LiquidCrystal.h>

#define ECHOPIN 3                            // Pin to receive echo pulse
#define TRIGPIN 4                            // Pin to send trigger pulse
#define STATUSPIN 13                        // Use for troubleshooting

int highWater = 30;        // These values allow to calculate % of full
int lowWater = 100;        // SRF04 hangs above water (lower distance = more water)
byte symbol[8] = {         // Custom character for LCD display
  B00000, 
  B11111,
  B11111,
  B11111,
  B11111,
  B11111,
  B00000,
};

byte eq[8] = { 
        B00000,
        B00000,
        B01001,
        B10110,
        B00000,
        B01001,
        B10110,
        B00000
};





LiquidCrystal lcd(7, 8, 9, 10, 11, 12);    // Assign pins

// Utility function for flashing STATUSPIN
void flashLed(int pin, int times, int wait) {

  for (int i = 0; i < times; i++) {
    digitalWrite(pin, HIGH);
    delay(wait);
    digitalWrite(pin, LOW);
    if (i + 1 < times) {
      delay(wait);
    }
  }
}

void setup() {
  
  lcd.begin(16,2);
  lcd.print("   AQUA LEVEL ");
  lcd.createChar(0, symbol);
  lcd.createChar(1, eq);
  pinMode(ECHOPIN, INPUT);
  pinMode(TRIGPIN, OUTPUT);

  delay(3000);       // Show application name for 3 seconds.
}

void loop() {
  // Measure distance
  digitalWrite(TRIGPIN, LOW);                   // Set the trigger pin to low for 2uS
  delayMicroseconds(2);
  digitalWrite(TRIGPIN, HIGH);                  // Send a 10uS high to trigger ranging
  delayMicroseconds(10);
  digitalWrite(TRIGPIN, LOW);                   // Send pin low again
  int distance = pulseIn(ECHOPIN, HIGH);        // Read in times pulse
  distance= distance/58;                        // divide by 58 gives cm.
  
  // Convert measured value to value between 0-16, to display on LCD
  // Use Arduino built-in map and constrain functions
  int scaledValue = map(constrain(distance, highWater, lowWater), lowWater, highWater, 0, 16);
  lcd.clear();
  lcd.setCursor(0,0);
  while (scaledValue > 0) {
     lcd.print((char)0);
     scaledValue--;
}
// CM 
lcd.setCursor(0, 1); 
lcd.print(distance);
lcd.print(" CM - ");

// litres  
int litres;
litres = (100 * (200 * distance))/(1000); 
lcd.print(litres);
lcd.print(" L");
lcd.print(eq);
   



//send pulse every 3 second 
   delay(3000);
}

i have this error

sketch_may09a.ino: In function 'void loop()':
sketch_may09a.ino:91:13: error: call of overloaded 'print(byte [8])' is ambiguous
sketch_may09a.ino:91:13: note: candidates are:
In file included from C:\Program Files (x86)\Arduino\libraries\LiquidCrystal\src/LiquidCrystal.h:5:0,
                 from sketch_may09a.ino:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:59:12: note: size_t Print::print(const String&) <near match>
     size_t print(const String &);
            ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:59:12: note:   no known conversion for argument 1 from 'byte [8] {aka unsigned char [8]}' to 'const String&'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:60:12: note: size_t Print::print(const char*) <near match>
     size_t print(const char[]);
            ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:60:12: note:   no known conversion for argument 1 from 'byte [8] {aka unsigned char [8]}' to 'const char*'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:61:12: note: size_t Print::print(char) <near match>
     size_t print(char);
            ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:61:12: note:   no known conversion for argument 1 from 'byte [8] {aka unsigned char [8]}' to 'char'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:62:12: note: size_t Print::print(unsigned char, int) <near match>
     size_t print(unsigned char, int = DEC);
            ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:62:12: note:   no known conversion for argument 1 from 'byte [8] {aka unsigned char [8]}' to 'unsigned char'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:63:12: note: size_t Print::print(int, int) <near match>
     size_t print(int, int = DEC);
            ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:63:12: note:   no known conversion for argument 1 from 'byte [8] {aka unsigned char [8]}' to 'int'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:64:12: note: size_t Print::print(unsigned int, int) <near match>
     size_t print(unsigned int, int = DEC);
            ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:64:12: note:   no known conversion for argument 1 from 'byte [8] {aka unsigned char [8]}' to 'unsigned int'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:65:12: note: size_t Print::print(long int, int) <near match>
     size_t print(long, int = DEC);
            ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:65:12: note:   no known conversion for argument 1 from 'byte [8] {aka unsigned char [8]}' to 'long int'
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:66:12: note: size_t Print::print(long unsigned int, int) <near match>
     size_t print(unsigned long, int = DEC);
            ^
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:66:12: note:   no known conversion for argument 1 from 'byte [8] {aka unsigned char [8]}' to 'long unsigned int'
Error compiling.

i know it’s from me this is my first time i use special charterers :roll_eyes:
byte symbol[8] worked great but the second nop!

You don't print eq. You have defined special character 0 as being built from the data in symbol. You have defined special character 1 as being built from the data in eq.

In the same way that you make a symbol appear, by printing (char)0, you make an eq appear by printing (char)1.

oh thanks that's work for me :D