Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MKleinSB/pxt-calliope-buttons
real touch buttons for the new Calliope Mini Makecode. This is pxt-microbit-buttons adapted for Calliope Mini
https://github.com/MKleinSB/pxt-calliope-buttons
Last synced: 4 days ago
JSON representation
real touch buttons for the new Calliope Mini Makecode. This is pxt-microbit-buttons adapted for Calliope Mini
- Host: GitHub
- URL: https://github.com/MKleinSB/pxt-calliope-buttons
- Owner: MKleinSB
- License: mit
- Created: 2020-01-24T18:36:28.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-15T19:47:20.000Z (over 1 year ago)
- Last Synced: 2024-08-03T17:15:04.110Z (3 months ago)
- Language: TypeScript
- Homepage: https://mkleinsb.github.io/pxt-calliope-buttons/
- Size: 67.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-calliope - Touchpins - Echtes Touch an analogen Calliope Pins (V1) (MakeCode Pakete)
README
# pxt-calliope-buttons
This is a fork of
Micro:bit buttons
with changes to work with Calliope Mini and its pins P1, P2 (Edge Connectors) and C16, C17 (right Grove port)
## Using this extension
* go to https://makecode.calliope.cc
* create a new program or open existing
* go to **Advanced**, **Extensions** and search for [https://github.com/MKleinSB/pxt-calliope-buttons]## Capacitive buttons (touch)
### Click events (and others)
The button emits ``down``, ``up``, ``click``, ``long lick``
and ``hold`` events.```blocks
input.touchP1.onEvent(TouchButtonEvent.Click, function () {
led.plot(2, 1)
})
```### Polling state
Use ``isTouched`` or ``value`` to query the state of the sensor.
```blocks
basic.forever(function () {
if (input.touchP1.isTouched()) {
led.plot(0, 0)
} else {
led.unplot(0, 0)
}
})
```## Acknowledgement
Various resources exist on the subject of capacitive touch and micro:bit:
* [blog post](https://ukbaz.github.io/howto/microbit_touch.html) from Barry Byford.
* [tutorial](https://www.bareconductive.com/make/create-a-touch-sensor-for-microbit-with-electric-paint/) from bare conductive.## Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.When you submit a pull request, a CLA bot will automatically determine whether you need to provide
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
provided by the bot. You will only need to do this once across all repos using our CLA.This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.