firmware merge requestshttps://git.flow3r.garden/card10/firmware/-/merge_requests2019-08-24T15:17:53Zhttps://git.flow3r.garden/card10/firmware/-/merge_requests/247(fix) Clock: Better display handling and lower refresh rate2019-08-24T15:17:53ZStefan Haun(fix) Clock: Better display handling and lower refresh rateThis should fix issues with the clock app (main.py) crashing.This should fix issues with the clock app (main.py) crashing.https://git.flow3r.garden/card10/firmware/-/merge_requests/304feat(pycardium): Add button_gestures module2019-09-23T10:55:57Zxiretzafeat(pycardium): Add button_gestures moduleI originally started work on this because the ECG app's main loop was becoming such a mess, but it should come in useful for all kinds of apps. Basically, certain `(button, event)` combinations can be enabled, which will cause a matching...I originally started work on this because the ECG app's main loop was becoming such a mess, but it should come in useful for all kinds of apps. Basically, certain `(button, event)` combinations can be enabled, which will cause a matching event to be generated in an event stream when required.schneiderschneiderhttps://git.flow3r.garden/card10/firmware/-/merge_requests/306Add menu vibration2021-12-25T18:52:23ZPhileasAdd menu vibrationThis merge request
- add vibration to the menu
- add `smooth_vibration` module for introducing common vibration patterns/mode
I've basically experimented a bit with coming up with ways to trigger the vibration motor.
This is super pri...This merge request
- add vibration to the menu
- add `smooth_vibration` module for introducing common vibration patterns/mode
I've basically experimented a bit with coming up with ways to trigger the vibration motor.
This is super primitive.
- [ ] menu timeout doesn't trigger timeout vibration
- [ ] more sophisticated patterns for vibration motor possible?
- [ ] should we have different vibration modi for going up and down
- [ ] could we add a vibration mode for when you cycled through the entire menu maybe?
- [ ] is the select vibration acceptable
- [ ] (how) should we make vibration configurable?https://git.flow3r.garden/card10/firmware/-/merge_requests/507Draft: "User-space" CTX2022-04-12T19:31:39Zrahixcard10@rahix.deDraft: "User-space" CTXAdd python API for [CTX vector graphics](https://ctx.graphics). **This is a work-in-progress!!!**
There is still lot's missing, see the todo list below. That said, I've opened this PR so people can start playing with CTX on card10. Y...Add python API for [CTX vector graphics](https://ctx.graphics). **This is a work-in-progress!!!**
There is still lot's missing, see the todo list below. That said, I've opened this PR so people can start playing with CTX on card10. You can download a `card10.bin` for this MR from the "Exposed Artifacts" under the CI pipeline below. Documentation is null at the moment, but you can probably get quite far by reading the [HTML5 Canvas Docs](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D) and consulting
```python
import ctx_graphics
for e in dir(ctx_graphics.Ctx): print(e)
```
on card10 for method and constant names.
As a kick-start, here is some example code:
```python
import ctx_graphics, display, color
ctx = ctx_graphics.Ctx()
# Global Settings
ctx.line_width(5)
ctx.line_cap(ctx.CAP_ROUND)
ctx.line_join(ctx.JOIN_ROUND)
ctx.font_size(30)
ctx.font("ctx-mono")
ctx.text_align(ctx.TEXT_ALIGN_CENTER)
ctx.text_baseline(ctx.TEXT_BASELINE_MIDDLE)
with display.open() as d:
d.clear()
ctx.save()
# Some Lines with nice joints
ctx.stroke_color(color.CHAOSBLUE)
ctx.move_to(10, 10).line_to(10, 70).line_to(150, 70).line_to(150, 10).stroke()
# Draw a rectangle which perfectly fits the text
width = ctx.text_width("Hello CTX!") + 4
ctx.color(color.WHITE).rectangle(80 - width / 2, 20, width, 40).fill()
# Draw some text!
ctx.color(color.CAMPGREEN).fill_text("Hello CTX!", 80, 40)
ctx.restore()
ctx.update(d)
d.update()
```
## TODO
- [ ] Finish covering relevant API surface
- [ ] Implement alpha for color functions
- [ ] Take colors in many formats
- [ ] Cleanup the CTX when the python object gets garbage collected
- [ ] Improve API ergonomics