Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
screenkey_demo
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bjoern
screenkey_demo
Commits
a5f3a81c
Commit
a5f3a81c
authored
14 years ago
by
tec
Browse files
Options
Downloads
Patches
Plain Diff
second
parent
8c1d17ee
Branches
Branches containing commit
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/.DS_Store
+0
-0
0 additions, 0 deletions
src/.DS_Store
src/main.c
+8
-7
8 additions, 7 deletions
src/main.c
with
8 additions
and
7 deletions
src/.DS_Store
0 → 100644
+
0
−
0
View file @
a5f3a81c
File added
This diff is collapsed.
Click to expand it.
src/main.c
+
8
−
7
View file @
a5f3a81c
//# Copyright (c) 2010, Bjoern Heller <tec@hellercom.de>. All rights reserved
//# This code is licensed under GNU/ GP
//# This code is licensed under GNU/ GP
L
#include
<avr/io.h>
#include
<avr/interrupt.h>
...
...
@@ -10,13 +10,14 @@ volatile uint16_t bits;
volatile
uint8_t
cnt
;
volatile
uint16_t
fcnt
=
0
;
// This file is designed to be used on an atmega
640
, running @ 16mhz,
// This file is designed to be used on an atmega
328
, running @ 16mhz,
// but should be portable to other processors
// Pin assignments are:
// PB7 - Button input [button drives pin low]
// PB1 - Data - Arduino PIN 10 - Arduino PIN 9
// PB0 - Clock - Arduino PIN 10
//IMAGES
uint8_t
start_img
[
108
]
=
{
0xff
,
0xff
,
0xff
,
0xff
,
...
...
@@ -75,7 +76,7 @@ uint8_t stop_img[108] = {
//---------------------------------------------
//Interrupt service routine
ISR
(
TIMER1_OVF_vect
){
fcnt
++
;
TCNT1
=
65536
-
80
;
...
...
@@ -225,7 +226,7 @@ int main()
TCCR1B
=
0x01
;
TCCR1C
=
0x0
;
sei
();
//
g
lobal interrupt enable
sei
();
//
G
lobal interrupt enable
// Setup the control registers
screenkey_reg_1
(
0xEE
,
0x00
);
...
...
@@ -273,14 +274,14 @@ int main()
{
screenkey_set_color
(
BR_RED
);
screenkey_write_img
(
start_img
);
//
screenkey_write_img(start_img);
br_dim
=
1
;
}
if
(
!
(
fcnt
&
0x8000
))
//8
if
(
br_dim
)
{
screenkey_set_color
(
BR_
BLUE
);
screenkey_write_img
(
stop_img
);
screenkey_set_color
(
BR_
RED
);
//
screenkey_write_img(stop_img);
br_dim
=
0
;
}
}
...
...
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