save cam number

main
agsler 2 years ago
parent fd4d3c837b
commit 17585a2c16

@ -4,7 +4,9 @@
#include "avr-hd44780/lcd.h" #include "avr-hd44780/lcd.h"
#include "i2c_peter/i2cmaster.h" #include "i2c_peter/i2cmaster.h"
#include "sdi_shield.h" #include "sdi_shield.h"
#include <avr/eeprom.h>
uint8_t EEMEM cam_saved;
volatile uint8_t cam = 0; volatile uint8_t cam = 0;
volatile uint8_t pgm = 0; volatile uint8_t pgm = 0;
volatile uint8_t pvw = 0; volatile uint8_t pvw = 0;
@ -37,6 +39,8 @@ int main(void){
//PullUp BTN //PullUp BTN
PORTB |= 1<<6; PORTB |= 1<<6;
cam = eeprom_read_byte(&cam_saved);
lcd_init(); lcd_init();
lcd_on(); lcd_on();
lcd_clear(); lcd_clear();
@ -151,10 +155,12 @@ ISR(PCINT1_vect){
cam--; cam--;
else else
cam++; cam++;
eeprom_write_byte(&cam_saved, cam);
}else{ }else{
if(PINC & (1<<3)) if(PINC & (1<<3))
cam++; cam++;
else else
cam--; cam--;
eeprom_write_byte(&cam_saved, cam);
} }
} }

Loading…
Cancel
Save