Maker Mind MelD Summit

Mark Wilson - FlipClock

Flipping pixels is easier than flipping plastic. Mark created an Arduino version of the classic “Flip clock.” In place of motors and gears and split flaps, he created a plausible-looking rendering of a device on a 480×320 pixel LCD shield. The impetus for the project was the challenge of creating a reasonable animation of the flipping action.

The character information is run-length encoded scan lines; omitting some lines creates a tilted look. The LCD interface is an 8-bit parallel one. With direct port-register access and careful coding, even a lowly Uno can achieve pleasing results.

The vivid colours supported by the reasonably sized and priced LCD inspired Mark to play with some additional ways of showing the time, up to the program capacity of the Uno.

Watch full video below

Useful resources


Peter Dalmaris: Hello everyone, and welcome to this exclusive How I've Made This Session. I'm Peter Dalmaris, an online educator and maker, author of Maker Education Revolution, and instructor at Tech Explorations.

Peter Dalmaris: My mission is to help people learn electronics programming, printed circuit board design, and lots more. But most important, to help as many people as possible to enjoy the tinkering with technology and with their technology education adventures.

Peter Dalmaris: In this session, I'm really excited to introduce you to my guest maker, Mark Wilson. Mark is also known by his nickname Funny Polynomial, which I quite like, actually. Mark spent part of his younger years coding his Acorn Electron in BBC Basic and 6502 Assembly. And I've actually tried that myself and it is fun. It's good fun. He used this computer to code many implementations of Conway's Game of Life.

Peter Dalmaris: He later completed a Master's in Physics, about which he has expressed his surprise, and became employed as a software developer. His career as a software developer brought Mark to where he is now and into the world of electronics and the Arduino.

Peter Dalmaris: Mark discovered the Arduino in 2011 and started building gadgets. One of those gadgets is KENBAK-uino. KENBAK-uino is Mark's implementation of an early computer of the 1970s, inspired by the Kenbak-1, a computer built in 1971. Kenbak-1's only user interface consists of 12 LEDs and 17 switches. KENBAK-uino is powered by, of course, an ATMega328.

Peter Dalmaris: I came across Mark's work as I was browsing Hackaday, and I was impressed by one gadget in particular, FlipClock. FlipClock is a clock powered by an Arduino Uno and a color LCD screen. What is amazing about this clock is the quantity of the animation that Mark achieved, considering the hardware limitations set he had to deal with. It's hard to believe what Mike was able to do with just 32kB of flash memory and 2kB of RAM.

Peter Dalmaris: Mark admits that he enjoys coding, pushing pixels around, and horology - that's a word I really hear. So, I invited Mark to join me in this session and show us how he did it. So, Mark, thank you for accepting my invitation and I'm really looking forward to your presentation and learning more about the FlipClock. How are you today?

Mark Wilson: I'm very good. Thank you. And the t-shirt of the day, 6502. We're going to be in rotation anyway.

Peter Dalmaris: That's awesome.

Mark Wilson: Well, thank you for having me. I hope this is informative and of some use to some people out there aspiring to make an Arduino.

Mark Wilson: So, here it is here. Exactly at a clock, that's good timing. And if we pause, we probably won't see a flip because a watch clock never flips. So, you see, it's quite a simple little device. And the origin of the device - and I've made several other Arduino devices, several different Arduino projects, a lot of clocks. I do enjoy making clocks - I think recently on Hackaday, there was a suggestion of making the clock is a cliche. And I guess that's true. But I also have a theory that it's that minimal useful thing. You know, when you've finished it, it actually has a purpose and has a reason to be sitting around in your home.

Mark Wilson: Whereas, a lot of things, a blinking LED isn't very useful. And, of course, anything more complicated than that gets to be quite complicated. So, I'm a big fan of making clocks and there are plenty of opportunities for different design ideas, different ways of displaying the time.

Mark Wilson: The origin of this particular one, as I was working on another project with an LCD, with interface of the LCD and there's this whole complicated ecosystem of LCD shields, clones, it's quite complicated. But this particular one, and I think most of them, are very simple interface where you can send some commands to the device to define a rectangle on the screen, and then you stream a series of pixels, and it will fill in those pixels and everything.

Mark Wilson: So, I'm doing that, I think I've seen an ad, a travel agent ad, where they tend to use those flip displays in the airports. I was looking at that and it somehow came to me the idea of defining the latest for a clock, the flip things. And by omitting a certain number of rows, I can get the look of a tipped FlipClock flap.

