Show Posts
|
|
Pages: [1]
|
|
3
|
International / Deutsch / Re: 20x4 LCD Display mit Fehlerhafter anzeige
|
on: October 12, 2012, 01:12:49 pm
|
In der Header-Datei gibt es m.E. nur Adressierungen für 2 Zeilen. Das Problem ist, wenn ich folgendes nach dem initalisieren mache: LiquidCrystal lcd(2,3,5,6,7,8); lcd.begin(20,4); lcd.setCursor(0,1); lcd.print("Hello World!");
dann Beginnt das Dsplay in der 3. zeile zu schreiben und wiederholt das ! in der 4. Zeile. Verirrtes Schaf
|
|
|
|
|
4
|
International / Deutsch / 20x4 LCD Display mit Fehlerhafter anzeige
|
on: October 12, 2012, 12:56:26 pm
|
|
Hallo,
ich wollte mein EA DIP 204-6 mit der Liquid Crystal Library betreiben, habe aber feststellen müssen, dass diese nur für 2-zeilige Displays ausgelegt ist. Kann mir jemand sagen ob das dennoch möglich ist das Display damit zu betreiben oder ob es eine andere Möglichkeit gibt?
Danke
VerirrtesSchaf
|
|
|
|
|
6
|
International / Deutsch / Re: Ultraschallsensor MB1033
|
on: September 23, 2012, 01:49:54 pm
|
Danke Uwe, hab das gerade mal ausprobiert. Hab hier mal den Code: void setup() { Serial.begin(9600); Serial1.begin(9600); pinMode(21, OUTPUT); }
int i=1; int empfang[6];
void loop() { if(millis()%10000 == 0) { digitalWrite(21, HIGH); delay(150); i=0; while (i<6) { if(Serial1.available()) { empfang[i] = Serial1.read(); i++; } else {} } digitalWrite(21, LOW); for(i=0; i<6; i++) { Serial.write (empfang[i]); } } }
Soweit erst mal, es funktioniert, das er alle 10 Sekunden was brauchbares einliest, allerdings immer das gleiche......egal wie der Sensor liegt oder steht. Hab ich da irgend wo einen Denkfehler? Verirrtes Schaf
|
|
|
|
|
7
|
International / Deutsch / Ultraschallsensor MB1033
|
on: September 23, 2012, 08:37:07 am
|
Hallo, ich versuch es nun mal auf deutsch, da ich mein Problem auf Englisch nicht so wirklich erklärt bekomme. Ich habe einen Arduino Mega 2560 und einen MB1033 Ultraschallsensor von MaxBotix. Er kommuniziert auch mit dem Arduino (Problem hab ich im englischsprachigen Teil gelöst bekommen), aber nun hab ich ein Problem an dem ich schon 2 Tage sitze und nicht weiß wie ich ran gehen soll. Der Sensor sendet auf dem Seriellen Bus 6 Bytes. Das erste ist immer ein 'R' und das letzte ein '^CR'. Was dazwischen steht ist die Entfernung in mm. Soweit sogut. Der Sensor soll aber Teil eines Gesamtprojektes sein. Zeil ist damit den Füllstand eines Tanks zu überwachen. Dazu übernimmt der Arduino auch noch andere Funktionen wie Temperaturmessungen etc. Ich will jetzt also, dass der Sensor z.b. alle 10 Sekunden abgefragt wird. Das ist ja kein Problem z.b. mit if(millis()%10000==0) { code }
Aber in diesem if-clause soll ein kompletter serieller Datenstrom aufgenommen und ausgewertet werden. Und das ist nun mein Problem. Wie kann ich den Strom komplett aufnehmen, so das ich auch weiß, das es ein gültiger ist? Vielen Dank schon mal, Verirrtes Schaf
|
|
|
|
|
8
|
Using Arduino / Programming Questions / Re: Problems using serial port
|
on: September 23, 2012, 04:41:49 am
|
Well I wrote me a own function to convert the ASCII data to integer, because I only need 12 characters. But now I have another serious problem. I tried now one day to get my serial data so how I want. The sensor I read shall be part of a system that monitors temperatures and a fill level. So I get the data of the sensors etc in different time differneces, so I want to ask the level sensor also e.g. only all 10 seconds of its data. The whole system runs only this sensor not. How can I get the 5 Bytes it sends to the Arduino in one step before the program gets to the next step? The data should also be calculated in a special way in this time, but when I take a for loop around the serial part I get the data tree times. digital Pin 21 is only used to activate/deactivate sensor. void setup() { Serial.begin(9600); Serial1.begin(9600); pinMode(21, OUTPUT); digitalWrite(21, HIGH); }
boolean einmal; int i=1;
void loop() { delay(4000); digitalWrite(21, HIGH); delay(20); for(i=0; i<6; i++) { if (Serial1.available()) { int inByte = Serial1.read(); Serial.write(inByte); if(inByte==13) { digitalWrite(21, LOW); } } } }
|
|
|
|
|
9
|
Using Arduino / Programming Questions / Re: Problems using serial port
|
on: September 22, 2012, 09:19:02 am
|
|
So I tried it using Serial1.availible and it runs! It shows me the right data. My next problem is how to convert the ascii date out of the serial input into normal integers, so as if I use Serial.write but into a integer variable. Have I to write a function to convert ascii or is this still availible?
Verirrtes Schaf
|
|
|
|
|
11
|
Using Arduino / Programming Questions / Re: Problems using serial port
|
on: September 21, 2012, 01:36:10 am
|
Thanks for your fast reply. I have my code not here yet, but I used to retype my test-code: void setup() { Serial.begin(9600); Serial1.begin(9600); pinMode(21, OUTPUT); digitalWrite(21, HIGH); }
int Daten;
void loop() { Daten=Serial1.read(); Serial.println(Daten); delay(2000); }
|
|
|
|
|
12
|
Using Arduino / Programming Questions / Problems using serial port
|
on: September 21, 2012, 01:21:12 am
|
Hello forum, I'm new here, so I'm sorry if ths is the wrong area for my topic. I started a new project using a Arduino Mega 2560 but now I'm at a problem I don't now how to deal with. I use a MaxBotix MB1033 ultrasonic sensor to measure distances. This sensor has a analog-, a pulse- and a serial output. The serial is the most accurate and so I want to use this one. I set up a 2nd serial port on my Arduino by using Serial1.begin(9600); and read the Output of the sensor by using Serial1.read(); I thought this wold be enough to run the sensor, but it wasn't so. I need a serial port with 9600baud, 8 bits, 1 stop bit and no parity. Can anybody here tell me what configuration the Serial1 has or how to change this? Tanks, VerirrtesSchaf
|
|
|
|
|