-
Hello @Gordon,
I tried using TypedArrayvar arr_data = new Float32Array(300);
arr_data[i] = parseFloat(s); // this is in a for loop where I read each value from csv as stringsince my numbers are in decimals.
However, when I try to store the float value in the above array, it doesn't get stored as it is.
For example: 1180.952381 from the .csv is stored as 1180.95239257812I tried using Float64Array and it gave a better result however not the exact value
1180.952381 is stored as 1180.95238100000
and 1175.824176 is stored as 1175.82417599999I believe using Float32Array would be better considering memory usage, however not sure why the values aren't getting stored in the original form
Thanks!
-
Hi @fanoush,
That's a great idea too. Did not strike me.
Thanks a lot!
I will try it out as well. -
Hi @Gordon,
Yes, they are numbers, actually decimal numbers - around 10 digit long numbers.
I Will try using a typed array and see if it works
Thank you very much! -
Thanks a lot, @fanoush and @Gordon for your replies.
Until I received the responses here, I did try reading the file using indexOf.
It's a file with 1 column having 17K rows. I wanted to separate these 17K values and store them in an array since I need to do analyze these values and compute something further.Obviously, since 17K is a very large number, I for instance tried reading only the first 500 values. (Could separate out every value from the file based on carriage return ) and could print all of them. No problem.
However, the moment I try to store these 500 values in an array, I face the low memory problem.
It works well if I store only 100 values in the array. However, the computation that I need to do on this data, requires at least 500 values for me to analyze it well because I am working on a pattern. Can't analyze with only 100 values.
Is there any way I could achieve this - storing 500 values or maybe at least 300?Thanks a lot once again for all your help!
-
Hello,
I am trying to read a very lengthy(approx. 15K rows) .csv file using require("Storage").read("xxx.csv").
And the next step is to create an array for the values in the .csv file.
However, .split("\r\n") function on require("Storage").read("xxx.csv") gives me an error - see the attached image for the error details.Is there a way that I could read only say first 200 rows from the .csv at a time? and then the next 200?
I don't see any other API at the moment to read the file in chunks, except .read(), so wanted to confirm.Pls. note that I am using Espruino emulator and also have some other functionality coded at the moment for the smart watch.
Thanks a lot!
-
Hello All,
Am back with continuation of this thread :)
For a recap- I had this (pic attached) built with steps value as 2,500 which was a static value, a constant.
I have to now color the semicircle green depending on value (got at run time, it would keep changing).I went through this entire thread once again. And looks like there is a lot that has been experimented.
Thanks a lot once again for all your help.
I am now going to start looking through the code you all have shared here.
Just had one query because I am not sure if I understood it correctly(after looking at the watch face example) - Is a feature like this now being provided by bangle.js? Or, else I will start working on my code (as suggested in #17)Thanks a lot once again!
-
@Gordon, this is so cool, so awesome.
You had this already coded as an example?
I am new to this and getting to learn so much from this code.
I am kind of trying to understand the beauty of it now. As to what all could be done here. I started off wondering how do I proceed.
Thanks a lot once again. -
Thanks @Gordon.
Yes thats right, setInterval was taking me back to the home screen. -
-
Thanks a lot everyone for your quick replies here.
@allobjects : Yes, that is what I was exactly thinking about now. I would eventually have many more app icons here so plan to show each app icon with a right swipe and like a scroll , I will then show the following icons too.
@fanoush : Thanks, I have never used a smartwatch myself, so probably you are right. Because of the use of smart phones and touch screens, I assumed that the app icons have to be touched to open them. I thought that would be very natural for any user to do so. Hence I thought that it was something very basic. But as you say, probably the user works differently with a smartwatch.
@Gordon : Thanks a lot!
but you could highlight a key, then use BTN1/3 to move up/down, then the touch areas to move left/right and BTN2 (in the middle) to select.
Can I do this in the emulator? Highlighting of the key and then selecting using the BTN2 ?
Thanks everyone once again!
-
Thanks @Gordon
I don't have the device. I am working on a emulator. -
Thanks a lot @Gordon.
Actually I posted my query on the forum here and went off to sleep for the night while still pondering over what could have gone wrong, I realised it (while I was trying to sleep..lol), that I was using setInterval for my home screen and that is probably causing to paint the home screen immediately.
And now I woke up with you also suggesting me the same.
I am very sure now that setInterval is causing this behavior. Haven't worked on it as yet, but will do it soon.
Thanks a lot once again!Regarding not bein able to get touch event on a particular area/icon.. I am disappointed to know that I can't do it :( Isn't that something very basic a user would try to do on a smart watch? I even designed my screen like this (in the attachment) thinking on touch of the "Notes" Icon, the notes editor will be opened. So I have to change my design now, probably only one icon at a time on the screen or max 2..left and right.
Am also now concerned about my next step to implement. Since I have to implement the Notes Editor, it means that I need to implement a simple keypad. And now I am thinking, if touch on a particular key/image cannot be captured, then how do i show that this particular alphabet has been selected by the user to type in the notes. How am I going to achieve this? Any clues?
Thanks a lot!
-
Thanks a lot @Robin.
Yes, As I mentioned I did go through the APIs for touch events and didn't find any for a particular area on the screen, hence posted my query. As per the reply by @Gordon below, looks like there aren't any such APIs available.
Thanks for sharing the github link shared above .
btw, I am using https://www.espruino.com/Reference#Bangle for API references -
Please note that I am using the emulator for implementation. Don't have the smart watch device.
Q1 :
I use setwatch() on button1 and then I call a function that clears the home screen and displays a new screen with app icons. But, this new screen doesn't remain there. Within a flash of a second, it shows me my app icons and goes back to the home screen immediately. Any idea what am I missing here?Q2:
I went through the API documentation. I see there is an event to understand touch on the screen-left touch and right touch of the screen. However, I do not see anything where I can get the the touch of an app icon event triggered. I need this functionality. So that the user can open the app on touch of a particular icon. Please let me know how can I achieve this?Thanks!
-
-
Thanks a lot!
I used setwatch() on button2 and onclick of it, I clear the home screen and display a new screen with a message. However, this new screen doesn't stay there. It goes back to the home screen immediately. Any idea how to take care of this? Should a make a new post for my query ?
Doesn't it work like a normal on click event of a button, do something. rather than only flashing what it needs to show and going back to home screenThanks!
-
-
-
-
:)
Cant thank you enough for sharing this brilliant piece of code above and earlier too.
My first assignment is already submitted with my original code that was shared with you, however it would be really interesting to try and check out this code as well. So much new stuff for me to learn. So many new classes, functions I wasn't aware of. We will be getting new assignments and I will be hopefully working and continue my learning on bangle.js for the next few months. And all this information, coding, logic you shared with me definitely helps a lot.
Thanks once again! -
woah!!..that's brilliant! Thank you so much.
So much to learn from by just seeing the code.
I will take time to go through the code lines and understand what exactly has been done here.
And without a debugger available in emulator, its going to be all the more difficult. By the way, is there one?
This was an assignment given to us and working with bangle was totally new for me. I am drowned in other subject assignments as well at the moment, hence going through this code will definitely take some time for me.
But, nevertheless, thank you so much for all the efforts put in and sharing every thing in detail with me. Really appreciate it a lot! -
-
Thank you so much for all the detailed information.
I shall try doing it the way you have suggested.
This would be the first time that I would be be applying trigonometric functions in real life application after learning them in high school :)
Thanks a lot for directing me to that.Have a good Sunday evening!
-
Hi,
I used g.fillpoly() to fill color in the desired red ring and achieved what i wanted. Please see my updated image.
However, am not sure if there was a better way to do this.
Finding out the coordinates for each tiny area and then coloring it with green wasn't so easy.
I am sure there must be some easy way to find the coordinates or not?
Thanks a lot for all your help
Thank you so much @fanoush and @Gordon for the explanation.
@Gordon : the values doesn't always have 6 decimal places, it could be at times 5 or at times none.
1180.952381 and 1180.95238100000 are the same number, however, I was just curious to know why values like 1175.824176 get stored as 1175.82417599999 or with extra zeroes at the end.
Thanks for all your help as always!