Mark Wilson: And I sort of filed that away until later on I came across a quite large, nice, and colorful LCD, so I set about implementing it. And it did take a long time because I was concerned about making the animation of the flip look reasonable, quite fast. It stayed say with me as an idea, I think, until two years, two years went by.

Mark Wilson: So, the gist of it anyway is that the essence of it is for a flipped digit to draw three out of four rows, which achieves an apparent angle in 2D, admittedly an apparent angle of 41 degrees. Which is pleasantly close to 45 degrees because that flip tends to have three steps, there, there, straight up, straight down, and there. And I can later on flip to a screenshot of the animation.

Mark Wilson: So, I spent a lot of time working on this and encouraged by pleasing results. I'm always motivated by doing a little bit and seeing the results. And that's the cool thing about playing with an LCD, you could see cool graphics.

Mark Wilson: In many ways, this is also sort of the opposite of my job. At work, I'm dealing with too many lines of code. I've got two monitors, 500 gig of space. And here I'm dealing with 480 by 320 pixels, 31K. So, it's a nice opposite of work, one of the things I enjoy about it.

Mark Wilson: Also, just the challenge of working in small spaces with very, very limited results. And while it's true and I'm sure, I know there are phone apps and so on that will do this look. You can get a clock for your phone that has the FlipClock store, where's the fun in there?

Peter Dalmaris: Actually, Mark, just as you're saying that, I've got to say that I have tried myself to build a clock using the [indecipherable] I'm familiar with. But I went a different way to what you did. Like, I want to make my clocks super complicated, probably because I'm influenced with apps on smartphones, touch screens, and lots of capabilities synced with Internet clocks, putting reminders on alarms, time zones.

Peter Dalmaris: So, I thought the Arduino 1 won't be able to do that. Then, I thought I'll do it with the Raspberry Pi. And that's what I've got bogged down by all this functionality that I want to put in that gadget. Where you said, "I want to use an Arduino to build something simple," just one key feature. You want to make it realistic and you want to achieve that animation. So, do you think that that was the challenge would just get that one thing right using those limited resources that you mentioned? Maybe that's a good lesson for us to take as well. It's good for one thing.

Mark Wilson: It was all about getting that look fast enough that it looked subconsciously like it had flipped. You know, I stopped looking at each frame because the shading and so on isn't so great. But, yes, it was, first and foremost, about can I achieve a reasonable looking flip look? And having got that, I did make quite a bit from that.

Peter Dalmaris: Yes. But it was one thing that got you started.

Mark Wilson: Absolutely. I think that's the important thing for me is to be on the lookout for inspiration and challenges that are the right balance between not being trivial, and also not being so hard that you get discouraged, and that kind of thing. And, you know. Sometimes it turns out okay. Actually, that wasn't trivial and it wasn't super hard. The happy medium.

Peter Dalmaris: Well, you've got a history of projects like that, right? You look for something simple, like the 1971 computer.

Mark Wilson: But that, ironically, is my first project. It was quite well, but the software simplicity and hardware simplicity. And as a software guy, I consider those two different categories, because the software is endlessly mutable. I can fiddle around with it to my heart's content. Once you hit hardware, it's a little different. It's least forgiving once you start soldering things, but that's a whole another thing.

Mark Wilson: And that's actually one of the things about this thing is the absolutely minimal enclosure. Because on many of my projects, I've done all the coding on little prototypes sitting on my desk. And then, I get this [inaudible], "Okay. Now, I need an enclosure for this." And quite often there's a lengthy pause there when I wake up, "How am I going to do this?" Because my go-to is laser cut. But, you know, that's quite an involved thing.

Mark Wilson: And it's a tricky transition going for a purely software, entirely virtual to physical things that you've got to pull together and make fit. And nine times out of ten, I never had quite as much room in the enclosure as I would really like.

Peter Dalmaris: I think that's a common problem. I have the same thing. That's one of my motivations for actually purchasing a 3D printer, which I never really ended up using because it's so slow and all this. You end up with an enclosure issue. You built an enclosure for what you thought originally will be good enough and then you've got to do it again, and it takes another couple of days of design prototyping. I would say, eventually give up. But, yeah, that's a common problem.

Peter Dalmaris: So, in your case, you're using a much simpler solution to finish up your project. You don't go for a complicated enclosure, 3D printed. What's your solution to that?

