Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Thomas Maaß
powerbank-supply
Commits
5e305d24
Commit
5e305d24
authored
Aug 23, 2021
by
Thomas Maaß
Browse files
Added defines for switch interval and duration.
parent
bb192063
Changes
1
Hide whitespace changes
Inline
Side-by-side
code/main.c
View file @
5e305d24
#include <avr/io.h>
#include <util/delay.h>
#define INTERVAL 10000 // switch interval in ms
#define DURATION 3000 // switch duration in ms
int
main
(
void
)
{
DDRB
=
0x01
;
PORTB
=
0x3e
;
while
(
1
)
{
PORTB
|=
(
1
<<
PB0
);
_delay_ms
(
3000
);
_delay_ms
(
DURATION
);
PORTB
&=
~
(
1
<<
PB0
);
_delay_ms
(
10000
);
_delay_ms
(
INTERVAL
);
}
return
0
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment