Comments (4)
Quick clarification for the previous messages, as it gets confusing: uBit.io.face
is a reference to uBit.io.logo
, so it's a NRF52Pin
instance.
On the other hand, uBit.logo
is the instance of TouchButton
.
Okay, so as we have the wasTouched()
method available in uBit.io.logo
and the touch type (capacitive vs resistive) can be independently configured, I believe we can do everything in MicroPython land via uBit.io.logo
.
It does make sense to also add wasTouched()
to TouchButton`, but rather than drag this around more, let's just go with what we have at hand.
I'll mark this as complete.
from codal-microbit-v2.
TouchButton
objects are only used internally withinNRF52Pin
s and theuBit
object exposes all pins, edge connector or otherwise as Pin objects
Yes, but the main way to use the touch logo is via uBit.logo
which is a TouchButton
:
codal-microbit-v2/model/MicroBit.h
Line 158 in d54ce9b
from codal-microbit-v2.
@dpgeorge from your comment in:
#251 (comment)
I think wasPressed() was only added to the NRF52Pin object, but not to the TouchButton() class?
I assume you meant wasTouched()
as that's the method that was added to NRF52Pin
and not TouchButton
?
TouchButton
should already contain a wasPressed()
method, is that something you can use? (uBit.logo.wasPressed()
already exists)
Or do you need a wasTouched()
method as well in TouchButton
? (uBit.logo.wasTouched()
doesn't exists right now)
If you need a wasTouched()
method would you be able to use the uBit.io.face.wasTouched()
? (uBit.io.face is an NRF52Pin instance)
from codal-microbit-v2.
I assume you meant
wasTouched()
as that's the method that was added toNRF52Pin
and notTouchButton
?
Yes, I meant to say wasTouched()
was only added to the NRF52Pin object.
TouchButton
should already contain awasPressed()
method, is that something you can use?
I tried using this but it doesn't seem to work, it always returns 0.
If you need a
wasTouched()
method would you be able to use theuBit.io.face.wasTouched()
?
The code currently uses this (it uses uBit.io.logo.wasTouched()
) and that seems to work. But I was under the impression this uses resistive touch and instead it's better to use TouchButton::wasPressed()
. But maybe I'm wrong here. If it's correct (electrical behaviour wise) to use uBit.io.logo.wasTouched()
then I'm happy to do that. That means all the touch objects use the same code, they all use NRF52Pin::wasTouched()
. And that's how the code currently works, so there would be nothing to change if this is the correct way to do it.
from codal-microbit-v2.
Related Issues (20)
- Data log "full" marker is not being written to interface storage HOT 7
- MakeCode `randint()` not random when Bluetooth enabled HOT 1
- Default `uBit.io.logo` touch type should be capacitive. HOT 3
- A way to configure a pin on open drain mode HOT 1
- Overloaded virtual warnings
- Quickly switching between resistive and capacitive pin touch and checking state doesn't work
- `NRF52Pin::wasTouched()` default mode is capacitative instead of the pin state HOT 1
- Are all `time.tick_xxx()` functions bound to 30 bits? HOT 2
- Counting CPU cycles with `DWT->CTRL` does not match expectations HOT 2
- For characters not in the font, display scrolls a null pointer HOT 2
- Should the display be cleared when trying to print an invalid character?
- Should scrolling/printing out-of-range characters on the display be an "error glyph" HOT 2
- Bloatly CI: Issue getting the parent commit on a merge commit
- A StreamRecording with low splitter sampling rate fails to stop recording
- If a DataSink sampling rate is low (<143) it might end up not pulling any data
- Users struggling to trigger pairing mode with triple-tap
- MY_DATA - HTML doesn't handle an accented character in column name HOT 14
- Cancel Bluetooth pairing mode reset timeouts for partial flash and fetch MY_DATA? HOT 1
- MakeCode issue with MakeCode sonar extension HOT 3
- Investigate why CODAL v0.2.65 reduces the recording length in MakeCode HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codal-microbit-v2.