Mark Wilson: Well, in this case, it's just two plates to an effect. In fact, the way it's made, which is also trying to minimize the hardware complexity in that it's an Uno with a blank shield sandwich of three boards. Uno, blank shield with the RTC module and a couple of buttons, and then on top of that, the LCD. So, it's a stack of three things. In effect, it's wide enough that it would stand by itself. But I figured I'd give a little bit of protection. So, to laser cut acrylic plates and that's it. And it makes it quite liberating.

Peter Dalmaris: For spaces. So then, that now stays permanently on your desk and studying the time. Tell us how you've done it. Like, maybe walk us through your process. I know that at least on the software side it's quite involved. So, the floor is yours. Show us how you've done it.

Mark Wilson: It's quite involved. I'll switch to share the IDE. So, here's the Arduino IDE. And the first thing you see is a couple of tips. I think you can see that.

Mark Wilson: This is the first tip, the primary sketch, the primary file. It also includes some comments, but not a great deal going on here. So, my approach is always to go for new tabs, new files early. This is not exactly object oriented, but I do try to apply some of those principles, in particular division of labor.

Mark Wilson: So, basically, I'll have a C++ file, cpp file, a hit file for every distinct kind of thing that's going on. So, I've got a button file and this is the module that's responsible for debouncing the buttons and telling me whether they're being pressed, withheld, that kind of thing. There's a clock, which is actually the main logic for the FlipClock. Config, which is a class that reads and writes settings to a e-prompt. So, it's got us setting here about whether the clock is running in 24 hour mode or not. It's also has a method to call to bring up the configuration screen. And so on and so on.

Mark Wilson: Cubes, you see different faces for the clock, and a lot of them. In fact, that's one of the slightly awkward things about the IDE, it tends to not do so well when you got a lot of tabs. But my approach is always to divide it up into separate modules, just keeps things cleaner, you know where to go. I've seen plenty of projects where it's single file of many, many lines and it's constantly going up and down. It's suboptimal.

Mark Wilson: And if I was at work working on my job, I'd be trying to make a bigger effort to be object oriented, cleaner interfaces, that kind of thing. But I'm not at work, so I sort of relax about that kind of thing. I can give myself a break and have some globals, you know. But having said that, I do try to have namespaces. If nothing more than a class with some static names, not that it is. So, that's my approach.

Mark Wilson: And then, I had to grow it. I mean, this would have started off as one file. And these are files that I've used in other projects as well so I can drag and add to the project, the button stuff. I know it's going to be bouncing properly. And then, the thing just grew and grew.

Mark Wilson: And as you all know, if you read the project, I did the FlipClock and then found that I had space left over of the 32k, and was quite inspired by the LCD. So, I threw in a [inaudible] clock and a crazy cube based clock and sort of a triangle one. A number of box until I find a filter this picture and then at point I'm stuck. And, also, you know, I like them all. I didn't want to make four of them, so I combined them one to one. You press a button and it switches between faces, and if I get bored I can switch to a different face. So, that's my work.

Mark Wilson: I don't know what else I can say about my approach. Like I said, I'm motivated by making progress. So, incremental progress is good. I also almost always on the main file have a to-do comment, which is a to-do list.

Peter Dalmaris: Yeah. I was about to ask about comments and documenting the code in the code itself, not separately, and how do you do that.

Mark Wilson: I mean, actually the files will work, I'll be running far more comments, probably - well, maybe not. But here, it's a cliche, but you'll save yourself so much time when you write some function, you at least put a one liner in there to say what it's going to be doing. Because you could come back to it six months later, you may well have forgotten. So, use comment, clear names, all those general programming principles. But one of the important ones is division of labor.

Mark Wilson: There's a class that's responsible for talking to the LCD and all the nitty gritty details are hidden away in that. There's a class for talking to the real time clock module. And pulling that data out from the real time clock module, which is in BCD and converting it into decimal. But all that's tucked away in separate modules. It just makes life so much easier.

Peter Dalmaris: So, what's your approach to using external libraries? Because from the quick look that you've given us, I don't see that many inclusions of third party libraries. Do you actually use any? Or do you just try to [crosstalk]?

Mark Wilson: I do sometimes. I think this one does use - no. It doesn't. But others I've used an I2C library that allows you to pick the pens. I suspect this one does. It's a really big project, I forgotten what's going on here. But this was saying that the ecosystem of LCDs. And there are a number of large libraries that deal with all of them. And you sort of configure them and say which one you've got. And I've had limited success with those.

