Code for UiFlow-execute block needed for reading and writing the sd-card
Gaviota last edited by Gaviota
Using UiFlow V1.3.5-Beta, i'm buliding a hour counter for my boat engine.
The new timer blocks are great and very helpful, many thanks to the team.
To store and restore the cumulated seconds i need code for the UiFlow-execute block for reading and writing the sd-card:
- Is there anyone who can help me?
- Or are SD-card blocks foreseeen for the next beta version?
For a first preview of the hour counter here you can see the display content:
... translation of the german text:
- Betriebsstunden = Operating Hours
- Stunden = Hours
- Tag = Day
- Batterie = Battery
The Button Labeles are in english
lukasmaximus last edited by lukasmaximus
Hi @Gaviota unfortunately there are no blocks yet to support SD writing. You could try something like this in micropython:
from m5stack import *
from m5ui import *
from uiflow import *
timeSinceBoot = None
f = open("/sd/1.TXT", 'w+')
timeSinceBoot = time.ticks_ms()
You may also check this for reference https://github.com/turbinenreiter/micropython/tree/master/examples/SDdatalogger
Gaviota last edited by
Hi @lukasmaximus thank you for the micropython code.
This is my test program for writing and reading data to/from SD card:
Is there a possebility adding files at the posting? then i can add the Blockly-file here.
And last but not least a short whish list for improvements at UiFlow:
- Early implementation of the actual UiFlow-Beta-version to the UiFlow-PC-Version
- Adding remarks in a easy way, i took thererfore the execute block using a #
- Blocks for handling SD cards (reading, writing, appending data)
- Adding files in postings at the M5Stack community
lukasmaximus last edited by
Hi @Gaviota glad I could be of help. The program looks great
Unfortunately I don't think there is a way to post files on the forum.
Other than copying and pasting the micropython output
The only way is to host the file somewhere and paste the link.
I would suggest the best way would be if you have a github account
then make a repository with the file there and share it with us here.
This would also allow for us to add it to our links of resources.
Thank you for your requests, I will make sure to hand them on to the dev
team. It is true that the updates on the offline version are lagging behind
the online version but we will try to improve this. Blockly allows for a rectractable
comment from the blocks so this shouldn't be hard to implement
We used to have blocks for handling the SD card in our old platform M5GO
so I don't see this as being too difficult to add either.
All the best, Keep us updated on the progress of your project.