Comments (3)
New suggestion is to give the option to setup the number of decimals in the sd card and print on serial monitor block. The default value will is 2
from ardublockly-1.
Another possibility would be to have a number to string format block.
While not complex to implement it would change the interface and I think that's frozen until the release of the book?
Furthermore it is an additional, albeit optional, complexity for the user.
New suggestion is to give the option to setup the number of decimals in the sd card and print on serial monitor block. The default value will is 2
This would also trigger an interface change.
I would suggest that the new "Format-Block" is better since it separates the concerns.
As a result we would have a generic solution, which applies to printing in general (e.g. also display), reduce the complexity of the other blocks (here SD card and Serial Monitor) and the size of the block code, if the format is not needed (no additional option).
Detect the TYPE of the Input Block and adjust the code to dataFile.println(value,6)
Not sure whether dataFile.println(value,6)
would work as expected. I can currently not try it, but the Arduino docs, does not list that as an option.
If working, or otherwise by using dataFile.printf("%.6f\n", value)
, the advantages would be:
- no change in the interface
- very easy to implement
- no additional complexity for the user
Disadvantages, which I can think of, would be:
- only affects SD card (eg. Serial print or Display would still only show two decimals)
- all floats would be saved with 6 decimal
Change the return type of the values from the senseBox Lib. Maybe convert from float to char?
Probably char*
, or?
Pro:
- no change in the interface
- very easy to implement
- no additional complexity for the user
Con:
- also affects user not using blockly (and maybe annoying them)
- I did not find a string to float function in blockly. If the user wants to do some calculation with the output, he can't. Probably not so much with longitude and latitude but with speed and height (not sure if the output type can be different for different options.
from ardublockly-1.
The PR #134 does not fix the issue completely. Only if the Block is used directly as an input for the SD Block the number of decimals will be adjusted. If a user assigns a variable to the lat and lng values and tries to save this to sd card the issue still exists!
from ardublockly-1.
Related Issues (20)
- Switch Echo and Trigger Button at Ultrasonic HOT 2
- Draw Rectangle is not working correctly
- Add Block for BME680 HOT 1
- Grove Error at Runtime
- Update openSenseMap Block HOT 1
- Save Data on SD Card in different Files
- Redefinition of 'WiFiSSLClient client'
- Default value in case block not used
- Update Code generation for the BME680
- Disable Delay Block when GPS Block is in use
- Provide warning if MAC OS is used
- Make use of SSL optional
- Add Thingspeak Blocks
- Add Windspeed Sensor Block
- Add Sound Sensor Block
- lengthMultiplikator too low for mobile sensebox HOT 1
- BME680 block always returns 0 for "Calibration Value" HOT 1
- Saving blocks and opening them after restart of the browser changes filenames for SD cards
- A Blockly created Sketch produces not working Arduiono Code
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 ardublockly-1.