Mark Wilson: And, also, I personally just really like peering it down to the minimum and having all of the code as one. Because it's not a craft with those libraries. Well, I tend to think there is. And, also, because as a general, they're often quite slow. So, with this one, I found some code associated with the LCD, and I've modified it, and put my own layer on top of it. Modifications like doing direct register Xs, so instead of doing digital right and that kind of thing.

Peter Dalmaris: But you had to really get into the nitty gritty of the display hardware and learn about its internals in a way so that you can program it directly instead of a generic library.

Mark Wilson: To a library, yes, you do. But these are Arduino register, so it's a lot of it. It's in the data to the LCD.

Peter Dalmaris: I also noticed that you don't have files with an INO extension, which are the ones that the Arduino IDE really understands and automatically includes. So, you are kind of more oriented towards using just plain C for your Arduino program, especially of this size instead of going through the framework.

Mark Wilson: Well, the FlipClock is an INO. But all the other ones, yeah, I guess I've always just done CPPs because that's what I do at work. It's what I think was the natural way of defining additional files. The top INO, I guess, is required because that falls across the ones to the folder. Well, who knows how the Arduino does its stuff but behind the scenes, the symmetric INO? Because it really just compiles, I think, every files in a folder and tries to link them together.

Mark Wilson: This is the pattern I'm going to without really thinking about it too hard. And I always have a pragma once data file. I'll usually have the class and then I'll have a single instance of that class, which is defined.

Peter Dalmaris: So, you can access it.

Mark Wilson: There's a single global two button objects. In this case, there's a single clock object. I'm not saying it's the best way to do it. There are probably better ways. But it works and like I say, it's fairly relaxed because it's a hobby.

Mark Wilson: I've relatively recently started using some of the more modern - well, I think it was modern - pragma once. I used the derivative underscore file name, that kind of nonsense. But this pragma once is quite nice. And I've only recently realized that you can, for example - just getting a little technical - so I'm using enums, enumerations, here for various things. This enumeration is the various faces for that clock, so it's got the flip clock, cubes, triangles, random. 

Mark Wilson: But you can use, for example, the class keyword here. I don't know when that was introduced into C++, but it makes the same enumeration and more strongly typed.

Peter Dalmaris: These are some of the things that they're not really easy to find as a beginner. Like, there's no book that I'm aware of where all these things are concentrated and you can just sit and learn. How do you go about this? Are you bringing a lot of knowledge that you have from work from other projects? Because another thing that happens with the Arduino is that the C/C++ implementation is like a subset of what you'd find on a PC. So, how do you discover what works and what doesn't?

Mark Wilson: I guess I've just tried it. I just recently tried class. You know, the class [indecipherable].

Peter Dalmaris: It worked.

Mark Wilson: And another one I tried, you can always see this up. You know, in C++ you can do things which is effectively an attribute on the method. That's a silly example. But what it basically means is if this method returns on end, you can't just ignore what it returns. You have to acknowledge that it's returned, success or failure or something. But it turns out that that feature is not supported. Who knows? The feature isn't the idea might be?

Mark Wilson: But I've been doing C++ for 25 or 30 years, so I just know. I don't know how to advise someone getting into it. You can just write. You can just write C. It just gets harder and harder with a big project. And there's really no reason even this to be a big project. It's only a big project because I thought I have got [indecipherable] over and I quite like this LCD and I'll throw this extra stuff in.

Peter Dalmaris: A couple of questions are popping up now. Just a basic one is the IDE itself. I'm sure you're using something totally different at work when you're building large applications. Have you considered using something else for the Arduino as well for projects like this with, like 20 files, PlatformIO, or some NS code, or one of those editors?

Mark Wilson: I've heard of those and I've thought about it, but I haven't been motivated to switch over. I mean, this works for me. And it works and I'm used to it. And it's that clear division of what to do here at home as a hobbyist and what I do at work.

Peter Dalmaris: It's amazing. Like, I've never built a project of this size for the Arduino. And I kind of felt that I need to move on to something more capable. Block syntax highlighting, for example, once I get used to that, it's hard to go back to the Arduino IDE.

Mark Wilson: I might well find that. If I ever switched, I would probably look at this as kind of a bit of a toy. And any other syntax highlighting is a little annoying. If you happen to name a variable or something - there we are - I've got parameters called min and max and it's highlighted because there methods called min and max.

Mark Wilson: So, yes, it's a bit of a toy, but I actually quite like it. It's all part of the sort of casualness, the limited space, limited resources. But it's all part of that environment, I think. I think it's quite quaint, perhaps.

