Mon, 14 Nov 2011 20:31:32 +0100
initial commit - controller1 working
#include "stdint.h" #include "main.h" void LED(uint8_t num, uint8_t state) { switch (num) { case 1: switch (state) { case 0: LED1_PORT &= ~_BV(LED1); break; case 1: LED1_PORT |= _BV(LED1); break; case 2: LED1_PORT ^= _BV(LED1); break; } break; case 2: switch (state) { case 0: LED2_PORT &= ~_BV(LED2); break; case 1: LED2_PORT |= _BV(LED2); break; case 2: LED2_PORT ^= _BV(LED2); break; } break; case 3: switch (state) { case 0: LED3_PORT &= ~_BV(LED3); break; case 1: LED3_PORT |= _BV(LED3); break; case 2: LED3_PORT ^= _BV(LED3); break; } break; case 4: switch (state) { case 0: LED4_PORT &= ~_BV(LED4); break; case 1: LED4_PORT |= _BV(LED4); break; case 2: LED4_PORT ^= _BV(LED4); break; } break; case 5: switch (state) { case 0: LED5_PORT &= ~_BV(LED5); break; case 1: LED5_PORT |= _BV(LED5); break; case 2: LED5_PORT ^= _BV(LED5); break; } break; } }