init mod04 ex02

This commit is contained in:
hugo LAMY
2025-03-12 10:55:55 +01:00
parent fc77fb1749
commit 08dab7e608
9 changed files with 254 additions and 1 deletions

View File

@@ -70,7 +70,6 @@ typedef enum {
} Slope;
volatile uint8_t duty_cycle = T1_DUTY_CYCLE_PERCENT;
volatile Slope slope = UP;
// using TIMER 1
void blink_led_1() {
@@ -119,6 +118,7 @@ int main() {
}
ISR(TIMER0_COMPA_vect) {
volatile static Slope slope = UP;
if (slope == UP) {
if (duty_cycle >= 100) {
duty_cycle = 100;