Peter Dalmaris: Yeah. No, I agree with you. I do feel more relaxed myself when I use the Arduino IDE versus PlatformIO, that I started using about a year ago. I feel happier. I don't know, it's just the simplicity. That's one thing that I like about the Arduino itself is that it's simple and I think it really fits well with the programming environment as well. The fact that it is also simple and that I don't have to be confused about its functionality.

Peter Dalmaris: So, I think there is a point to be made there. And it is becoming more capable over the years, newer versions, add more features. But as long as it doesn't become like a full blown Arduino IDE, then you always have that choice of simplicity vs. complexity.

Mark Wilson: You have a choice. Yeah. Yeah. But I think that this is quite friendly, and I think it's pretty accessible, and it does the job.

Peter Dalmaris: I've got another question, this is also a technical question. So, in your work, one of the cornerstones of software engineering is testing. So, there's people bragging about this one line of testing for one line of code that is doing stuff. How do you do deal with that for the Arduino? And in this particular project, how did you do all the testing? Because a lot of good things can go wrong, there's bugs. How do you find them?

Mark Wilson: Well, I use it a lot when I'm sitting here for hours at a time playing with it.

Peter Dalmaris: Time passes, you need a clock.

Mark Wilson: Sorry?

Peter Dalmaris: Time just flies through, you need a clock.

Mark Wilson: One of my early projects actually is sitting on a table over there, it was a clock with a red button and a green button. Where I would sit down if I was going to work on a project, I'll push the green button so I've started working. And then, I press the red button at the end, it's an indication of how long have I actually been working on this thing. But after a while, I stopped doing that because it was quite depressing.

Mark Wilson: So, you see, I'll work and I'm building it up incrementally, usually. So, I'm sort of testing as I'm going. It's like I would test anything. I interact with it. And, you know, sometimes things will surprise me, and I think it's pretty good. And I put particular effort into it when I know I'm going to be publishing it, you know, I'm going to be putting it out on the web or whatever. If it's just for my own internal consumption, I wouldn't be too concerned about it. But when I know other people are going to look at it.

Peter Dalmaris: Is your testing automated or just you've got, like, a routine of I'm going to press this now and see what happens, and when it changes variable, upload again, print out to see what happens?

Mark Wilson: It's a mix of those things. When I know there's a corner condition that I need to test, you know, I will have a little to-do list of corner conditions and explicitly exercise those. Once again, it's been pretty relaxed about it so I'll try to cover all the bases and do my best. But nowhere near the rigor that I would have in a work project. But that a work project, there are other people who test my software for me, which is good and bad.

Mark Wilson: But, yes, just me. And I'll put a fair bit of people into it. But it will still surprise me. And I'm still finding minor issues. One of the problems I found in this project was taking photographs of it. Getting the angle right and avoiding glare, and that kind of thing.

Mark Wilson: So, relatively recently, I modified the sketch so that the commands and the data that I seen with the LCD, I see that the serial port as well. And I capture that and file, write some Python code to interpret that to, basically, build a screenshot, a PNG, of that other screen. And, of course, in doing that, I got some weird results which don't show up on the LCD, but were showing up in this program. And I think it was something to do with integer overflow.

Mark Wilson: I think sometimes the Arduino with complicated expressions, I sometimes get unexpected results if I'm mixing like a bite-type and the end-type. Sometimes the conversion from type to type will surprise me and I'll get not a result. So, it's neither free of bugs, but, you know, it's good enough.

Peter Dalmaris: Yeah. That's right. There's another element, I guess, of the kind of work that you're doing is that it's fun. It's educated on a bug. But I guess one thing that I've found with projects like that is that, probably, a main method of figuring out whether it's working as it should is to just let it work for a large amount of time, like for a few days, a few weeks.

Peter Dalmaris: In the case of the clock, it's interesting to see what happens when it flips over, like when it goes straight from 11:59 switches over to midnight, 00:00, to see if it actually managed to do that without crushing or rebooting or something like that. Like, those edge conditions, you can actually foresee and expect them and wait to see what happens.

Mark Wilson: That's good point. And, in fact, one of the things I sometimes do is introduce a testing mode. So that, for example, it will rapidly flow through. So, for a minute before it flips, it will just go flip, flip, flip, flip. So, I can exercise all those. And, in fact, that brings up a good point. There is a bug in it in color feature.

