Problem and errors with my sketch for Arduino Uno [LOL Protoshield] [LEDs]

Hello!
This is my second topic about this problem, because i didn’t follow the rules. My bad. Sorry everybody!
Link to the last topic: http://forum.arduino.cc/index.php?topic=452320.0 - You can close it.


So. I’ll start again.
My name is Richard and I’m doing my final exam project for my schoolwork. I choose to do some work with arduino and LEDs.

Here’s the work i’m trying to do and follow: Google Code Archive - Long-term storage for Google Code Project Hosting.
You can find more informations here.

I need your help. I’m stuck with the code and i have time 'til 1.March to finish it, otherwise, I can’t finish my schoolyear.

It’s my first project with arduino, I’m new to it. That’s why i choosed a project with complete program.
But it still doesn’t work :frowning:


I can’t put the code inside here, because its really long, over 9000 characters. The same problem goes with the errors in the code. I will put them into attachments.

You can find the instructions for this project on this link: Chlonos - instructions.pdf - Google Drive

The original code for the project can be found here: Google Code Archive - Long-term storage for Google Code Project Hosting.

There isn’t much work with the program/sketch itself. I’ll copy it here:

Open it in the Arduino software and you will see the code.
Note these lines of code.

#include <Charliplexing.h> // Library for driving the LEDs

#include <Wire.h>

#include <RTClib.h>

#include <SoftwareSerial.h>

#include <avr/pgmspace.h>

#include <EEPROM.h>

These are libraries that the Code uses. Some are built in but you will need Charlieplexing and
RTClib.
Charlieplexing can be found here.
http://playground.arduino.cc/Code/Charlieplex
You will also need the RTC library which you can find here.
GitHub - adafruit/RTClib: A fork of Jeelab's fantastic RTC library
One caution. When you download the RTClib you get a file called “RTClib-master”. Arduino will
complain if you try to install it. So rename the file to “RTClib.zip” and it should now install without
error.
Install both of these. If they have installed correctly then when you see them listed on the tab
Sketch, Import library as ‘contributed.’ The other libraries are already built into the Arduino
platform.
Now compile the code for the project that you downloaded.
It may come up with an error. If so find this line in the code.

RTC.adjust(DateTime(__DATE__, __TIME__),16)

Change the line to this

RTC.adjust(DateTime(__DATE__, __TIME__))

and recompile. It should now compile without error.
Now Upload the code and when it finishes, about 10 seconds, the clock should burst into life.
Congratulate yourself.


I followed the instructions, but my sketch isn’t working and it’s full of errors.
I installed (i think correctly) the Charlieplex and RTClib.zip libraries. Then i deleted the “,16” from the code.

There goes Error1 - i attached

I had a line :

#include <Charlieplexing.h>

but it didn’t work. I changed it to - thats how the library is called and it turned yellow:

#include <Charlieplex.h>

There goes Error2 - i attached
With the new line i had problem with the WPogram which i have built in both Charlieplex and RTClib libraries. The problem was in Charlieplex. I saw here some solutions, and i changed the code line in Charlieplex.h:

#include <WPogram.h>

to

#include "Arduino.h"

There goes Error3 - the longest which i attached

I can’t fix it or do anything at here. I really need your help. You are my last chance :frowning:

Please, help me if you can! There’s also a Teamviewer program, where you can control my PC.
The “Chronos.ino” i attached is my sketch and my program. Up there in links you can find the original, maybe the problem is in my PC/with me, not the sketch/code alone.

Chronos.ino (29.8 KB)

Error1.txt (521 Bytes)

Error2.txt (537 Bytes)

Error3.txt (22.7 KB)

So your personal school project is to get someone else 3 year old code uploaded in an arduino ?

Did I get that right? How old are you?

Put the library (charlie…) in the library folder. (It is not found where it is now)

Remove “#include <WProgram.h>” (or change it to Arduino.h)

Read the instructions you have already.
Remember to add the original authors name in your comments

J-M-L:
So your personal school project is to get someone else 3 year old code uploaded in an arduino ?

Did I get that right? How old are you?

You're right. I'm 19.

I don't have any experience with arduino, until i started doing this project.
I was learning c++ on beginner/amatuer level. My teacher was a 22 year old alcoholic. So, that's my knowledge.

