backlight.c 425 B

123456789101112131415161718192021222324
  1. #include <avr/io.h>
  2. #include "backlight.h"
  3. #include "print.h"
  4. void init_backlight_pin(void) {
  5. print("init_backlight_pin()\n");
  6. // Set our LED pins as output
  7. DDRB |= (1<<6);
  8. // Set our LED pins low
  9. PORTB &= ~(1<<6);
  10. }
  11. void backlight_set(uint8_t level) {
  12. if ( level == 0 ) {
  13. // Turn off light
  14. PORTB |= (1<<6);
  15. } else {
  16. // Turn on light
  17. PORTB &= ~(1<<6);
  18. }
  19. }