Show Posts
Pages: [1] 2 3
1  Using Arduino / Interfacing w/ Software on the Computer / Re: Serial communication with php on: March 08, 2011, 05:09:21 pm
Oh. I didn't read all posts, just first one. I got serial communication with Arduino with that class.
2  Using Arduino / Interfacing w/ Software on the Computer / Re: Serial communication with php on: March 07, 2011, 03:11:37 pm
Don't bother yourself when it's already done for you:
http://code.google.com/p/php-serial/
3  Development / Other Hardware Development / Re: Arduino without ftdi chip. on: March 02, 2011, 09:46:13 am
http://www.instructables.com/id/Arduino-on-all-sorts-of-Atmels/#step1
4  Using Arduino / Programming Questions / Re: String to int on: February 06, 2011, 07:23:20 am
Thank you so much smiley
5  Using Arduino / Programming Questions / String to int on: February 05, 2011, 05:44:37 pm
How I can convert String object to integer? Thanks.
6  Using Arduino / Interfacing w/ Software on the Computer / Re: EOL and SOL, working only first time xD on: January 31, 2011, 03:29:05 pm
It's you again. smiley Thank you one more time. It's finally working.
Code:
char str[25];
int i=0;
int str_len;
int inByte;
int last_inByte;
String rezultat;
int baud = 9600;

void setup() {
  Serial.begin(baud);
}

void loop() {
  inByte = Serial.read();
  str_len=0;
  if (inByte == '!') read_serial();
}

void read_serial() {
  Serial.println ("SOL FOUND and reading");
  Serial.print("READ: !\n");
  while (inByte!= '*')
  if (Serial.available() > 0) {
    inByte = Serial.read();
    Serial.print("READ: ");
    str[str_len] = inByte;
    Serial.println(str[str_len]);
    str_len++;
  } else if (Serial.available() == 0) {
    Serial.println("EOL not available, data string invalid");
    break;
  }

  if (inByte == '*') {
    Serial.println ("EOL FOUND");
    rezultat = "";
    for (i=0;i<(str_len-1);i++) {
      rezultat += str[i];
    }
    if(rezultat == "YES") {
      Serial.println("Yeah");
    }
      Serial.print ("\n");
    }
}
7  Using Arduino / Interfacing w/ Software on the Computer / Re: EOL and SOL, working only first time xD on: January 30, 2011, 04:12:55 pm
Anyone?
8  Using Arduino / Interfacing w/ Software on the Computer / Re: EOL and SOL, working only first time xD on: January 29, 2011, 06:17:58 pm
It's inside for loop. It will loop only as much times as there are bytes waiting. I can print it, and everything is normal.
9  Using Arduino / Interfacing w/ Software on the Computer / Re: EOL and SOL, working only first time xD on: January 29, 2011, 04:49:44 pm
Bump?
10  Using Arduino / Interfacing w/ Software on the Computer / EOL and SOL, working only first time xD on: January 29, 2011, 01:56:50 pm
Code:
char str[25];
int i=0;
int str_len;
int inByte;
int last_inByte;
String rezultat;

void setup() {
  Serial.begin(9600);
}

void loop() {
  inByte = Serial.read();
  str_len=0;
  if (inByte == '!') read_serial();
}

void read_serial() {
  Serial.println ("SOL FOUND and reading");
  Serial.print("READ: !\n");
  while (inByte!= '*')
  if (Serial.available() > 0) {
    inByte = Serial.read();
    Serial.print("READ: ");
    str[str_len] = inByte;
    Serial.println(str[str_len]);
    str_len++;
  } else if (Serial.available() == 0) {
    Serial.println("EOL not available, data str invalid");
    Serial.println("$N");
    break;
  }

  if (inByte == '*') {
    Serial.println ("EOL FOUND");
    for (i=0;i<(str_len-1);i++) {
      rezultat += str[i];
    }
    if(rezultat == "YES") {
      Serial.write("Yeah");
    }
      Serial.print ("\n");
    }
}

I get 'Yeah' back only if I send !YES* as first send thing from opening serial monitor. Otherwise I don't get 'Yeah' at all. Please help.
11  Using Arduino / Programming Questions / Re: Concatenation Operator on: January 29, 2011, 01:04:51 pm
Well, I have whole data in array when I'm receiving. But I can't check value with 'if' if I don't connect whole array in one variable.
12  Using Arduino / Programming Questions / Concatenation Operator on: January 29, 2011, 12:53:38 pm
How I can connect multiple variables in one variable (something like . in php)? I need that for receiving array trough serial.
13  Forum 2005-2010 (read only) / Troubleshooting / Re: 16x1 lcd on: September 22, 2010, 01:22:23 pm
Can someone write me custom function to split txt in two 8 digit variables? I will be very thankful.
14  Forum 2005-2010 (read only) / Troubleshooting / Re: 16x1 lcd on: September 20, 2010, 08:45:11 am
Thx for help, but it's still same. No difference at all. smiley-sad
15  Forum 2005-2010 (read only) / Troubleshooting / 16x1 lcd on: September 20, 2010, 07:42:13 am
So, I got my lcd working. But in weird way. It shows only half of text (8 letters). I can show second half if I mark lcd as 16x2 (and it's not!) in code. Then I point cursor to (0, 1) and show next half of letters (8 in same line as before). It's a little bit stupid. Dose all 16x1 lcd work this way or is it bug in lcd or my code?

Show only half of text:
Code:
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  lcd.begin(16, 1);
  lcd.print("hello, world!");
}

void loop() {
}



Show full text:
Code:
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  lcd.begin(16, 2);
  lcd.print("hello, w");
  lcd.setCursor(0, 1);
  lcd.print("orld!");
}

void loop() {
}
Pages: [1] 2 3