Graphic ST7565 Negative LCD and variables

Hello I've recently received my Graphic ST7565 Negative LCD (128x64) with RGB backlight + extras PRODUCT ID: 438 from adafruit and was unable to get live analog inputs to display on it,

I'm trying to display a live value from analog pin 1 but can't seem to get any code to work

Thanks in advance

Josh 8)

I'm trying to display a live value from analog pin 1 but can't seem to get any code to work

Maybe you need to provide better working conditions, more benefits, or more financial incentive. Or all three.

Or, you could post your code and describe exactly what it actually does.

Sorry I was away from my laptop when I posted the question below is my code witch I can't seem to get to work

#include "ST7565.h"

int ledPin =  13;    // LED 
Int analog = A1 //analog pin to read 
Int data = 0  // var storing a1 data 

// the LCD backlight is connected up to a pin so you can turn it on & off
#define BACKLIGHT_LED 10

// pin 9 - Serial data out (SID)
// pin 8 - Serial clock out (SCLK)
// pin 7 - Data/Command select (RS or A0)
// pin 6 - LCD reset (RST)
// pin 5 - LCD chip select (CS)
ST7565 glcd(9, 8, 7, 6, 5);

#define LOGO16_GLCD_HEIGHT 16 
#define LOGO16_GLCD_WIDTH  16 




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

  Serial.print(freeRam());
  
  // turn on backlight
  pinMode(BACKLIGHT_LED, OUTPUT);
  digitalWrite(BACKLIGHT_LED, HIGH);

  // initialize and set the contrast to 0x18
  glcd.begin(0x18);

  
  glcd.clear();

  
  glcd.drawstring(0, 0, "analog value" + data);
  glcd.display();
  delay(2000);
  glcd.clear();

  


void loop()                     
{
  data = analogRead(analog);    
}


// free ram function 

  
int freeRam(void)
{
  extern int  __bss_end; 
  extern int  *__brkval; 
  int free_memory; 
  if((int)__brkval == 0) {
    free_memory = ((int)&free_memory) - ((int)&__bss_end); 
  }
  else {
    free_memory = ((int)&free_memory) - ((int)__brkval); 
  }
  return free_memory; 
}

witch I can't seem to get to work

It won't even compile, so it's no surprise that it doesn't work.

That's why I was looking for. Support and trying to find where I was going wrong

From a different forum I've got an adapted version of the code however i still get the compiler errors below is the new version and the compiler errors

#include "ST7565.h"

int ledPin =  13;    // LED connected to digital pin 13

int Input = A0;
int value = 0;




// the LCD backlight is connected up to a pin so you can turn it on & off
#define BACKLIGHT_LED 10

// pin 9 - Serial data out (SID)
// pin 8 - Serial clock out (SCLK)
// pin 7 - Data/Command select (RS or A0)
// pin 6 - LCD reset (RST)
// pin 5 - LCD chip select (CS)
ST7565 glcd(9, 8, 7, 6, 5);

#define LOGO16_GLCD_HEIGHT 16 
#define LOGO16_GLCD_WIDTH  16 



// The setup() method runs once, when the sketch starts
void setup()   {                
  Serial.begin(9600);

  Serial.print(freeRam());
  
  // turn on backlight
  pinMode(BACKLIGHT_LED, OUTPUT);
  digitalWrite(BACKLIGHT_LED, HIGH);

  // initialize and set the contrast to 0x18
  glcd.begin(0x18);


glcd.clear();

  
  
  



}


void loop()                     

{

  value = analogRead(Input);
  
glcd.clear();

  // draw a string at location (0,0)
  
  
  glcd.drawstring(0, 5, value);
  glcd.display();







}
// this handy function will return the number of bytes currently free in RAM, great for debugging!   
int freeRam(void)
{
  extern int  __bss_end; 
  extern int  *__brkval; 
  int free_memory; 
  if((int)__brkval == 0) {
    free_memory = ((int)&free_memory) - ((int)&__bss_end); 
  }
  else {
    free_memory = ((int)&free_memory) - ((int)__brkval); 
  }
  return free_memory; 
}

And the compiler errors ......

st7565lcd.pde: In function 'void loop()':
st7565lcd:62: error: invalid conversion from 'int' to 'char*'
st7565lcd:62: error: initializing argument 3 of 'void ST7565::drawstring(uint8_t, uint8_t, char*)'

Any help fixing any errors in my code will be greatly appreciated

Thanks

Josh

Any help fixing any errors in my code will be greatly appreciated

Is there some part of that message that you don't understand? The glcd.drawstring() method name should give you a clue that it expects a string as input. value is an int, not a string.

You need to make a string out of value. sprintf() and itoa() can both do that.