Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wicj_embeddedlab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julia Scharsich
wicj_embeddedlab
Commits
a18aefd4
Commit
a18aefd4
authored
5 years ago
by
Julia Scharsich
Browse files
Options
Downloads
Patches
Plain Diff
copy leds.c+makefile to speedyleds
parent
ba652216
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
speedyleds/Makefile
+8
-0
8 additions, 0 deletions
speedyleds/Makefile
speedyleds/speedyleds.c
+31
-0
31 additions, 0 deletions
speedyleds/speedyleds.c
with
39 additions
and
0 deletions
speedyleds/Makefile
0 → 100644
+
8
−
0
View file @
a18aefd4
speedyleds.hex
:
speedyleds.o
avr-objcopy
-j
.text
-j
.data
-O
ihex speedyleds.o speedyleds.hex
speedyleds.o
:
avr-gcc speedyleds.c
-o
speedyleds.o
-Wall
-Wextra
-Wpedantic
-mmcu
=
atmega328p
-Os
-std
=
c99
flash
:
avrdude
-p
atmega328p
-c
gpio
-U
flash:w:speedyleds.hex
This diff is collapsed.
Click to expand it.
speedyleds/speedyleds.c
0 → 100644
+
31
−
0
View file @
a18aefd4
#define F_CPU 12000000UL
#include
<util/delay.h>
#include
<avr/io.h>
#include
<avr/libc.h>
int
main
(
void
){
DDRD
=
0
b11111100
;
DDRB
=
0
b00111111
;
PORTD
=
0
b00000011
;
PORTB
=
0
b00000000
;
char
on
=
0
;
while
(
1
){
while
(
!
on
){
if
(
PORTD
!=
0
b11111111
)
PORTD
=
(
PORTD
<<
1
)
+
1
;
else
{
if
(
PORTB
!=
0
b11111111
)
PORTB
=
(
PORTB
<<
1
)
+
1
;
else
on
=
1
;
}
_delay_ms
(
250
);
}
while
(
on
){
if
(
PORTB
!=
0
b00000000
)
PORTB
=
(
PORTB
-
1
)
>>
1
;
else
{
if
(
PORTD
!=
0
b00000011
)
PORTD
=
(
PORTD
-
1
)
>>
1
;
else
on
=
0
;
}
_delay_ms
(
250
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment