Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / How to use existing Library in own library? on: August 11, 2011, 05:00:37 pm
Hello everybody,

I try to write my own library and used the http://arduino.cc/en/Hacking/LibraryTutorial
explaination as a guideline.
I tried to open the library LiquidCrystal.h in my new libraray AutomatLCD.h

Here is the code I wrote / modified from the Morse example.

AutomatLCD.cpp:
Code:
/*
  AutomatLCD.cpp
*/

#include "WProgram.h"
#include "AutomatLCD.h"
#include <LiquidCrystal.h>

AutomatLCD::AutomatLCD(int pin)
{
  pinMode(pin, OUTPUT);
  _pin = pin;
 
  pinMode(9,OUTPUT);
  digitalWrite(9,LOW);
  LiquidCrystal lcd(8, 10, 7, 6, 5, 4);
 


  lcd.begin(20, 4);
  lcd.setCursor(0, 0);
  lcd.print("hello, world!");
}

void AutomatLCD::dot()
{
 
 
}

void AutomatLCD::dash()
{
 
}

AutomatLCD.h:
Code:
/*
  AutomatLCD.h
*/

#ifndef AutomatLCD_h
#define AutomatLCD_h

#include "WProgram.h"
#include "LiquidCrystal.h"

class AutomatLCD
{
  public:
    AutomatLCD(int pin);
    void dot();
    void dash();
  private:
    int _pin;

};

#endif

But if I try to upload the Sketch the IDE shows the error message LiquidCrystal.h:
--------
In file included from SOS.cpp:1:
E:\01 - aktuelle + geplante Projekte\Projekt Stiftemaschine\Tools\arduino-0022\libraries\AutomatLCD/AutomatLCD.h:11:27: error: LiquidCrystal.h: No such file or directory
--------
Is there any general trick how to include an existing library like the Liquid Crystal one into the code?

Thanks very much

Martin

2  Using Arduino / Installation & Troubleshooting / Re: Upload doesen't work: Arduino Mega 2560 on: June 15, 2011, 12:40:16 pm
Hello,

When I tried I take the original code from the IDE Examples. Nothing customized.

The IDE doesn't give any error. You see how it compile the code if I press on the upload button.
Then it shows "uploading to board" and nothing happens. Thats also the time when the RX TX lights went off and the L light get on for all the time.

I choose the correct board and the correct COM port. I rechecked it in the hardware manageer and even change the port there. But nothing work at all. I deactivated my firewall for a while, it also not work.

@bucpatr: I thought of anything like that to--> kind of old code. But I cant find a way to get it away. The 1-10 seconds wait with reset I tried to.

Maybe something has been damaged at the flight or when they have X-rayed it.

What could I do if the board get any kind of radio chock and some parts of the bootloader storage has been deleted? --> or anything simiular.

If anyone has any other idea or soltion how to solve the problem I would be very happy!

Thanks,

Martin
3  Using Arduino / Installation & Troubleshooting / Upload doesen't work: Arduino Mega 2560 on: June 14, 2011, 11:17:57 pm
Hello everyone,

I have a problem with my Arduino Mega 2560.
Uploading of any code doesn't work. I tried the easiest one "Blink" and also a lot of other examples.
When I try to upload the code first the L light blink twice. Then the TX RX lights blink once or twice and then the L light is on constantly.

I tried all the stuff from the list in the troubleshooting guide (only the cable I wasn't able to change because I don't have another one at the moment)

By the way:
I bought the board a half year ago and it worked well. I toke it with me on a flight to the USA one month ago.
So it was in my baggage. After that I tried to use it yesterday and it didn't work.It didn't look like it has any demage.

So I think maybe the cold temperatuer in the airplain's baggage area could have destroyed anything.
--> Any Idea what could have been happened?

Or did anyone else have had the same problem and can may help me?
Even if you can post me an old forum entry you would help me a lot.

Thank you very much.

Martin

4  Forum 2005-2010 (read only) / Deutsch / Re: 20x4 Display  - fehlerhafte Darstellung on: January 21, 2011, 08:32:13 pm
Hallo Uwe,

leider habe ich nicht noch einen zweiten Display (30 € für einen sind ja auch genug) Ich habe jetzt noch mal nen Programmcode gebaut, damit ich mal sehen kann, wie sich die Adressierung verhällt:

Code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8,9,10, 2,3,4,5);

void setup() {
  // set up the LCD's number of columns and rows:
  
  // Print a message to the LCD.
  lcd.clear();
  lcd.begin(20,4);
  lcd.setCursor(1, 0);
  lcd.print("A");
 

}

void loop() {
   lcd.clear();
for (int j = 0 ; j<4; j++)
  {
  for (int i = 0; i <20; i++)
    {
    lcd.clear();
    lcd.setCursor(i, j);
    lcd.print("0");
    delay (200);
    }
  }
 
 

}

--> man kann die 0 wandern sehen.

Dabei entsteht dann folgendes:
Ich habs als Video auf meinen Server hochgeladen:

www.marfe.de/LCD/Bild.avi

Gruß

Martin
5  Forum 2005-2010 (read only) / Deutsch / Re: 20x4 Display  - fehlerhafte Darstellung on: January 21, 2011, 07:39:33 pm
Das ist überigens ein Bild von dem, was der Bildschirm anzeigt:


6  Forum 2005-2010 (read only) / Deutsch / 20x4 Display  - fehlerhafte Darstellung on: January 21, 2011, 07:38:49 pm
Hallo,

ich habe mir vor kurzem einen LCD Display EA DIP204-4 gekauft und ihn über die Adapterplatine an mein Ardunio Uno angeschlossen.

Ich verwende die  LiquidCrystal Librarie.

Ich habe einen relativ einfachen Code verwendet:

Code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8,9,10, 2,3,4,5);

void setup() {
  // set up the LCD's number of columns and rows:
  
  // Print a message to the LCD.
  lcd.clear();
  lcd.begin(20,4);
  lcd.setCursor(0, 0);
  lcd.print("Hallo Duda Draussen");


}

void loop() {
 
}

Leider zeigt der Display Werte doppelt an. So werden die Werte ab der 13. Stelle in der 1. Zeile auch in der 2. Zeile geschrieben.

Ich hab mir schon mehrer Forumseinträge angeschaut, die in der LiquidCrystal.cpp z. B. die Zeile
int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 };

geändert haben, hab ich auch versucht und ist leider gescheitert.

Hat jemand eine Idee, was ich da machen kann bzw. wie ich rausfinden kann ob der Display okay ist?

Gruß

Martin

Pages: [1]