Mark Wilson: I think there are scenarios where the digit is flipping and if it's, like, 8:59, when the five flips over to reveal a zero for, let's say, 9:00, you will actually very briefly see a six. Because the logic is just saying, "Well, what's the next digit?" And it's not taking into account the position and the fact, and so on, and so on. And I've discovered that the other day, it's quick, it's a flash. So, I'm not going to see what time and I spent a lot of time on this, and I'm happy that it's quick.

Peter Dalmaris: Yeah. Yeah. So, I tried to anticipate what can possibly go wrong. I guess one of the responsibilities of the program are, just like they had with designer, whenever you build something, it's not just to figure out how to get the thing to do what you want it to do, but also what can possibly go wrong. And both include methods of dealing with the problem, if you expect that it's going to happen or to avoid it in the first place. But somehow you need to anticipate it and, like, engineer the final device to deal with it.

Mark Wilson: Yes. So, thinking outside the box to imagine those sorts of scenarios that you clearly didn't think of originally is quite difficult. But, I guess, given enough time in tinkering with it, you'll think, "Oh. Well, what happens if I do this? Does it do the right thing for me at midnight? Does the date and the time all update?" Those sorts of things. So, yeah. So, a matter of giving some of that.

Mark Wilson: And as you're doing things in the code, you'd need to be conscious of, if I handled the case where the real time clock failed. I probably didn't. That's just one thing to keep an eye out for, that kind of thing.

Peter Dalmaris: Right. So, Mark, another question that I have is in relation to social control. Lately, I started using a GIT gate with my PlatformIO projects and also with my simpler Arduino IDE projects. All text or I use GIT to maintain history. Do you do any of that?

Mark Wilson: I do. There's source controls particularly at work. But relatively recently, last year or so, switch to using the home towards the [indecipherable] because I don't understand GIT. It's too much for my brain. And so, quite often, I've had a couple of that [indecipherable] ending stuff to code. At the end of that time before I shut things down, I'll check that [indecipherable] again. And it gives me a heavy feeling with a sensible check in comment, so I'm seeing a history of what I've done. And if I decide that I've really messed things up, I can go back. I can revisit those changes.

Mark Wilson: But before, I was forever copying things, making a zip, calling it R1, and then make another one called R2. It was just really weird. Towards the [indecipherable] out there that are free. And it also makes doing real backup's easy because you can grab the repository of all the things you've got, check them, and burn them on a disk. So, I highly recommend source control and having that discipline of doing recently regular check ins.

Peter Dalmaris: And it does become eventually second nature. Normally, I would just command S, command S after adding a couple of lines. But now when I finish working on a feature, just automatically before I think of what I'll do next, just take it into GIT. But I guess that's automatic for you as well, right?

Mark Wilson: It is and it's part of the discipline at work. And it feels quite reassuring to be doing that aspect of work at home. It does feel good. I was feeling a bit guilty about those big projects, it's been a long time, [indecipherable] lots and lots of changes. And there's just, you know, no source control. A bit I feel weird. So, I highly recommend it.

Peter Dalmaris: Great. So, Mark, show as the clock in action. Actually, we haven't seen it yet. So, what does it look like when it's working and flipping?

Mark Wilson: Sure. Well, I guess I was waving around, but it probably wasn't flipping at the time. So, this is a YouTube video, it's quite short. So, you can see the bottom, I put the big digits in there. There wasn't room for a colon in between so stuck in that. So, there, we have the flip. So, I think I'm quite happy with it. It's quite hard to not agree.

Peter Dalmaris: And you've got - what is it? - four themes that the clock can display, you can choose. There's a button, I think, on the back in the sandwiched assembly of Arduino shield.

Mark Wilson: A couple buttons. One to save the time. Let me just pause that.

Peter Dalmaris: That's the problem with YouTube, you never know what it's going to do next.

Mark Wilson: So, yes, there's another button where it'll cycle through the different faces. And I could switch to some photographs of that, if you'd like. So, here's the screenshot I was talking about, where I captured the pixel data in such a far clearer view. And as you can see, I've gone to ridiculous lengths making these little details because, you know, this was the ongoing second and third pass to refine the look.

Mark Wilson: This little blackboard is an indication of a wheel. But there's other colored clock faces as well. So, this is one which just draws some slightly distorted triangles and a really crude font of the time. And the colors sweep through each minute. The sort of color scheme changes. It looks quite cool. Here's another example. Here's an example of the stages and the flipping in each clock. Here's a weird little one which was, in hindsight, really hard to read.

