Andrew Que Sites list Photos
Projects Contact
   Someone at work made cookies and I ate too many.  So when I got home, a bike ride was in order.  It has cooled off significantly since yesterday but the temperature is still ride-able around around 50ºF (10ºC).  There was a fairly steady wind from the northwest at 7 MPH.  It wasn't awful, but it made for a chilly ride.  I did my Airport-Ashton run.  Over the summer I had been making this run at 45 minutes.  Today it took 1 hour, 1.5 minutes.  Still, I burned off 744 Calories and got some lovely sun shot pictures.
   Unseasonably warm weather today with a high of 73°F (22.8°C).  I rode into work and the temperature was already over 50 when I set out just before 6:00 am.  It was so warm I removed my sweatshirt about 2 miles into the ride.  The ride home was windy but so warm I hardly wanted my long sleeve breathable shirt.  I visited Pokie in downtown and we got dinner at an Italian place on State Street.  When I continued on home it was still very comfortable despite the sun having set.  Now I miss biking in warm weather because I remember how much nicer it is to do so!
   I do a lot of ordering from eBay from sellers in China.  Generally it works in my favor and I can get very cheap electronic parts for all my projects.  On occasion it doesn't work out.  I order 4 power monitoring boards.  They are designed to measure both current and voltage and communicate that information via I2C.  I found a distributor with a very good price and ordered them.  When they arrived, 3 were dead and only 1 was functional.  Two got hot just from having power, and one did nothing.  The seller packaged them in plain plastic bags.  The climate in Hong Kong is humid sub-tropic, and they probably don't have as much of an issue with static electricity as we do in dry winter Wisconsin.  I suspect the chips were killed by ESD during shipping.  Now I'm going to need replacements, and find some shipped in ESD bags.


   Skating again tonight with Liz.  The floor was quite open and everything seemed setup for a good night of hard skating, but I felt drained.  I skated the full 3 hours, and only because the D.J. left the music going for an extra song did I make my goal of 2,500 Calories for the night.  But just barely.  My average heart rate was 163 BPM (89% of maximum) which is a good rate, but my top end was only 186 BPM (101.6%) and my Calorie burn rate was 799 Calories/hour.  I haven't had a burn rate that low since December. 
   This week was the first week of returning to a set of push-ups each hour at work.  I started at 50/set and my arms hate me.  This is down significantly from August when I was able to do 100 or more each set, but a good starting point.  Perhaps the fatigue of the push-ups through out the week, maybe mixed with cycling both Thursday and yesterday were holding me back tonight.  It is possible.  I know over the summer if I had a long ride on Friday my Saturday skating was effected.  I will have to continue to monitor this.  Just because I don't feel fatigued may not mean my body isn't tired and recovering.  So this could be an interesting observation about myself.
   Biked into work today and nearing the end of my book on Joseph Stalin.  It was a long book, but it turns out it is just one in a series.  This one covers his life from birth to 1928 and did a fantastic job of outlining the politics of late 19th century Russia and eastern Europe.  I learned a great deal about how the Bolsheviks in all their unlikelihood ended up in power, how Stalin both obtained, and how his experiences and devotion to Leninism shaped his disastrous policies.  Very dry, but fascinating stuff.
   Pictured are sleeping trucks at a truck stop.

March 02, 2016

8-bit Balanced G-Code

   The other day my Arduino Mega knock-off arrived.  I have a bunch of Arduino Nanos, but a project I'm looking into needs a lot more I/O.  The Mega sports 56 I/O pins and will do nicely.  Today I hooked up a relay board to give the setup a test.  The Mega can drive the relays directly but I'm concerned they may draw too more current than the chip wants to provide.  So I think I am going to play it safe and use an external supply to drive the relays.  I ran some code that switched the relays just to hear them react.  Initially I ran a binary count.  I didn't feel like spiking the current and decided to run a Gray Code to the relay output.  Gray code keeps makes sure only one bit (or relay) changes at a time.  That's nice but still causes the first relay to clatter the most.  I wanted something that would make all the relays turn on and off the same number of times throughout the count.  I found balanced Gray code and that did the trick.  This setup isn't useful to me, but it was kind of a cool experiment.  Here is the code:
// 8-bit balanced gray code table.
// Copied from:
uint8_t const GRAY_CODE[ 0x100 ] =

// LED pin.
enum { LED_PIN = 13 };

void setup()
  pinMode( LED_PIN, OUTPUT );

  // Set all I/O on port F as outputs.
  DDRF = 0xFF;

static uint8_t count = 0;

void loop()
  // Translate 'count' to Gray Code and output.
  PORTF = GRAY_CODE[ count ];

  // Toggle LED pin.
  digitalWrite( LED_PIN, ( count & 0x01 ) );

  // Delay for a bit.
  delay( 250 );

  // Next...
  count += 1;
   When I moved into Elmwood Park two and a half years ago I got my first actual credit card though my bank.  They do a credit check and I learned I had a credit score of 0.  I didn't even know that was possible, but it was because my record was empty.  My goal with having a credit card was to establish a good credit rating, and clearly I had a ways to go.  So my first credit card was a secured card backed by money locked in a savings account.  Around six months ago I unsecured the card, and applied for a second credit card on the advice of my banker.  I don't know what my score is right now, but it must have gone up as I now receive at least two credit card mailing a week.  I always keep these so I can burn them, but the quantity is getting absurd.  Who, after a couple years of receiving mailings suddenly says "you know what, I now need this?!"  But then I have never understood marketing.  I have signed up for the don't-mail-me-credit-offers list and we'll see if that helps.  In the meantime I have a fire to start.