Show Spark: WordClock project

Hi,
I tried to compile your code inside the web IDE and get the following errors - do I miss something here?

timeapi.cpp:3:1: error: 'UDP' does not name a type
timeapi.cpp:9:1: error: 'byte' does not name a type
timeapi.cpp:12:1: error: 'String' does not name a type
timeapi.cpp:24:1: error: 'String' does not name a type
timeapi.cpp: In function 'void sendNTPpacket(const char*)':
timeapi.cpp:63:9: error: 'packetBuffer' was not declared in this scope
timeapi.cpp:63:41: error: 'memset' was not declared in this scope
timeapi.cpp:78:2: error: 'TimeUdp' was not declared in this scope
make: *** [timeapi.o] Error 1

Hi Larry,

looks like the Spark Team updated the IDE in a way that broke my code. A new (working) version of the code is in the repository! :slight_smile:

Cheers,
Max

1 Like

Thanks for looking into this - still getting errors:

In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:31,
from timeapi.cpp:1:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
In file included from ../inc/spark_wiring.h:30:0,
from ../inc/application.h:31,
from worldclock.cpp:2:
../../core-common-lib/SPARK_Firmware_Driver/inc/config.h:12:2: warning: #warning "Defaulting to Release Build" [-Wcpp]
In file included from ../../core-common-lib/CMSIS/Device/ST/STM32F10x/Include/stm32f10x.h:459:0,
from ../inc/spark_wiring.h:29,
from ../inc/application.h:31,
from worldclock.cpp:2:
../../core-common-lib/CMSIS/Include/core_cm3.h:211:14: error: expected ')' before '|=' token
../../core-common-lib/CMSIS/Include/core_cm3.h:250:14: error: expected ')' before '|=' token
worldclock.cpp: In function 'void loop()':
worldclock.cpp:68:28: warning: statement has no effect [-Wunused-value]
worldclock.cpp:70:34: warning: statement has no effect [-Wunused-value]
worldclock.cpp:72:26: warning: statement has no effect [-Wunused-value]
worldclock.cpp:74:31: warning: statement has no effect [-Wunused-value]
worldclock.cpp: In function 'void adjustTime()':
worldclock.cpp:105:18: warning: statement has no effect [-Wunused-value]
make: *** [worldclock.o] Error 1

Error: Could not compile. Please review your code.

Hi @mhils,

I have been looking at this project. I appreciate your words on the front cover of the clock but i think i can get that sorted, one way or another. The bit I am going to have a problem with is the electronics and the code!!

By the way of components I was thinking of these LED’s

http://www.phenoptix.com/collections/leds/products/superflux-pirhana-led1

and some strip board to connect them together.

http://www.phenoptix.com/collections/prototyping/products/pcb-copper-prototyping-stripboard-64-x-95mm1

I could use some help with the PCB’s, mostly it is lost on me.

I note that you say -1 If you’re using my circuit boards schematics, try to combine them on a single board. Connecting boards via pin header works, but it’s not very stable. Also consider using a TIPC6B595 as @PaulRB suggested.

I understand what you mean about the pin headers. It looks a bit like a toy crocodile!. Do you think it would be possible to screw/fasten each board onto a longer supporting board to give better stability.

I like the idea from Paul RB. But I wouldn’t have a clue how to implement it. It sounds like it would make the project simpler to have one chip not two and being a beginner simple is appreciated. LOL

Hey I have downloaded the Eagle PCB software!!! What is the worst that can happen? LOL

@Julian, instead of using RGB Piranha Superflux LEDs and bothering with making your own PCB’s for the drivers you could simply use WS2812’s - they have a build in driver and can be controlled directly by the spark core which will simplify the design of the clock significantly. You get 100 “neo pixel” style boards for about $45 - at least this is what I’m considering :wink:

Hi @larry105, Thank you for the suggestion. I have done a bit of looking into the WS2812’s following your post and they look great! I will have to get a few in and try them out.

Do you have any experience of using them / sourcing them? Would I be correct to assume from your post that you are based in the US?