I choosed this project because i liked it, i'm interested in working with arduino and LEDS, and it looked easy. I'm learning how this code works etc. I'm also doing a document about this project and trying to explain things about it, not only the code.
Working with arduino as closing school project is a big +, because we didn't learned it in school. I'm doing my best to get a good grade and to continue to high school.

what Arduino do you have?

J-M-L:
what Arduino do you have?

Arduino Uno Rev3

knut_ny:
Put the library (charlie…) in the library folder. (It is not found where it is now)

Remove “#include <WProgram.h>” (or change it to Arduino.h)

Read the instructions you have already.
Remember to add the original authors name in your comments

I have charlieplex in correct library folder. I think, but i’m not sure.
Documents->Arduino->Libraries

In the arduino software its in the “contributed libraries”.

I did remove the "#include <WProgram.h> and even tried changing it to “Arduino.h” but then i had the next error which you can see in Error3.txt

If you mean authors who did the code, I’ll add them to document/project for sure.

which you can see in Error3.txt

Maybe you can. I can't.

PaulS:
Maybe you can. I can't.

How do you mean it?
You can't download the Error3.txt file which i attached or how? I can upload it to somewhere else.

Or you mean that you downloaded the sketch/program and it's working for you without errors?

If anybody really wants to help me, we can arrange a time and we can use the TeamViewer so you can check in my PC where is the problem and why that isn't working. Maybe i am too stupid and i did something wrong.

I don't see an attachment in the post where you claimed to attach it.

I see that you have butchered the original post. I don't deal with people that do that. Good luck.

Raizen1337:
Arduino Uno Rev3

and you have a LoL Shield as well?

the code is really old and not matching current specs, typedefs etc... Probably a massive rework is needed not to mention the soldering and everything else that is needed which you can get wrong...

This seems quite a risk for you to embark on this - probably would be worth considering doing something more within you reach.

PaulS:
I don't see an attachment in the post where you claimed to attach it.

I see that you have butchered the original post. I don't deal with people that do that. Good luck.

Hey. I attached everything what was needed to the main post.
You can see it here too: http://i.imgur.com/sgUlXjs.png
I uploaded it for you too: https://www.sendspace.com/file/8z0um1

Have a look at it if you have time :slight_smile: Please.

If you mean i "repeated" the original post - yes thats true. I did it because i didn't follow the rules in my first topic. I didn't want to refresh it either that's why I made a new post following the rules. I'm sorry for creating a new topic. I said the last one can be closed or deleted. I wrote all the informations here. Sorry again!

J-M-L:
and you have a LoL Shield as well?

the code is really old and not matching current specs, typedefs etc... Probably a massive rework is needed not to mention the soldering and everything else that is needed which you can get wrong...

This seems quite a risk for you to embark on this - probably would be worth considering doing something more within you reach.

Yes. I have a LoL shield. But not the same you linked. It's bigger with bigger LEDs.
Here's what i bought: SHIELD-LOL-10MM - Open Source Hardware Board

It's almost the same.. isn't it?

....

This is really bad news for me. Nothing can be done with the code/sketch? I wouldn't mind if half of the applications aren't in my project.. i just need some of them :frowning:
The soldering is done but i could change it.. depends on what i need :slight_smile:
Can you help me something more? I would appreciate it really much.

...........................................

I tried something new. The library I downloaded from the instructions was called "Charlieplex" but in the original code its called "Charlieplexing". Then i found a Charlieplexing library in LOLShield-master from Jimmie Rodgers. I deleted the "Charlieplex" and installed the "Charlieplexing".... The same problem with it - Error3.

But in this LOLSHield-master i found interesting applications which works .. i mean i can compile them LOL.

Would it work for my LOLShield? Which is bigger then the usuall? Does it matter?
If yes.. i need to connect the arduino and the LOLSHield only? ... or i need a protoshield and to solder something?
If everything is OK and i can connect it i think i need a power supply.. a 9V is OK or i need bigger/smaller?

Thanks everybody for the answers!

I did not download anything from Jimmie Rodgers web site as it has been flagged by my web browser as potentially holding viruses... be careful.

Your error 3 is about

'prog_uchar' does not name a type

In older version of the IDE (before 1.5.something) you could do.
prog_uchar text[] PROGMEN = { "Hello" };now you need to do const unsigned char text[] PROGMEM = { "Hello" };

I would suggest to just do a typedef or replace that by const unsigned char

Richard - I am not clear whether you have ever got anything working on the LOL shield.

