Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Schwimmwinkelsensor MA
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
Container 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
Ricco Müller
Schwimmwinkelsensor MA
Commits
db7b7a8a
Commit
db7b7a8a
authored
11 months ago
by
Ricco Müller
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
ed6af3d9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Arduino Code/frame_capture/frame_capture.ino
+40
-0
40 additions, 0 deletions
Arduino Code/frame_capture/frame_capture.ino
with
40 additions
and
0 deletions
Arduino Code/frame_capture/frame_capture.ino
0 → 100644
+
40
−
0
View file @
db7b7a8a
#include
<ADNS3080.h>
// SPI pins:
#define PIN_RESET 22
#define PIN_CS 5
ADNS3080
<
PIN_RESET
,
PIN_CS
>
sensor
;
// Serial parameters: [Must match python script]
#define BEGIN_CHAR 'A'
#define BAUD_RATE 57600
void
setup
()
{
// Initialize sensor
sensor
.
setup
(
false
,
false
);
// Set baud rate
Serial
.
begin
(
BAUD_RATE
);
// Prevent random character
Serial
.
flush
();
// Indicate new frame
Serial
.
println
(
BEGIN_CHAR
);
}
void
loop
()
{
// Get frame data
uint8_t
frame
[
ADNS3080_PIXELS
][
ADNS3080_PIXELS
];
sensor
.
frameCapture
(
frame
);
// Scan grid and send pixel color
for
(
int
y
=
0
;
y
<
ADNS3080_PIXELS
;
y
+=
1
)
{
for
(
int
x
=
0
;
x
<
ADNS3080_PIXELS
;
x
+=
1
)
{
Serial
.
println
(
frame
[
x
][
y
]
);
}
}
// Indicate new frame
Serial
.
println
(
BEGIN_CHAR
);
}
\ 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