TavIR I2C_LCD -hez Függvénykönyvtár.
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Ja és 1.0.5 -ös arduinio verzió.
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Scanning...
I2C device found at address 0x27 !
done
I2C device found at address 0x27 !
done
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Mi a programkód amit használsz? melyik I2C lcd-megszólítást?
Van vmi szöveg az I2C illesztőn? Lábkosztás v egyéb? (3 féle létezik...)
Van vmi szöveg az I2C illesztőn? Lábkosztás v egyéb? (3 féle létezik...)
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Kód: Egész kijelölése
/* TavIR I2C_LCD Example Software Sketch
16 character 2 line I2C Display
http://www.tavir.hu
*/
/*-----( Import needed libraries )-----*/
#include <Wire.h> // Comes with Arduino IDE
// Get the LCD I2C Library here:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
// Move any other LCD libraries to another folder or delete them
// See Library "Docs" folder for possible commands etc.
#include <LiquidCrystal_I2C.h>
/*-----( Declare Constants )-----*/
/*-----( Declare objects )-----*/
// set the LCD address to 0x27 for a 20 chars 4 line display
// 0x27 (4E) - PCF8574
// 0x3F (7E) - PCF8574A
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x27, 6, 5, 4, 3, 2, 1, 0, 7, POSITIVE); // Set the LCD I2C address
/*-----( Declare Variables )-----*/
//NONE
void setup() /*----( SETUP: RUNS ONCE )----*/
{
Serial.begin(9600); // Used to type in characters
lcd.begin(16,2); // initialize the lcd for 16 chars 2 lines, turn on backlight
// ------- Quick 3 blinks of backlight -------------
for(int i = 0; i< 3; i++)
{
lcd.backlight();
delay(250);
lcd.noBacklight();
delay(250);
}
lcd.backlight(); // finish with backlight on
//-------- Write characters on the display ------------------
// NOTE: Cursor Position: (CHAR, LINE) start at 0
lcd.setCursor(0,0); //Start at character 4 on line 0
lcd.print("Hello, world!");
delay(1000);
lcd.setCursor(0,1);
lcd.print("HI!YourDuino.com");
delay(8000);
// Wait and then tell user they can start the Serial Monitor and type in characters to
// Display. (Set Serial Monitor option to "No Line Ending")
lcd.clear();
lcd.setCursor(0,0); //Start at character 0 on line 0
lcd.print("Use Serial Mon");
lcd.setCursor(0,1);
lcd.print("Type to display");
}/*--(end setup )---*/
void loop() /*----( LOOP: RUNS CONSTANTLY )----*/
{
{
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}
}/* --(end main loop )-- */
/* ( THE END ) */
Ez a program...
az illesztő ic-n az áll, hogy pcf85741
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Az i2c scanninget ezzel csináltam...
Kód: Egész kijelölése
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(115200);
Serial.println("\nI2C Scanner");
}
void loop()
{
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 0; address <= 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknow error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(8000); // wait 8 seconds for next scan
}
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Igy néz ki az illesztő
Nincs meg a kellő jogosultságod a hozzászóláshoz csatolt állományok megtekintéséhez.
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Köszönöm szépen a fejtörést,de kibogaráztam, hol a hiba.
Ez okozta a problémát!A tavir i2c-ben van, azzal nem működött.
De így már megy.
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
Ez okozta a problémát!A tavir i2c-ben van, azzal nem működött.
De így már megy.
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Sziasztok,
nemrég beszereztem a Tavir webshop-ból egy LCD-t, és egy I2C illesztőt:
http://shop.tavir.hu/product_info.php/l ... vito-p-157
Az I2C illesztőt beforrasztottam az LCD-be - nem tudom, ez így jó-e?
A gondom az, hogy semmilyen példa program nem fut rendesen. Az LCD háttér kapcsolható, az lcd.backlight() és lcd.noBacklight() működik, de semmilyen szöveg nem jelenik meg. A legutolsó feltöltött kód ez:
A scanner a 0x27-es porton találtam meg, ezt írtam be.
Köszi,
a.
nemrég beszereztem a Tavir webshop-ból egy LCD-t, és egy I2C illesztőt:
http://shop.tavir.hu/product_info.php/l ... vito-p-157
Az I2C illesztőt beforrasztottam az LCD-be - nem tudom, ez így jó-e?
A gondom az, hogy semmilyen példa program nem fut rendesen. Az LCD háttér kapcsolható, az lcd.backlight() és lcd.noBacklight() működik, de semmilyen szöveg nem jelenik meg. A legutolsó feltöltött kód ez:
Kód: Egész kijelölése
/* TavIR I2C_LCD Example Software Sketch
16 character 2 line I2C Display
http://www.tavir.hu
*/
/*-----( Import needed libraries )-----*/
#include <Wire.h> // Comes with Arduino IDE
// Get the LCD I2C Library here:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
// Move any other LCD libraries to another folder or delete them
// See Library "Docs" folder for possible commands etc.
#include <LiquidCrystal_I2C.h>
/*-----( Declare Constants )-----*/
/*-----( Declare objects )-----*/
// set the LCD address to 0x27 for a 20 chars 4 line display
// 0x27 (4E) - PCF8574
// 0x3F (7E) - PCF8574A
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
/*-----( Declare Variables )-----*/
//NONE
void setup() /*----( SETUP: RUNS ONCE )----*/
{
Serial.begin(9600); // Used to type in characters
lcd.begin(16,2); // initialize the lcd for 16 chars 2 lines, turn on backlight
// ------- Quick 3 blinks of backlight -------------
for(int i = 0; i< 3; i++)
{
lcd.backlight();
delay(250);
lcd.noBacklight();
delay(250);
}
lcd.backlight(); // finish with backlight on
//-------- Write characters on the display ------------------
// NOTE: Cursor Position: (CHAR, LINE) start at 0
lcd.setCursor(0,0); //Start at character 4 on line 0
lcd.print("Hello, world!");
delay(1000);
lcd.setCursor(0,1);
lcd.print("HI!YourDuino.com");
delay(8000);
// Wait and then tell user they can start the Serial Monitor and type in characters to
// Display. (Set Serial Monitor option to "No Line Ending")
lcd.clear();
lcd.setCursor(0,0); //Start at character 0 on line 0
lcd.print("Use Serial Mon");
lcd.setCursor(0,1);
lcd.print("Type to display");
}/*--(end setup )---*/
void loop() /*----( LOOP: RUNS CONSTANTLY )----*/
{
{
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}
}/* --(end main loop )-- */
/* ( THE END ) */
Köszi,
a.
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Nos, miután félretettem a kódot, a kíváncsiságomtól vezérelve elkezdtem nézegetni az I2C illesztőt, és ott a progi - amivel a kontrasztot lehet állítani, ugye . És elmozdítottam, mire megjelent a szöveg.airween írta: ...
A gondom az, hogy semmilyen példa program nem fut rendesen. Az LCD háttér kapcsolható, az lcd.backlight() és lcd.noBacklight() működik, de semmilyen szöveg nem jelenik meg.
...
Bocs a lámaságért
a.
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
A kontrasztot nem programból állítod, hanem a kontrasztpotméterrel:)
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Kedves Róbert,
Viszont most látom, hogy elírtam: nem progi, hanem poti , így szerintem már érthető lesz a mondandóm.
Köszi,
a.
igen, tudom, erre írtam hogy "miután félretettem a kódot, a kíváncsiságomtól vezérelve elkezdtem nézegetni az I2C illesztőt".Robert írta:A kontrasztot nem programból állítod, hanem a kontrasztpotméterrel:)
Viszont most látom, hogy elírtam: nem progi, hanem poti , így szerintem már érthető lesz a mondandóm.
Köszi,
a.
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Szia,gypali írta:Köszönöm szépen a fejtörést,de kibogaráztam, hol a hiba.
Ez okozta a problémát!A tavir i2c-ben van, azzal nem működött.
De így már megy.
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
Én is eltöltöttem másfél napot a kérdéskörrel, pedig csak ezt a hozzászólást kellett volna elolvasni hamarabb.
gypali! Köszönöm.
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
A WebShopban is ott a mintaprogi gyűjtemény, azzal is ki kll próbálni
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
Sziasztok,
Kezdőként küzdök az I2C LCD illesztővel.
A kezdőcsomagos LCD kijelzővel (2x16 zöld háttér, fekete betűk) próbálom de a kód ellenőrzésénél ezt a hibaüzenetet kapom:
"error: 'POSITIVE' was not declared in this scope"
Egyszerűen nem jövök rá hogy mi a baj, tegnap este 3 órán keresztül, olvasgattam, kerestem, próbálkoztam de semmi.
Mi lehet a gond?
Előre is köszönöm a segítséget.
Krisztián
Kezdőként küzdök az I2C LCD illesztővel.
A kezdőcsomagos LCD kijelzővel (2x16 zöld háttér, fekete betűk) próbálom de a kód ellenőrzésénél ezt a hibaüzenetet kapom:
"error: 'POSITIVE' was not declared in this scope"
Egyszerűen nem jövök rá hogy mi a baj, tegnap este 3 órán keresztül, olvasgattam, kerestem, próbálkoztam de semmi.
Mi lehet a gond?
Előre is köszönöm a segítséget.
Krisztián
Re: TavIR I2C_LCD -hez Függvénykönyvtár.
NewLiauidCrystal telepÍt.
https://bitbucket.org/fmalpartida/new-l ... /downloads
Mintakód:
De minden fenn van a WebShopban a cikk alatt a dokumentációk közt is...
Vagy ennek a fórumnak a közepén - függően melyik arduinot hazsnálod.
https://bitbucket.org/fmalpartida/new-l ... /downloads
Mintakód:
Kód: Egész kijelölése
/* TavIR I2C_LCD Example Software Sketch
16 character 2 line I2C Display
www.tavir.hu
*/
/*-----( Import needed libraries )-----*/
#include <Wire.h> // Comes with Arduino IDE
// Get the LCD I2C Library here:
// https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads
// Move any other LCD libraries to another folder or delete them
// See Library "Docs" folder for possible commands etc.
#include <LiquidCrystal_I2C.h>
/*-----( Declare Constants )-----*/
/*-----( Declare objects )-----*/
// set the LCD address to 0x27 for a 20 chars 4 line display
// 0x27 (4E) - PCF8574
// 0x3F (7E) - PCF8574A
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
//LiquidCrystal_I2C lcd(0x20, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE); // GY-IICLCD (kek)
//LiquidCrystal_I2C lcd(0x27, 6, 5, 4, 3, 2, 1, 0, 7, POSITIVE); // Set the LCD I2C address (green pcb)
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address (black pcb)
//LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address (black pcb)
/*-----( Declare Variables )-----*/
//NONE
void setup() /*----( SETUP: RUNS ONCE )----*/
{
Serial.begin(9600); // Used to type in characters
lcd.begin(16,2); // initialize the lcd for 16 chars 2 lines, turn on backlight
// ------- Quick 3 blinks of backlight -------------
for(int i = 0; i< 3; i++)
{
lcd.backlight();
delay(250);
lcd.noBacklight();
delay(250);
}
lcd.backlight(); // finish with backlight on
//-------- Write characters on the display ------------------
// NOTE: Cursor Position: (CHAR, LINE) start at 0
lcd.setCursor(0,0); //Start at character 4 on line 0
lcd.print("Hello, world!");
delay(1000);
lcd.setCursor(0,1);
lcd.print("Hi! www.tavir.hu");
delay(8000);
// Wait and then tell user they can start the Serial Monitor and type in characters to
// Display. (Set Serial Monitor option to "No Line Ending")
lcd.clear();
lcd.setCursor(0,0); //Start at character 0 on line 0
lcd.print("Use Serial Mon");
lcd.setCursor(0,1);
lcd.print("Type to display");
}/*--(end setup )---*/
void loop() /*----( LOOP: RUNS CONSTANTLY )----*/
{
{
// when characters arrive over the serial port...
if (Serial.available()) {
// wait a bit for the entire message to arrive
delay(100);
// clear the screen
lcd.clear();
// read all the available characters
while (Serial.available() > 0) {
// display each character to the LCD
lcd.write(Serial.read());
}
}
}
}/* --(end main loop )-- */
/* ( THE END ) */
De minden fenn van a WebShopban a cikk alatt a dokumentációk közt is...
Vagy ennek a fórumnak a közepén - függően melyik arduinot hazsnálod.
http://www.tavir.hu - a gazda