Compiles properly for me. Did you mirror the file names from the repo (with the exception of wordclock.cpp -> wordclock.ino)?

Cheers,
Max

@julian,

You can take a look at rgb123. Lovely WS2812 panels :slight_smile:

@kennethlimcp,

Nice one Ken. OK now we are getting really lazy!!! LOL (and for me to say that!!)

Those panels are brilliant. They do a 16x16 one, WOW, Ready made!!. LED’s stuck down in place ready for the job. I assume they have ready made code etc.

When are they coming to the UK???

I think with this idea the whole project needs a re-think. Just display the date, time, temperature and the price of tea in China, on a scrolling rainbow effect macro display!!

Not quite as classy as the original though.:slight_smile:

That is strange - I had to delete the entire app and recreate it with the new files only then it would compile without any errors ...

Thanks again for updating your code!

Indeed. However, with only 16.25cm board size probably not the best fit for a large clock (mine is ~45x45cm). Not to mention the 50W power draw. :stuck_out_tongue:

hi @larry105, have you made a front plate? how did you do it? Do you have some pictures?
I was thinking about the backing plate. The one with the holes in it that contain the LED’s. I was wondering if we could use a ready made solution like … a seed tray.

http://www.ebay.co.uk/itm/like/281205371640?limghlpsr=true&hlpv=2&ops=true&viphx=1&hlpht=true&lpid=108&device=c&adtype=pla&crdt=0&ff3=1&ff11=ICEP3.0.0&ff12=67&ff13=80&ff14=108&ff19=0

Paint it white. Maybe get a better/different size. Hey, dont laugh, it even has holes in it ready for the LED’s. :smile:

Well, just a thought. @mhils does your set up get hot?

Not at all. I have a power consumption of 20mA per LED + constants (Spark Core). Out of my head, not more than 5W for the whole clock probably. Heat should never be an issue, but someone needs to pay your electricity bill :wink:

FYI, there are pictures of my backing plate in the imgur album. I rasped some foam, which worked okay. If you have access to a nice drill, wood is the best fit IMO.

Cheers,
Max

@mhils, Please could I ask how you fastened the glass front onto your wooden frame?

Epoxy glue (UHU plus endfest 300 2K).
Magnets would have been nicer, but it’s rock solid now :wink:

1 Like

@mhils,@larry105,@kennethlimcp I am looking at using these LED’s in my word clock.

http://www.ebay.co.uk/itm/1m-WS2812B-Digital-RGB-LED-Strip-144-Addressable-Pixels-with-embedded-WS2811-IC-/380876919951?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item58ae08948f

I appreciate that this work has been done :-

https://community.spark.io/t/adafruit-neopixel-library/1143/12

My question is, can I have an uneaven number of pixels in an array? For example, I may have 8 in the first line and then 10 in the next line, then 6 then 12. Is that acceptable and workable or does the array have to be 10 x 10 or 10 x 12?

I guess that simply makes programming more challenging to suit the different number of pixels for each array.

With that said, it shouldn’t really be a big consideration imo. :smile:

After thinking about it for a while I decided to go with the Superflux LED instead of WS2812 (… sorry @Julian) - the reason is that a RGB LED does not produce a crisp white color and of cause that you have a higher power consumption since you need to power 3 LEDs instead of one. You can of cause do some nice effects if you go with RGB (like day/night etc.)

I did a test using a MAX7221 driver as well as a few LEDs to verify that the SW side works well.

1 Like

Hey @larry105, no problem. I am still thinking??? I have not bought anything yet. The thing I like about the WS2812 system is that the LED’s are already connected and there is a library ready to go.

@kennethlimcp thinks the coding won’t be too much of a problem, but then he is ace (and I am a numpty! :)) So I am still thinking to go for the WS2812 at this time. I think I will even need a hand with this (but hey it is a learning experience).

How are you planning on connecting the superflux LEDs together? I think they are breadboard ready but I have not looked at how to connect them.

WS2812 won’t be too hard to program. We can write up some test program when you have them.

I have a 1 x 8 so it can still be handy to see if the test program works and send over to you :smile:

1 Like