[chbot] Programming 8-bit microcontrollers

Volker Kuhlmann list0570 at paradise.net.nz
Fri Sep 23 04:34:23 BST 2016


This is for AVR, but should hold for any 8-bit job. Spot the problems:

static const uint16_t setting = 15*60;
class values {
  uint8_t a, b, c;
  uint32_t d;
  uint8_t e;
  uint16_t f;
};
static const values defaults {
  50, 1, 10, 0xFFB070, 5, 0x03FF
};
void func() {
  unsigned long ms;
  ms = setting * 1000;
  ...
}

The program doesn't work in 2 places.

First solution wins a free copy of the night light firmware.

First correct solution wins 2 free copies of the night light firmware.

Prize giving on Monday...

Volker

-- 
Volker Kuhlmann
http://volker.top.geek.nz/	Please do not CC list postings to me.



More information about the Chchrobotics mailing list