Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Flash file system
Author | Message | ||||
palcal Guru Joined: 12/10/2011 Location: AustraliaPosts: 1800 |
I am re writing my weather station code to use the flash file system instead of saving to the DS3231 flash I'm trying to open a directory and save some values, I have and I get Error : Entry is a dir I find it hard as I can't find any examples, what am I doing wrong? "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 3840 |
Hi @palcal, You don't "open a directory", you open a file in a directory. Assuming the directory "A:/weather/" exists (if not then use MKDIR first) then: open "A:/weather/my_file.txt" for output as #1 Best wishes, Tom Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
palcal Guru Joined: 12/10/2011 Location: AustraliaPosts: 1800 |
Thanks I have never worked with directories so learning "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
palcal Guru Joined: 12/10/2011 Location: AustraliaPosts: 1800 |
Thanks I have never worked with directories so learning "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
palcal Guru Joined: 12/10/2011 Location: AustraliaPosts: 1800 |
OK got it working with.. open "A:/weather/data" for output as #1 print #1, rain print #1, rainyest print #1, rainyear close #1 open "A:/weather/data" for input as#1 input #1, rain input #1, rainyest input #1, rainyear close #1 print rain,rainyest,rainyear Is there a way to Input and Output without using 3 lines, I tried... print #1, rain, rainyest, rainyear input #1, rain, rainyest, rainyear but the second two entries returned zero "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5903 |
' rain =25 raintest = 100.5 rainyear = 1040.8 OPEN "A:/weather/data" FOR output AS #1 PRINT #1, rain;","; rainyest;","; rainyear CLOSE #1 OPEN "A:/weather/data" FOR INPUT as#1 INPUT #1, rain, rainyest,rainyear CLOSE #1 PRINT rain,rainyest,rainyear You need to pout commas between the fields when printing to the file. Jim VK7JH MMedit MMBasic Help |
||||
palcal Guru Joined: 12/10/2011 Location: AustraliaPosts: 1800 |
OK Jim thanks for that. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
palcal Guru Joined: 12/10/2011 Location: AustraliaPosts: 1800 |
With my new Win 11 machine none of the function keys work with Teraterm, GFXterm or MMEdit. the function key for screen brightness are OK. Edited 2023-01-24 13:15 by palcal "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 5903 |
On some keyboards the function keys are dual purpose and you may have to switch them to "function keys" This is very common on laptops and keyboards that are supplied by the big name manufacturers. VK7JH MMedit MMBasic Help |
||||
palcal Guru Joined: 12/10/2011 Location: AustraliaPosts: 1800 |
Forget it. Edited 2023-01-24 15:02 by palcal "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
Chrisk Senior Member Joined: 21/12/2014 Location: AustraliaPosts: 116 |
Hi Guys I'm not sure why Palcal is using the DS3231 flash. Isn't it an RTC. Does it have memory that can be written to? Then once stored what do you Palcal do with this data. Just interested. Chris K |
||||
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 1781 |
Most RTC modules also have a 24C32 memory chip which he was using, but now the Pico has a flash file system he is switching to that. |
||||
palcal Guru Joined: 12/10/2011 Location: AustraliaPosts: 1800 |
@ Chrisk, yes I saved to the DS3231 flash. The code is somewhere here on the forum, I can post it if you want. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
Chrisk Senior Member Joined: 21/12/2014 Location: AustraliaPosts: 116 |
Hi palcal Tried to look it up with search but couldn't find it. Please send when you have the time. What is the advantage of using one over the other. Quite often it is better to leave a functioning system alone unless there are real advantages. Phill99.- Thanks Phill, I will look up the data sheet. Chris K |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1593 |
Maybe this is what you are looking for? Bill Keep safe. Live long and prosper. |
||||
palcal Guru Joined: 12/10/2011 Location: AustraliaPosts: 1800 |
Now I remember, it was Twofingers, I've been trying to remember so I could look it up. I think probably easier to use than the Flash File system but that's just me and this will also work with the MMs "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1593 |
My link above is to Michael's (Twofingers) post. Bill Keep safe. Live long and prosper. |
||||
Chrisk Senior Member Joined: 21/12/2014 Location: AustraliaPosts: 116 |
Thanks Guys The info in the link certainly had my head whirring. |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8579 |
The flash file system is exactly the same as the SDcard file system that has been in Maximites and Micromites for ages. The only difference is that, like LINUX, filenames are case sensitive so "file.bas" is different from "FILE.bas" etc. To make like easy keep everything in lower case and then you can forget about it. It is very well described in the manual section on "Program and data storage" Edited 2023-02-10 21:03 by matherp |
||||
Print this page |