C99 Mode – Whatever that is…

So, I’ve never dabbled in C until now while using it with AVR microcontrollers – and while trying to complie a simple for loop:

  for (uint8_t bit = 0x80; bit; bit >>= 1) {

I got this error:

error: 'for' loop initial declaration used outside C99 mode

and to fix it I would move my decloration of the varabile outside of the loop. This seemed stupid to me so a quick Google search turned up this

Back in the old days, when dinosaurs roamed the earth and programmers used punch cards, you were not allowed to declare variables anywhere except at the very beginning of a block.

Solution was to add -std=c99 to the Makefile. My new AVR Makefile now looks like this..

Posted: June 15th, 2011 | Author: | Filed under: Code, Electronics | Tags: , , , , , , | No Comments »

8-Bit Sine Wave Table

This was what I needed for a rainbow RGB LED cycle…

Posted: May 10th, 2011 | Author: | Filed under: Code | Tags: , , , , , , , , | No Comments »

AVR ATTiny85 Makefile

This is what I’m using as a Makefile – based on what was included in a downloaded XCode template project – Can’t remember where I downloaded the starting point, but thanks…

Posted: April 26th, 2011 | Author: | Filed under: Code, Electronics | Tags: , , , , | No Comments »

Arduino / AVR ATTiny

Starting to play around with Arduino and straight-up AVR ATTiny microprocessors… Here are some resources I’ve found helpful so far:

  1. Getting started with the ATTiny MP
  2. Building and using an AVR target board
Posted: April 8th, 2011 | Author: | Filed under: Uncategorized | Tags: , , | No Comments »