You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/*
This code is not working, the line with effects overlaps at the begining of the line replicating one char
If I change the line fx.applyEffect(text, 11, 18, effect::invert); to fx.applyEffect(text, 11, 15, effect::invert); // bold "Hello"
it does not apply the desired effect but do not overlap
Did I make any mistake ?
*/
#include <Arduino.h>
#include <Wire.h>
#include <LiquidCrystal_PCF8574.h> // should work with any LCD library
LiquidCrystal_PCF8574 lcd(0x27);
void make_char(char c, uint8_t* image){ //need this function to pass to LcdEffects
lcd.createChar(c, image); // so it knows how to make custom characters
}
#include <LcdEffects.h> // the core library
#include <Effects.h> // a collection of common effects
LcdEffects<> fx(make_char); // initialize the LcdEffects library
void setup() {
lcd.begin(20, 4); //change to match the size of your LCD
lcd.setBacklight(255);
}
void loop() {
char text[] = "12345678901234567890"; // puts the text in an array so we can work with it
lcd.setCursor(0,0);
lcd.print(text); //print the text to the first line without any effects (for comparison)
I haven't used this library on my own but the examples of lcdeffects use my library.
I just can guess that more than 16 characters cannot be used as the LCD chip only supports 16 customized characters.
/*
This code is not working, the line with effects overlaps at the begining of the line replicating one char
If I change the line fx.applyEffect(text, 11, 18, effect::invert); to fx.applyEffect(text, 11, 15, effect::invert); // bold "Hello"
it does not apply the desired effect but do not overlap
Did I make any mistake ?
*/
#include <Arduino.h>
#include <Wire.h>
#include <LiquidCrystal_PCF8574.h> // should work with any LCD library
LiquidCrystal_PCF8574 lcd(0x27);
void make_char(char c, uint8_t* image){ //need this function to pass to LcdEffects
lcd.createChar(c, image); // so it knows how to make custom characters
}
#include <LcdEffects.h> // the core library
#include <Effects.h> // a collection of common effects
LcdEffects<> fx(make_char); // initialize the LcdEffects library
void setup() {
lcd.begin(20, 4); //change to match the size of your LCD
lcd.setBacklight(255);
}
void loop() {
char text[] = "12345678901234567890"; // puts the text in an array so we can work with it
lcd.setCursor(0,0);
lcd.print(text); //print the text to the first line without any effects (for comparison)
fx.applyEffect(text, 0, 5, effect::invert);
fx.applyEffect(text, 7, 10, effect::bold);
fx.applyEffect(text, 11, 18, effect::invert);
lcd.setCursor(0,1); //now print the text to the second line
lcd.print(text);
delay(1000);
}
The text was updated successfully, but these errors were encountered: