Data Type Conversion

It seems no matter, it just throughs the opposite error e.g

strlen((const char *)buffer),                                         strlen((unsigned char *)buffer)
throughs error:invalid conversion conts char* to char*,       invalid conversion unsigned char* to char*

This compiles:

void setup()
{
  unsigned char *stg = (unsigned char *)"Some silly text";
  int stgLen = strlen((char *)stg);
}

void loop()
{
}

Thank you, but I was unable to make that code work. I have working code that displays hour, minute, and second as integer, but I cannot format it on the lcd. I would like the output to be formatted nice and tight across lcd.

Thank you, but I was unable to make that code work.

This compiles:

#include "LCD12864RSPI.h"

void setup()
{
  LCDA.Initialise(); // INIT SCREEN
  
  int hour = 12;
  int minute = 47;
  int second = 23;
  
  unsigned char timeString[12];
  sprintf((char *)timeString, "%02d:%02d:%02d", hour, minute, second);

  LCDA.DisplayString(0,1,timeString, strlen((char *)timeString));
}

void loop()
{
}

I should have suspected earlier that the library was from dfrobot. I wouldn't buy anything from them if it was free. They provide no support for Arduino.

Thank you very much for that code. It works great! What hardware manufacturer would you reccomend that would be easier to work with throughout this project?

Also, how can i make this 12hr format instead of 24hr?

It works great!

So, now all you have to do is use RTC.hour, RTC.minute, and RTC.second in place of the hardcoded values.

What hardware manufacturer would you reccomend that would be easier to work with throughout this project?

I don't know where in the world you are, so a manufacturer/supplier that was good for me might not be good for you.

Also, how can i make this 12hr format instead of 24hr?

Whack the RTC into submission. If that doesn't work, test the hour. If it is greater than 12, subtract 12.

I am in Ohio, USA, but I order all my hardware from internet.

Im sorry but I dont know what you mean by whack into submission, but I can try to implement check.

The RTC you are using probably has a setting that tells it whether you want the time in 12 hour or 24 hour format. I don't know what RTC that is, though, so I can't tell you what that setting is.

I am in Ohio, USA, but I order all my hardware from internet.

Sparkfun is on the internet. They pissed me, and a whole lot of other people, off with their "free day" fiasco a couple of years ago, but when I want something that I know will work and I want it now, I order from them.