Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
COMP2215 Tasks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dk8g20
COMP2215 Tasks
Commits
e5cfee6a
Commit
e5cfee6a
authored
3 years ago
by
dk8g20
Browse files
Options
Downloads
Patches
Plain Diff
added skeleton code
parent
62ad4ce0
Branches
main
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
4_Bit_Binary_Counter SKELETON.c
+35
-0
35 additions, 0 deletions
4_Bit_Binary_Counter SKELETON.c
LED_Animation SKELETON.c
+25
-0
25 additions, 0 deletions
LED_Animation SKELETON.c
with
60 additions
and
0 deletions
4_Bit_Binary_Counter SKELETON.c
0 → 100644
+
35
−
0
View file @
e5cfee6a
#include
"pico/stdlib.h"
const
uint
decrementButton
=
21
;
const
uint
incrementButton
=
22
;
const
uint
resetButton
=
20
;
const
uint
bitLedOne
=
5
;
const
uint
bitLedTwo
=
4
;
const
uint
bitLedThree
=
3
;
const
uint
bitLedFour
=
2
;
int
main
()
{
//Initialise your IO
int
counter
=
0
;
while
(
true
)
{
if
((
counter
%
2
)
>
0
)
{
gpio_put
(
bitLedOne
,
1
);}
else
{
gpio_put
(
bitLedOne
,
0
);}
//Add for the other LED's
if
(
gpio_get
(
incrementButton
)
==
0
){}
//Make the buttons do something
}
}
This diff is collapsed.
Click to expand it.
LED_Animation SKELETON.c
0 → 100644
+
25
−
0
View file @
e5cfee6a
#include
"pico/stdlib.h"
//Function definition
void
animation
(
int
length
);
int
main
()
{
//Define how fast you want your animation to play in MS
const
int
animationStep
=
50
;
//Initialise all LEDS - Use a for loop
//Loop animation
while
(
true
)
{
animation1
(
animationStep
);
}
}
void
animation1
(
int
length
)
{
//Add your custom animation
}
\ No newline at end of file
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