Bangle.js 2 touch int pin #7294
Replies: 1 comment
-
Posted at 2022-01-12 by @gfwilliams It's probably because you're using the standard Bangle.js firmware? As soon as the IRQ pin changes, the firmware itself jumps in and processes the IRQ before the JS can get there. That may even be the reason you can't get the watch working. I think you're not going to get anywhere with this unless you make your own build that completely disables Bangle.js's touch functionality - which is probably not what you want! Posted at 2022-01-12 by @enaon this makes sense, thank you for answering, I will use the included functionality :) Posted at 2022-01-13 by @enaon in the case someone else want to have control of the touch like I do, a solution is to run software i2c on top. This way the bangle's integrated events can be used instead of the interrupt pin, works very nice. Posted at 2022-01-13 by HilmarSt
I like the I2C bus, please provide a piece of code that shows how this can be done. Posted at 2022-01-13 by @enaon something like that works fine for getting raw data on touch/swipe
Posted at 2022-01-13 by @fanoush
Interesting that it works. Bangle firmware already use (software) i2c on top of same touch i2c pins, in fact many of them seen here So you have yet another Posted at 2022-01-13 by @enaon
an
is thrown, but it still works, been testing for a day now. :) Posted at 2022-01-14 by @gfwilliams Yes, I guess if both are using software then the pin states are kept the same - you'll just get the occasional clash if the touch IRQ jumps in at the wrong time. I guess in a way a neat longer-term solution would be to add touchRd/touchWr functions like we have for the other sensors on the watch. Posted at 2022-01-14 by @enaon
that would be nice, or maybe info on swipe event for up/dn and x,y. One last question that is a bit irrelevant, is there an easy way to bypass/set longer timeout on the side button's long press action? Posted at 2022-01-18 by @gfwilliams
we have that already??
Sadly no, I believe the bootloader needs a software update for that. It's built in at a very low level to try and make the Bangle.js extremely hard to brick :) Posted at 2022-01-18 by @fanoush
Maybe yes in a hackish way. This is about watchdog interval and stopping kicking it when it is held. So if you will kick watchdog yourself while button is held then you can extend it as you wish. Posted at 2022-01-20 by @enaon
I was looking at swipe event, it only has left/right. and then there is drag event with yz but not the action id, but it is not a problem really, I used the drag event with the i2c.writeTo(0x15,0xFA,17); On the reset issue, I think we are not talking about the same one. but there is another one as well, it fires at 1.5-2 sec in, and it issues an E.reboot() and the screen displays "loading". I also tried calling E.kickWatchdog() , it doesn't seem to work, I guess it is not the watchdog, because I get a message from E.kill event, and the manual says this should not work on a watchdog timer reset. Posted at 2022-01-20 by @fanoush
Yes, you initially described it as "It restarts the watch on long press, is there a way to customize that?" so I was thinking you mean the watchdog reset that restarts whole watch. Not the one that exits the app. Posted at 2022-01-20 by @gfwilliams
Yes, that one should be adjustable with a firmware tweak.
You can see how stuff is handled in touchHandlerInternal: https://github.com/espruino/Espruino/blob/master/libs/banglejs/jswrap_bangle.c#L1475 I believe everything is forwarded as events Posted at 2022-01-20 by @enaon Thank you both. :) Posted at 2025-01-07 by @enaon I can see that now there is an touchRd/touchWr, and also there is an Bangle.setOptions({btnLoadTimeout: xx}) very usefull, thank you |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2022-01-12 by @enaon
Hello, I just gt my bangle.js 2, thanks a lot.
I am trying to play with the touch controller, I read at your info on hackaday on the smaq3, that the interups is D36,b ut it does not work for me, this reports nothing on touch.
lala=setWatch(function(s){
print("lala");
},D36,{repeat:true, edge:0});
this is my info, any idea as to what I may be missing?
VERSION: "2v11",
GIT_COMMIT: "531080858",
BOARD: "BANGLEJS2",
ps. also, I get this message when tryin to run a watch on pin D39:
WARNING: No free GPIOTE for watch
I have seen that before on fanoush's builds for the rock/magic when over 4 watches are running.
Beta Was this translation helpful? Give feedback.
All reactions