Daily Archives: 5/28/2015

Farewell…

You’ve probably heard the expression that somebody is a “man of few words”. I’m not that guy. I’m a man of many words. I love to talk. I love to write. And yet, it is an odd paradox that when you actually feel like you have something to say, the words fly from you, leaving you unable or unwilling to communicate.

Today, we had to say goodbye to Scrappy, our little gray striped American shorthair:

IMG_5314

I write this blog (in part) as a kind of a message-in-a-bottle to my future self.  On the anniversary of a post, it recirculates in the side bar on the left.  Usually it reminds me of some project I did (and likely abandoned).  Or something that I was interested in.  A year from now, what am I going to want to remember?

He had the most beautiful green eyes.  He never stopped trying to learn to speak.  He would look you right in the eye and patiently meow at you repeatedly until you understood what he wanted you to do.

He knew he was part of our family.  In the evening when we’d be watching TV, he’d find a place between Carmen and me, either on the couch or on the folding footrest of our recliner and would sit and sleep while we watched TV.   If we went upstairs, he’d do the same, until we turned the TV off and then he’d wander off.

Despite being deadly to birds, lizards, and dangerous to other cats, he never scratched or bit at humans.  Even when when we gave him a bath, or had to put him in a box to take him to the vet, he would struggle, whine, or complain, but never hiss, never bite, never scratch.   And after we’d finish bathing him, he’d get over it immediately, knowing that we were just trying to help him.

He purred a lot.  He could meow loudly and insistently.  Especially in the morning when I was late feeding him.

He was smart.  He learned to raise his paw to beg for special treats.

He loved catnip and to play with his orange shoe lace.

Yesterday he was outside, sniffing at the grass, just sniffing.  He loved sunshine and fresh air.  While we may have converted him from a mostly feral outdoor cat into an indoor kitty, he always loved to be outside.

We were with him at the end.

He was special.  He was loved.  He is missed.

 

A 4 digit, 7 segment display board based upon the TM1637 chipset…

Yesterday, I got a small 4 digit, 7 segment LED display board in the mail from dx.com. Cost was around $3 shipped, and the module uses a 4 pin interface (power, ground, clock and data). Originally, I thought it was I2C, but like other modules I have received based upon chipsets made by Titan Micro (using the TM1638 and TM1640) it looks superficially like I2C, but doesn’t use the open collector bus and addressing scheme of I2C. You end up clocking commands to the board using two dedicated pins.

The driver that I’m using comes from here. It is based upon the driver from avishorp, but includes support for the colon that separates the two pairs of digits on this display, which I wanted to allow blinking to help indicate that the clock was running. This was my example sketch, which is completely unremarkable. It doesn’t set the time from a real source, I just hard coded it to set the time to a specific constant near when I compiled it.

[sourcecode lang=”cpp”]
#include <Time.h>
#include <TM1637Display.h>

#define CLK 2
#define DIO 3

TM1637Display display(CLK, DIO);

void setup() {
Serial.begin(9600);
// put your setup code here, to run once:
setTime(1432823831UL);
display.setBrightness(0xF);

}

boolean colon = true ;

void loop() {

// put your main code here, to run repeatedly:
int t = hour() * 100 + minute() ;
display.setColon(colon);
colon = !colon ;
display.showNumberDec(t, true);
delay(1000) ;
}
[/sourcecode]

It works reasonably well.


Addendum: I received this tweet:

Not a bad little trick to archive. Instead of using the Time library, you need to use the RTClib library. I modified my program above to do it. Here’s the new version:

[sourcecode lang=”cpp”]
#include <Wire.h>
#include <RTClib.h>
#include <TM1637Display.h>

RTC_Millis rtc;

#define CLK 2
#define DIO 3

TM1637Display display(CLK, DIO);

void setup() {
Serial.begin(9600);
display.setBrightness(0xF);
rtc.begin(DateTime(F(__DATE__), F(__TIME__))) ;
}

boolean colon = true ;

void loop() {
DateTime now = rtc.now() ;
int t = now.hour() * 100 + now.minute() ;
;
display.setColon(colon);
colon = !colon ;
display.showNumberDec(t, true);
delay(1000) ;
}
[/sourcecode]

Note: the time gets set to the time when the code is compiled. If you compile and install it, it will likely be a couple of seconds off. And when the Arduino gets reset, it will get reset to that same time. This is most useful in setting the time on an external time keeping module.