[BJv2, 95% done] An app for soft reboot? #3325
Replies: 9 comments
-
Posted at 2023-10-22 by ccchan yeah, looks good. i think i'll use it for several days, ps, for icon, i can use open source icon without worry correct? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-10-22 by ccchan next step: ps: the writing of the 1st code in #1 is good for gpt4, it keeps on doing stupid things. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-10-22 by ccchan hi, originally i wann let user choose odd vs even for a randomly displayed number, i simply ask it to make a "screen tap" to confirm the reboot, thanks i'll see if the store will need this app,
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-10-22 by ccchan @gfwilliams ps i am using it right now. btw, for my currently another project, makeing "swipe back to clock" to use swipe up to down (stage 1) then with a menu (stage 2). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-10-22 by ccchan same code as above, i put on github, https://github.com/ccchan234/bangle2-SoftReBoot/blob/main/v002 thank you |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-10-23 by ccchan I'll say it's useful, today after i go out and wanna connect my bangle to PC, but no success. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-11-21 by ccchan ps: this is the info file: require("Storage").write("softreboot.info",{ coverting an icon and sending to the app store need more effect than writing one... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-11-21 by @thyttan I'd probably have tried to do this with |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-11-21 by ccchan hi, thx for reply. myself completely comfort with the original code (generated by gpt4, i knew nothing about js, but general programming knowledge on pascal, C etc). yet i input your feed back to gpt4 and it gave a modified code, thanks. You: my js for bangle.js v2, for an app to reboot:
ChatGPT: Your JavaScript code for the Bangle.js v2 smartwatch appears to be designed to create an app that allows the user to reboot the device through a simple interface. Here's a breakdown of how your script works: Initialization: The script starts by logging "Starting script." Reboot Function: A function reboot() is defined to handle the actual reboot process. It logs "Attempting to reboot," calls E.reboot() to restart the device, and then logs "Should have rebooted." LCD Power Event Listener: The script listens for changes in the LCD's power state. If the LCD is turned on and a reboot has been confirmed, it initiates the reboot process. Displaying Confirmation Message: The script clears the screen and displays a message asking the user to tap the screen to confirm the reboot. Touch Event Listener: When the screen is touched, if the reboot hasn't been confirmed yet, it sets rebootConfirmed to true, displays a "Rebooting..." message, and then waits for 2 seconds before actually calling the reboot() function. Final Log: After setting up everything, the script logs "Script setup complete." This script effectively sets up an interactive reboot mechanism on the Bangle.js v2 smartwatch. By leveraging the touch screen and LCD power state, it provides a user-friendly way to reboot the device. The use of console.log statements throughout the script is helpful for debugging and understanding the flow of events. You: my frd: Ganblejs https://www.espruino.com/ReferenceBANGLEJS2#l_Bangle_tap ChatGPT: Your friend's suggestion to use Bangle.showClock() in combination with a specific tap event on the Bangle.js smartwatch is a good idea, especially if you're looking to integrate the reboot functionality into a more standard watch behavior. Here's a revised approach based on your friend's suggestion: Use Tap Event Instead of Touch Event: The Bangle.js v2 has a Bangle.on('tap', callback) event listener, which can be used to detect tap gestures. This can be a more intuitive way for users to trigger actions like rebooting, as tapping is a common interaction pattern on smartwatches. Implement Bangle.showClock(): The Bangle.showClock() function can be used to return the watch to its default clock display. This could be a good way to exit the reboot confirmation screen if the user decides not to proceed with the reboot. Revised Script Structure: Initialize: Start with the usual setup and logging. This approach would be more aligned with the common user interactions on the Bangle.js v2 and might feel more natural to users. It also adds a clear way to cancel the reboot action, which is a good practice for user interface design. For more detailed information and examples, you can refer to the Espruino Bangle.js Reference, specifically the Bangle.tap section. You: show me the new code ChatGPT: Certainly! Based on the suggestion to use a tap event and Bangle.showClock(), here's how you could modify your script for the Bangle.js v2: javascript
In this modified script: Tap Event Listener: The script now listens for tap events to confirm the reboot. Cancel Reboot: A watch function is set on BTN2 (the middle button on Bangle.js v2), which cancels the reboot process and returns to the clock display when pressed. Confirmation Message: The screen displays instructions for confirming or canceling the reboot. This approach integrates a more intuitive interaction for confirming the reboot and provides an easy way to cancel it, enhancing the user experience. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-10-21 by ccchan
hi,
i would sometimes like to reboot the bangle v2 using app, without using the button.
i asked GPT4 for this code:
it worked in the IDE when i connect my real bangle to it, and paste this code on the RHS and press "RAM".
I am going to follow the guideline and make it into an app, is that okay? any suggestions? thanks
wanna name it softreboot for short and SoftReBoot for the plain text name
following this tutorial:
https://www.espruino.com/Bangle.js+First+App
Beta Was this translation helpful? Give feedback.
All reactions