Hi Steve
It's useful to save a device's configuration to an SD card Embedded.
That way, you have an overview of the exact parameters or properties used in that specific firmware version.
With a *.MD file, you can easily do this with graphics.
(An MD file is a Markdown document (.md) that stores formatted text using simple plain-text syntax. It is commonly used for documentation, README files, notes, and web content)
Variables and strings are easy to save,
but the properties—for example, those of the AD converter don't work.
It does not change the string variable
How exactly do you do this using the built-in functions?
Or is there some way to do that easier?
Write command:
As Demo Result open with a MD viewer:
Write MD Files to Sd-Card Embedded
-
stefan.erni
- Valued Contributor
- Posts: 1300
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 246 times
- Been thanked: 258 times
-
Steve-Matrix
- Matrix Staff
- Posts: 2061
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 311 times
- Been thanked: 479 times
Re: Write MD Files to Sd-Card Embedded
Property.GetValue should return the current property value as a string. Is that not happening correctly for you?
-
stefan.erni
- Valued Contributor
- Posts: 1300
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 246 times
- Been thanked: 258 times
Re: Write MD Files to Sd-Card Embedded
Hi Steve
In the simulation Property.GetValue the value it shows is 004
I think that's correct.
But in the compiled version running in the ESP32 the string it's empty.
In the simulation Property.GetValue the value it shows is 004
I think that's correct.
But in the compiled version running in the ESP32 the string it's empty.
-
Steve-Matrix
- Matrix Staff
- Posts: 2061
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 311 times
- Been thanked: 479 times
Re: Write MD Files to Sd-Card Embedded
Almost all Inbuilt Function calls in Flowcode are essentially simulation-only. This includes the Property.SetValue function.
If you want to query and store the values in the embedded app itself, then you will need to use other techniques. For example, there is the "AddVar" event which is called for each global variable and constant and allows these to be changed at compile-time to reference property values.
You can find a bit more info about this in the wiki (e.g. here). And there are some examples in the components. For example, the source for the RGB_LED_WS2801 component shows the "RBG" array definition being modified to take into account the number of LEDs.
I rarely use this feature, so Ben might have other suggestions.
If you want to query and store the values in the embedded app itself, then you will need to use other techniques. For example, there is the "AddVar" event which is called for each global variable and constant and allows these to be changed at compile-time to reference property values.
You can find a bit more info about this in the wiki (e.g. here). And there are some examples in the components. For example, the source for the RGB_LED_WS2801 component shows the "RBG" array definition being modified to take into account the number of LEDs.
I rarely use this feature, so Ben might have other suggestions.