Peter Dalmaris: Yeah. Okay. It's 1:52, is it right?

Mark Wilson: That's right. 0152.

Peter Dalmaris: You have to train the eye for this.

Mark Wilson: Yeah. It's quite challenging. But, you know, these are just that sort of things that I can't recall how this came to me. But I did find the font that looks a lot like this, eventually. But I was thinking about just things that are colorful. What can I do with this color, lots of colors? For me, thinking a bit about Rubik's Cube - yeah. I definitely was thinking Rubik's Cube.

Peter Dalmaris: And it's very creative. What's really interesting to me is that how the last two faces, I should say, or themes came after your original, relatively simpler, idea of what the clock would look like and how it would work. And that original simple idea gave rise to the Rubik cube type clock, which is I think it is a lot more complicated both to envision how it's going to work and then to implement it. A natural conclusion - not natural conclusion, but I guess part of the evolution of your idea.

Mark Wilson: The drawing of this was quite challenging given that the interface is to define a rectangle and flow of color. So, there are some tricky things going on there to get that look. And the same with this one here. Yeah, I was just inspired to play around until I run out of memory, thank goodness or I'd probably still be going.

Peter Dalmaris: And you did. Well, it took you a while, but eventually you ran out of memory even it was 32kB.

Mark Wilson: And, in fact, the very last clock - I don't have a shot of it here - but it's a little pawn clock, and it didn't quite fit. So, I had to do some slightly dodgy things to just peel back the theme a few bytes. I think making a function call, actually, it uses up a fair bit of memory. So, if you just reference globals to save space.

Peter Dalmaris: It's amazing. Well, I can see what you mean when you say that you like pushing pixels around. This is, like, the epitome of that.

Mark Wilson: Yes. That's what I did.

Peter Dalmaris: So, we're getting closer to the end of this session. I'd like to ask you how would you recommend or suggest to advise a maker watching this to learn from your work, learn from your project? How can they dissect what you've done to learn C++, manipulating pixels, working with memory registers, whatever, in the Arduino? What do you think?

Mark Wilson: Well, that's a big question. You know, an interested party could look at this case. There's a lot to look at, probably a bit overwhelming. I think for me the takeaway is about keeping an eye out for inspiration. And not being afraid to start with something simple and have it grow and grow. And there's a massive amount of stuff out there, help online. I don't know how useful it is. It's hard for me to imagine as a non-programmer or a non-experienced programmer to comment to this world. But, you know, it's that simple.

Mark Wilson: I mean, I started with making an LED blink or build an LED, and that was quite revolutionary. Here I am blinking many, many [indecipherable] like this.

Peter Dalmaris: That's right. I think your advice is really good. It starts with inspiration. The technical issues typically can be solved one way or another. But I think I see that for my status as well, it's the first step, that first inspirational step that seems to be holding people back. Like, you found this project, it just came to you because you are crazy about clocks and time keeping machines. And that became a project that brought you towards getting the Arduino to reach, really, its limits when it comes to graphics. And then, that gave rise to other projects later on and guided your learnings. But I guess that's the first step, right?

Mark Wilson: Yeah. You know, look out for something that inspires you enough to take the next step. And put the effort in. And the Arduino is surprisingly capable, so you can push it for a long way. Then, I would say that whatever you're doing, watch the word go, organize it carefully, division of labor, spread across multiple files, combing things, that sort of stuff. It'll help and you'll appreciate it six months later when you look again.

Peter Dalmaris: Well, I guess it's perfect because my next question is from a technical point of view. What are the three or four key learning? Said Git., Like, the listeners or the people watching this to take with them, I think you already hit one of them, division of labor is important. What else, again, from a technical point of view which you advise people to take away?

Mark Wilson: From a technical point of view,  Year division of labor. somewhat object oriented and divide the task up. Take it in small amounts. You know, incrementally grow the project. Start off by, in my case, start off by getting a single square on the screen. And then, a lot of us, you know, it was quite a step to actually get the thing working. So, take your time. And embrace the fact that it's not your job.

Peter Dalmaris: Just relax.

Mark Wilson: And weeks would go by where I just couldn't be bothered. But then, all of a sudden, I get pinged. That's been several hours every night. But pacing yourself is important. You don't have to do this, so any time you can just walk away.

Mark Wilson: As I said, I think that for me, personally, I think a clock is a really good thing. Because, like I said, to me, it's the minimally useful thing. You end up with something that's got a reason for living. It's got a purpose. Even though you're surrounded by clocks, you don't really need to know the time. It's got a clear purpose. Anyone else looking at it can see that it has a clear purpose.

