Hi, my first post on this forum. Received the starterkit last week. So no experience with the Jeenodes or the arduino toolkit (absolute newbie).
I tied the components together and my first project is to have a serial display for my "headless" domotica-server. (OpenSolaris)
Like to display some information about cpu load and status of temperature sensors (velleman).
So i started with the lcd-demo program,tweaked it a little and on the serial arduino console (rel0017) things seems fine. But...
When I cat a file to /dev/term/0, only the first word is displayed, everything after a space dissappears. Same with tip and with the tool (http://todbot.com/blog/2006/12/06/arduino-serial-c-code-to-talk-to-arduino/)
Tried it with Ubuntu and OpenSolaris. (in ubuntu the device is /dev/ttyUSB0)
Baudrate = 9600 (because that is the default in Solaris)
any ideas ? (or better solutions?)
regards
Jeroen
// sketch for an LCD connected to I2C port via MCP23008 I/O expander
// 2009-10-31 <jcw@equi4.com> http://opensource.org/licenses/mit-license.php
// modified: 2010-03-14 Jeroen Bruins Slot
// Display messages on "headless" server
// a string that starts with "" sets the cursor on the first line.
// "@" sets the cursor on the second line, and "^" clears the screen.
// backlight on during display
#include <PortsLCD.h>
#include <RF12.h> // needed to avoid a linker error :(
PortI2C myI2C (1);
LiquidCrystalI2C lcd (myI2C);
void setup()
{
lcd.begin(16, 2);
Serial.begin(9600);
// Print welcome message to LCD.
lcd.print(" line1, @ line2 ^ cls 9600 baud.");
delay(1000);
lcd.noBacklight();
}
int bufferArray[250];
int output = 0;
int i = 0;
int position = 1;
void loop()
{
int count = Serial.available();
if (Serial.available() > -1)
{
delay(1000);
lcd.noBacklight();
for (i=0; i<count; i++)
{
bufferArrayi;
output = 1;
}
}
if (output != 0)
{ // if new bytes have been recieved int position = 0;
if (bufferArray0
{ // Print on first line if message begins with
lcd.clear();
lcd.setCursor(0,0);
position = 1;
}
else if (bufferArray0
{ // Print on second line if message begins with @
lcd.setCursor(0,1);
position = 1;
}
else if (bufferArray0
{ // Print on second line if message begins with @
lcd.clear();
lcd.setCursor(0,0);
position = 1;
}
else
{
lcd.clear();
lcd.setCursor(0,0);
}
int j;
lcd.backlight();
for (j = position; j < count; j++)
{
lcd.write(bufferArrayj;
}
output = 0;
memset(bufferArray, 0, count);
count = 0;
delay(2000);
}
}
