4D Systems LCD... Library wont go...

Hi there…

I can’t install " #include <genieArduino.h>" it is for smart LSD from 4d systems…

Seems like I install the library and i can see in the import library menu (visi-genie…
But it doesn’t work…
How??? I can not compile any sketch with functions of that library… the IDE says on any function that it’s not declare…

ofcourse i have this in my scetch #include <genieArduino.h>

the library has 2 examples so I can’t compile them both… What i do wrong? and my IDE is 1.0.6

This the library im talkin about:

if someone can check instll the library on his IDE see if it works and write back here… Would be so appreciated…

Well it works for me on 1.0.6.

You need to put the genieArduino folder from that link into the libraries folder and restart the IDE.

it is for smart LSD

Smart LSD?

PaulS: Smart LSD?

Yes that is the stuff that neutralists itself on contact with saliva.

Grumpy_Mike

I took the folder genieArduino out… Nothing…Doesn’t wanna go…

Did you check examples in folder? Can you compile them?

I can use it without library though… But its a little harsh couse it has those check sums bytes and it’s all in bytes…

Only Serial.write(buff, (size of)) seems work properly for those LCDs…

And it’s also harsh to read the data back from LCD… You got to convert it some how. Did not figure it yet…

Grumpy_Mike

Can you compile this scetch???

the examples went trough…

#include <genieArduino.h>

int insideTempSensorC;
int insideTempSensorF;

void setup()
{
genieBegin (GENIE_SERIAL, 9600); //Serial0 to talk to the display

genieAttachEventHandler(myGenieEventHandler); //Event handler to process data coming from display

pinMode(4, OUTPUT); // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
digitalWrite(4, 1); // Reset the Display via D4
delay(100);
digitalWrite(4, 0); // unReset the Display via D4

delay (3500); //let the display start up
}

void loop()
{
static long waitPeriod = millis();

//Read from sensor every 100ms and write to the display
if (millis() >= waitPeriod)
{
// PUT YOUR CODE HERE
if(insideTempSensorC < 100) insideTempSensorC++; // replace with where you get your data from
else insideTempSensorC = 0;

genieWriteObject(GENIE_OBJ_LED_DIGITS, 0, insideTempSensorC); // write insideTempSensorC value to LedDigit0

insideTempSensorF = ((insideTempSensorC * 9) / 5) + 32; // Convert to Degress F
genieWriteObject(GENIE_OBJ_LED_DIGITS, 1, insideTempSensorF); // write insideTempSensorF value to LedDigit1

genieWriteObject(GENIE_OBJ_THERMOMETER, 0, insideTempSensorC); // write insideTempSensorC value to Thermometer0

waitPeriod = millis() + 100; // rerun this code in another 100ms time.
}

genieDoEvents(); // Do this every loop, checks the input buffer for data from the display and runs myGenieEventHandler()
}

void myGenieEventHandler(void)
{
genieFrame Event;
genieDequeueEvent(&Event);

//You dont need to do anything in here yet unless reading back from the display, such as from a button or slider or reading a value back etc
}

Did you check examples in folder? Can you compile them?

I downloaded the library, and opened the first sketch.

Binary sketch size: 6,802 bytes (of a 258,048 byte maximum)

Slavka85: Grumpy_Mike

I took the folder genieArduino out.. Nothing...Doesn't wanna go...

Did you check examples in folder? Can you compile them?

Yes I can compile both examples in the folder so you are still not installing it correctly. The Demo compiled for the Uno but the Demo Multiscreen needs a Meg because it uses Serial1, it compiles when you switch to that.

From reply #6

Can you compile this scetch???

No because that uses the line:-

genieBegin (GENIE_SERIAL, 9600);

and GENIE_SERIAL has not been defined, so that is no surprise.

ok... I install the librery... It works now i guess...

but I don't understand how this library works... What i have to define any command in it?

Study the examples, that is what they are there for.

This function genieBegin (GENIE_SERIAL, 9600); is using the hardwere serial.. like Serial.begin(9600);

Who knows how to define genie serial with SoftwereSerial.h ???

Any example doesn’t work any function is not declare… Why???

this is example from 4 d systems… I install the library… It won’t comply…FFFF

#include <genieArduino.h>

// Voltmeter Demo
// 4D Systems
// This Demo communicates with a 4D Systems Display, configured with ViSi-Genie.
// The display has an angular meter, a LED digits, a rocker switch, and a static text.
// The program sends digital voltage readings to the LED digits and angular meter of the display module.
// The digital voltage readings are derived from pin A0 using ADC.Analog input voltage range is 0 to 5 volts only.
// The rocker switch of the display module is used for "turning on" the application.
// First, the program reads from the rocker switch manually using the Read Object function.
// If the rocker switch is on, the computed digital voltage readings are sent to the angular meter and LED digits.
// If the rocker switch is off, the angular meter and LED digits are made to display zero volts.

// This appication comes with a documentation: 4D-AN-P4019-ViSi-Genie A Simple Digital Voltmeter Application using an Arduino Host
// Download it here: http://www.4dsystems.com.au/appnotes/
/*
NOTE: Some Arduino boards such as the Due operate at 3.3 volts and tolerate analog input voltage levels from ground up to 3.3 V only. 
Applying more than 3.3 V may damage the chip. If attempting to use 3.3V Arduino boards for this application, make sure to limit the 
analog input voltage to 3.3 volts only and please read carefully your board’s datasheet. 
*/

int flag = 0;        //holds the "power status" of the voltmeter. flag = 0 means voltmeter is "off", flag = 1 means the voltmeter is "on".
int sensorPin = A0;  //the wiper of the trimmer potentiometer is connected to pin A0
int voltMeter;       //holds the digital voltage value to be sent to the angular meter
int voltLED;         //holds the digital voltage value to be sent to the LED digits

void setup() 
{ 
  // a few options to talk to the Display, uncomment the one you want
  // make sure that the ViSi Genie program has the same baud rate
  genieBegin (GENIE_SERIAL, 9600);  //Serial0
  //genieBegin (GENIE_SERIAL_1, 9600);  //Serial1
  //genieBegin (GENIE_SERIAL_2, 9600);  //Serial2
  //genieBegin (GENIE_SERIAL_3, 9600);  //Serial3

  genieAttachEventHandler(myGenieEventHandler);

  //Reset the Display (change D4 to D2 if you have original 4D Arduino Adaptor)
  pinMode(4, OUTPUT);  // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
  digitalWrite(4, 1);  // Reset the Display via D4
  delay(100);
  digitalWrite(4, 0);  // unReset the Display via D4
  
  delay (3500);        //let the display start up
}

void loop() 
{ 
  static long waitPeriod = millis();  

  genieDoEvents();        //Genie events are received and queued here.
  
  if (millis() >= waitPeriod) 
  {
    if(flag == 1){                                                
      voltLED = ((5.0 * analogRead(sensorPin) * 1000.0) / 1023);
      genieWriteObject(GENIE_OBJ_LED_DIGITS, 0x00, voltLED);      //write to Leddigits0 the value of voltLED 
      voltMeter = voltLED/100;
      genieWriteObject(GENIE_OBJ_ANGULAR_METER, 0x00, voltMeter); //write to Angularmeter0 the value of voltMeter     
    }
    
    else if(flag == 0){
      genieWriteObject(GENIE_OBJ_LED_DIGITS, 0x00, 0); 
      genieWriteObject(GENIE_OBJ_ANGULAR_METER, 0x00, 0);
    }
    
    // Do a manual read from Rockerswitch0. The results of this call will    
    // be available to myGenieEventHandler() after the display has responded
    genieReadObject(GENIE_OBJ_ROCKERSW, 0x00);
    waitPeriod = millis() + 50;
  }
}


/////////////////////////////////////////////////////////////////////
//
// This is the user's event handler. It is called by genieDoEvents() 
// when the following conditions are true
//
//		The link is in an IDLE state, and
//		There is an event to handle
//
// The event can be either a REPORT_EVENT frame sent asynchrounously 
// from the display or a REPORT_OBJ frame sent by the display in
// response to a READ_OBJ request.
//

void myGenieEventHandler(void) 
{
  int rockersw_val;          //holds the status of Rockerswitch0
  genieFrame Event;    
  genieDequeueEvent(&Event);
  //Evaluate the event
  if (genieEventIs(&Event, GENIE_REPORT_OBJ, GENIE_OBJ_ROCKERSW, 0x00)){ //if the event is a REPORT_OBJ from Rockerswitch0
    rockersw_val = genieGetEventData(&Event);  //extract the MSB and LSB values and pass them to rockersw_val
    if (rockersw_val == 0)                     //if Rockerswitch0 is off
      flag = 0;                                //"turn off" the voltmeter
    else if (rockersw_val == 1)                //if Rockerswitch0 is on
      flag = 1;                                //"turn on" the voltmeter
  }
}

Any example doesn’t work

I thought you said that the examples that came with library would compile?

this is example from 4 d systems… I install the library… It won’t comply

Where are you getting these examples - they are rubbish?
I said look at the examples that will compile and you will see that the code you posted has all its calls mangled.
For example genieEventIs( should be genie.EventIs( someone or some thing has gone through removing all the periods from the class calls.

This is what I did to fix it but I am not convinced about the serial baud rate you need to use.

#include <genieArduino.h>

// Voltmeter Demo
// 4D Systems
// This Demo communicates with a 4D Systems Display, configured with ViSi-Genie.
// The display has an angular meter, a LED digits, a rocker switch, and a static text.
// The program sends digital voltage readings to the LED digits and angular meter of the display module.
// The digital voltage readings are derived from pin A0 using ADC.Analog input voltage range is 0 to 5 volts only.
// The rocker switch of the display module is used for "turning on" the application.
// First, the program reads from the rocker switch manually using the Read Object function.
// If the rocker switch is on, the computed digital voltage readings are sent to the angular meter and LED digits.
// If the rocker switch is off, the angular meter and LED digits are made to display zero volts.

// This appication comes with a documentation: 4D-AN-P4019-ViSi-Genie A Simple Digital Voltmeter Application using an Arduino Host
// Download it here: http://www.4dsystems.com.au/appnotes/
/*
NOTE: Some Arduino boards such as the Due operate at 3.3 volts and tolerate analog input voltage levels from ground up to 3.3 V only. 
Applying more than 3.3 V may damage the chip. If attempting to use 3.3V Arduino boards for this application, make sure to limit the 
analog input voltage to 3.3 volts only and please read carefully your board's datasheet. 
*/

int flag = 0;        //holds the "power status" of the voltmeter. flag = 0 means voltmeter is "off", flag = 1 means the voltmeter is "on".
int sensorPin = A0;  //the wiper of the trimmer potentiometer is connected to pin A0
int voltMeter;       //holds the digital voltage value to be sent to the angular meter
int voltLED;         //holds the digital voltage value to be sent to the LED digits
Genie genie;

void setup() 
{ 
  // a few options to talk to the Display, uncomment the one you want
  // make sure that the ViSi Genie program has the same baud rate
  Serial.begin(9600);
  genie.Begin(Serial);  //Serial0
  //genieBegin (GENIE_SERIAL_1, 9600);  //Serial1
  //genieBegin (GENIE_SERIAL_2, 9600);  //Serial2
  //genieBegin (GENIE_SERIAL_3, 9600);  //Serial3

  genie.AttachEventHandler(myGenieEventHandler);

  //Reset the Display (change D4 to D2 if you have original 4D Arduino Adaptor)
  pinMode(4, OUTPUT);  // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
  digitalWrite(4, 1);  // Reset the Display via D4
  delay(100);
  digitalWrite(4, 0);  // unReset the Display via D4
  
  delay (3500);        //let the display start up
}

void loop() 
{ 
  static long waitPeriod = millis();  

  genie.DoEvents();        //Genie events are received and queued here.
  
  if (millis() >= waitPeriod) 
  {
    if(flag == 1){                                                
      voltLED = ((5.0 * analogRead(sensorPin) * 1000.0) / 1023);
      genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x00, voltLED);      //write to Leddigits0 the value of voltLED 
      voltMeter = voltLED/100;
      genie.WriteObject(GENIE_OBJ_ANGULAR_METER, 0x00, voltMeter); //write to Angularmeter0 the value of voltMeter     
    }
    
    else if(flag == 0){
      genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x00, 0); 
      genie.WriteObject(GENIE_OBJ_ANGULAR_METER, 0x00, 0);
    }
    
    // Do a manual read from Rockerswitch0. The results of this call will    
    // be available to myGenieEventHandler() after the display has responded
    genie.ReadObject(GENIE_OBJ_ROCKERSW, 0x00);
    waitPeriod = millis() + 50;
  }
}


/////////////////////////////////////////////////////////////////////
//
// This is the user's event handler. It is called by genieDoEvents() 
// when the following conditions are true
//
//		The link is in an IDLE state, and
//		There is an event to handle
//
// The event can be either a REPORT_EVENT frame sent asynchrounously 
// from the display or a REPORT_OBJ frame sent by the display in
// response to a READ_OBJ request.
//

void myGenieEventHandler(void) 
{
  int rockersw_val;          //holds the status of Rockerswitch0
  genieFrame Event;    
  genie.DequeueEvent(&Event);
  //Evaluate the event
  if (genie.EventIs(&Event, GENIE_REPORT_OBJ, GENIE_OBJ_ROCKERSW, 0x00)){ //if the event is a REPORT_OBJ from Rockerswitch0
    rockersw_val = genie.GetEventData(&Event);  //extract the MSB and LSB values and pass them to rockersw_val
    if (rockersw_val == 0)                     //if Rockerswitch0 is off
      flag = 0;                                //"turn off" the voltmeter
    else if (rockersw_val == 1)                //if Rockerswitch0 is on
      flag = 1;                                //"turn on" the voltmeter
  }
}

You said learn so thats what I do...

Those codes I got from example scetches.. Fro theyer website actually.

// Application Notes on the 4D Systems Website that are useful to understand this library are found: http://www.4dsystems.com.au/appnotes

// Good App Notes to read are: // 4D-AN-P4017 - Connecting a 4D Display to an Arduino Host - http://www.4dsystems.com.au/downloads/Application-Notes/4D-AN-P4017_R_1_0.zip

// 4D-AN-P4018 - Writing to Genie Objects Using an Arduino Host - http://www.4dsystems.com.au/downloads/Application-Notes/4D-AN-P4018_R_1_0.zip

// 4D-AN-P4019 - A Simple Digital Voltmeter Application using an Arduino Host - http://www.4dsystems.com.au/downloads/Application-Notes/4D-AN-P4019_R_1_0.zip

// 4D-AN-P4025 - Arduino Danger Shield for Sparkfun Danger Shield - http://www.4dsystems.com.au/downloads/Application-Notes/4D-AN-P4025_R_1_0.zip

Yep I see you right about the dots... I tryed to put them before you did it actually better...

Hey what you think how to not use hardwere serial but use the code you fix with Softwere serial library and put LCD on whatever other pins?

#include <SoftwareSerial.h>

#include <genieArduino.h>

SoftwareSerial LCD(2,3);

void setup()
{

LCD.begin(9600);
genie.Begin(LCD);

genie.AttachEventHandler(myGenieEventHandler);

}

This would comply but doesn’t work…

Why would you expect it to work? I think you are way out of your depth here and you should spend time learning about how to code. Sorry but that is the way I see it.