I have a LOL shield and it works sitting on top of an R3 Uno with IDR 1.5.6-r2 and a Charliplexing library of uncertain origin. I don't recall where I got the shield or library from but you are welcome to a copy of the library and a working program if it is any help.

J-M-L:
I did not download anything from Jimmie Rodgers web site as it has been flagged by my web browser as potentially holding viruses... be careful.

Your error 3 is about

'prog_uchar' does not name a type

In older version of the IDE (before 1.5.something) you could do.
prog_uchar text[] PROGMEN = { "Hello" };now you need to do const unsigned char text[] PROGMEM = { "Hello" };

I would suggest to just do a typedef or replace that by const unsigned char

Wow!!! Thanks!!!
It worked!!! And I can compile the sketch without errors!!! :slight_smile:

I didn't know what is "typedef" - searched on google .. but i decided to rewrite everythign for "const unsigned char"

const unsigned char Setup[] PROGMEM = {31, 20, 127, 21, 114, 22, 88, 23, 5,0};

It looks like this now. Without the "prog_uchar" ..

...............

Then I still had some problems but i fixed it somehow.
I had a line which looked like this:

prog_uchar *sentence_table[] PROGMEM = { ....blabla....

Then:

const unsigned char *sentence_table[] PROGMEM = { ....blabla....

But some erros will still popping up. I deleted the * from *sentence_table and it worked. Same went for another line in code.

I'm happy! And I'm really thankful for you. Thank you everything!!!!

UKHeliBob:
Richard - I am not clear whether you have ever got anything working on the LOL shield.

I have a LOL shield and it works sitting on top of an R3 Uno with IDR 1.5.6-r2 and a Charliplexing library of uncertain origin. I don't recall where I got the shield or library from but you are welcome to a copy of the library and a working program if it is any help.

I didn't even tried anything with the LOL Shield yet.
I just put the LOLSheild on top of the Arduino ... upload the code from the libraby Charlieplexing ... then I need a 9V adapter plugged into the Arduino? That's all ?

had a line which looked like this:

prog_uchar *sentence_table[] PROGMEM = { ....blabla....

Then:

const unsigned char *sentence_table[] PROGMEM = { ....blabla....

But some erros will still popping up. I deleted the * from *sentence_table and it worked. Same went for another line in code.

NO you can’ remove the *, it means it’s a pointer… if you remove it then you’ve changed the behavior… you’ll have bugs…

for example this is how you declare individual strings in PROGMEM and then an array of those strings. Each entry in the array is a pointer.

#include <avr/pgmspace.h>
const char string_0[] PROGMEM = "String 0";   
const char string_1[] PROGMEM = "String 1";
const char string_2[] PROGMEM = "String 2";
const char string_3[] PROGMEM = "String 3";
const char string_4[] PROGMEM = "String 4";
const char string_5[] PROGMEM = "String 5";
// Then set up a table to refer to your strings.
const char* const string_table[] PROGMEM = {string_0, string_1, string_2, string_3, string_4, string_5};

J-M-L:
NO you can’ remove the *, it means it’s a pointer… if you remove it then you’ve changed the behavior… you’ll have bugs…

for example this is how you declare individual strings in PROGMEM and then an array of those strings. Each entry in the array is a pointer.

#include <avr/pgmspace.h>

const char string_0 PROGMEM = “String 0”; 
const char string_1 PROGMEM = “String 1”;
const char string_2 PROGMEM = “String 2”;
const char string_3 PROGMEM = “String 3”;
const char string_4 PROGMEM = “String 4”;
const char string_5 PROGMEM = “String 5”;
// Then set up a table to refer to your strings.
const char* const string_table PROGMEM = {string_0, string_1, string_2, string_3, string_4, string_5};

Oh. I knew that * means something… but I tottaly forgot it means a pointer :confused:
It’s bad that I deleted the * then saved? But i put it back… Do i get bugs now too?

I put the * back and this is my error:

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,

                 from sketch\Chronos.ino.cpp:1:

Chronos:169: error: variable 'sentence_table' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

 const unsigned char *sentence_table[] PROGMEM = { 

                                       ^

Chronos:188: error: variable 'bitmap_table' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

 const unsigned char *bitmap_table[] PROGMEM = {

                                     ^

exit status 1
variable 'sentence_table' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Can you still help me how to fix this? Please :slight_smile:

Should i change it to “const char* const XXX” like you linekd in the code?

show source code..

If you mean this:
(there are more cost unsigned char before this but i post some of them)

onst unsigned char Sixteen[] PROGMEM = {8, 187, 7, 129, 14, 194, 187, 7, 191, 128, 141,0};
const unsigned char Seventeen[] PROGMEM = {8, 187, 7, 129, 14, 194, 187, 7, 191, 128, 141,0};
const unsigned char Eighteen[] PROGMEM = {154, 4, 191, 128, 141,0};
const unsigned char Nineteen[] PROGMEM = {141, 7, 15, 155, 141, 191, 128, 8, 141,0};
const unsigned char Twenty[] PROGMEM = {8, 7, 191, 7, 147, 131, 141, 7, 191, 128,0};
const unsigned char Goodnight[] PROGMEM = {2,8, 179, 138, 138, 177, 141, 155, 191,0}; // 28
const unsigned char Hello[] PROGMEM = {183, 7, 159, 146, 164,0};
const unsigned char oClock [] PROGMEM = {8,137,8, 195, 7, 146, 8, 136, 197,0};
const unsigned char setupok[] PROGMEM = {2,187, 130, 191, 133, 199, 2, 137, 194,8, 154,0};
const unsigned char Oh [] PROGMEM = {8,137,0};

const unsigned char *sentence_table[] PROGMEM = { 
    Setup,HelloMyNameisClonos,Pistol,BigBen,Beep,TheTimeIs,TheTemperatureIs,Degrees,One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten,Eleven,
    Twelve,Thirteen,Fourteen,Fifteen,Sixteen,Seventeen,Eighteen,Nineteen,Twenty,
    Goodnight,Hello,oClock,setupok,Oh
};

and

const unsigned char fontZero[] PROGMEM  = {14,10,10,10,14,255,255,255,255,255,255,255,255,255,0};
const unsigned char fontOne[] PROGMEM  = {4,6,4,4,14,255,255,255,255,255,255,255,255,255,0};
const unsigned char fontTwo[] PROGMEM  = {14,8,4,2,14,255,255,255,255,255,255,255,255,255,0};
const unsigned char fontThree[] PROGMEM  = {14,8,12,8,14,255,255,255,255,255,255,255,255,255,0};
const unsigned char fontFour[] PROGMEM  = {8,12,10,14,8,255,255,255,255,255,255,255,255,255,0};
const unsigned char fontFive[] PROGMEM  = {14,2,14,8,14,255,255,255,255,255,255,255,255,255,0};
const unsigned char fontSix[] PROGMEM  = {14,2,14,10,14,255,255,255,255,255,255,255,255,255,0};
const unsigned char fontSeven[] PROGMEM  = {14,8,8,8,8,255,255,255,255,255,255,255,255,255,0};
const unsigned char fontEight[] PROGMEM  = {14,10,14,10,14,255,255,255,255,255,255,255,255,255,0};
const unsigned char fontNine[] PROGMEM  = {14,10,14,8,14,255,255,255,255,255,255,255,255,255,0};
const unsigned char Smile[]    PROGMEM =  {255,255,255,36,102,255,255,129,195,102,60,255,255,255,0};
 
const unsigned char *bitmap_table[] PROGMEM = {
  fontZero,  fontOne,  fontTwo,  fontThree,  fontFour,  fontFive,  fontSix,  fontSeven,  fontEight,  fontNine,  Smile};
char buffer[LEDrows];
const unsigned char* const sentence_table[] PROGMEM = {
...
const unsigned char* const bitmap_table[] PROGMEM = {
...

Whandall:

const unsigned char* const sentence_table[] PROGMEM = {


const unsigned char* const bitmap_table PROGMEM = {

I changed to this and it now compiles without errors.

Is it good now? The pointer?

After all… i fixed the #include <Charliplexing.h> – line with the new Charliplexing library…

Then i followed the instructions and deleted few words from a line (.16)

I also fixed the #include <WProgram.h> in the Charliplexing.h

Then thanks to your help i fixed the prog_uchar comamnd with the “const unsigned char”

I can compile now without erors.

Do you think the sketch/program is full and might work for me?

Can somebody control it for me please last time? I uploaded here with the new lines:

https://www.sendspace.com/file/1ll9ix


also. if i changed the lines in the code… do i need to re-do my soldering? From the instructions and project?

THANK YOU VERY MUCH !