Mark Wilson: And I guess the other thing, too, is that the other half is the hardware. And that need not be complicated. And the hardware in this project isn't complicated. There's a bit of soldering, but not a vast amount. It's sticking shields. And I took advantage of it. I mean, the shield, you just plug it in and it goes.

Mark Wilson: And the other thing, too, is an enclosure. You know, relax about having a beautiful and bamboo laser cut enclosure. You may not need anything. We could do something really simple.

Peter Dalmaris: Yeah. Yeah. Keep it simple. Exactly. 

Mark Wilson: Keep it simple. As simple as you want it to be.

Peter Dalmaris: Personally, the key take away lessons that you gave are all really good. One that I like in particular is the usefulness of the project. So, the LED and blinking, it is fun, but it's not useful. And it doesn't drive you to make the LED blink better or whatever. But a clock or whatever that other useful project might be, because it's useful, it will drive you to stick with it and make it work eventually. So, find that useful project that resonates with you and go for it. Relax and go for it.

Peter Dalmaris: Awesome. Okay. I've got one more. That's quite a lot of ground that you covered and, again, from a technical perspective, but also from kind of an approach and some makeup perspective, are there any learning resources that you have particularly found useful for yourself that you would recommend for us to also access and look for?

Mark Wilson: Well, Google. Google is free for all things, almost everything.

Peter Dalmaris: Any books, particular websites?

Mark Wilson: Well, the Arduino website and the forums, the Arduino forums, but all forums.

Peter Dalmaris: I think how can they as well look for inspiration.

Mark Wilson: Yeah. Yeah. Definitely an inspiration. Just look at things like a wallet, that's how I thought of it. It's not so much a technical support. I don't know where I get my technical support. You know, I'm a programmer, so the programming side comes kind of naturally to me. I do sometimes struggle with the electronics side. But there are forums, plenty of forums. I can't think of any now, but the Arduino one has got a lot of good stuff.

Peter Dalmaris: Do you have a favorite C or C++ programing book? Do you tend to be very big? But do you have a go to reference?

Mark Wilson: I haven't looked at a book for a long time.

Peter Dalmaris: You Google Things.

Mark Wilson: Yeah. I do. I really do. You know, a lot of those things I was mentioning about class and the no discard things, I look them up. There's really no data answer to most questions. And, really, you Google and type it up, and take it with a grain of salt. But until then, I'll go to the library or talk to people. So, I mostly use Google because that means I don't have to get up from my desk. It's just there.

Peter Dalmaris: Me too. Okay. Well, Mark, that was awesome. How can people get in touch with you? Do you have a favorite medium of communication?

Mark Wilson: So, I'm thinking you can message me here or potentially email. Do you want me to give out my email?

Peter Dalmaris: No. It's okay. We'll have your contact details.

Mark Wilson: It's a long e-mail, [email protected]. And it's funny, sometimes I even distract myself.

Peter Dalmaris: That's a true e-mail for a software developer.

Mark Wilson: So, that's probably the best way to approach me, I think. I'm happy to answer questions there.

Peter Dalmaris: Definitely. Do you have the code for your clock somewhere, like on GitHub or somewhere?

Mark Wilson: Well, it's here. It's somewhere down here. This is a zip file. Here we are at the bottom. I have a few things on GitHub. Do I have a link for that handy? I think I'm funnypolynomial on GitHub. Including the KENBAK-uino, if people are interested. And I'll probably put more things on GitHub. But this is fun.

Peter Dalmaris: Awesome. Well, Mark, that was awesome. I really enjoyed the presentation. I really get an insight about your work, especially FlipClock. So, thank you for taking the time to talk about it.

Mark Wilson: Welcome. Thank you for having me. I hope it was informative.

Peter Dalmaris: It was.

Get life time access to all Maker Mind-Meld masterclasses

Watch each masterclass from the comfort of your own home and learn about their tools, techniques, and thinking processes so that you can become the best maker you can be, at your own pace.

Get audio downloads of all 22 session, the Maker Mind Meld "Playbook" session notes.

We publish fresh content each week. Read how-to's on Arduino, ESP32, KiCad, Node-RED, drones and more. Listen to interviews. Learn about new tech with our comprehensive reviews. Get discount offers for our courses and books. Interact with our community. One email per week, no spam; unsubscribe at any time

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}