Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
firmware
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
François Revol
firmware
Commits
8e8d8614
Commit
8e8d8614
authored
Aug 21, 2019
by
schneider
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(apps): Add scope to preload
parent
e1a7684a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
preload/apps/scope/__init__.py
preload/apps/scope/__init__.py
+35
-0
preload/apps/scope/metadata.json
preload/apps/scope/metadata.json
+1
-0
No files found.
preload/apps/scope/__init__.py
0 → 100644
View file @
8e8d8614
import
os
import
display
import
utime
import
buttons
import
light_sensor
import
math
WIDTH
=
160
HEIGHT
=
80
disp
=
display
.
open
()
light_sensor
.
start
()
history
=
[]
while
True
:
disp
.
clear
()
value
=
light_sensor
.
get_reading
()
history
.
insert
(
0
,
value
)
if
len
(
history
)
>
WIDTH
:
history
.
pop
()
disp
.
print
(
"%i"
%
value
)
for
i
in
range
(
0
,
len
(
history
)):
# Rescale to range 0 <= value < HEIGHT-1
y
=
math
.
floor
(
history
[
i
]
*
(
HEIGHT
-
2
)
/
max
(
history
))
disp
.
pixel
(
WIDTH
-
i
,
HEIGHT
-
y
-
1
)
disp
.
update
()
utime
.
sleep
(
0.1
)
\ No newline at end of file
preload/apps/scope/metadata.json
0 → 100644
View file @
8e8d8614
{
"name"
:
"Scope"
,
"description"
:
"A very simple egg that reads the light sensor and displays its raw value and a scope. Will be extended to other ADC channels once we have the firmware ready."
,
"category"
:
"hardware"
,
"author"
:
"koalo"
,
"revision"
:
1
}
\ No newline at end of file
Write
Preview
Markdown
is supported
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