I have a question as to where the Edison writes files that you create in the source code. I created a file on my python program, but I can't find where it was stored.
Please correct me if I'm wrong, you created a script which creates some sort of file, let's say a log file, and store this log in Edison's internal memory, right?
If so, where that "log file" is would depend on the script itself. I don't know how you wrote your code so I might be mistaken but usually when you set the file's name, you can add the entire path where you want it to be stored and if that path is not specified, generally the file is created in the same directory where the script is stored.
It would be helpful to see your script in case the information above doesn't clear your doubts. I hope this information was of help. Let me know.
Thank you for your help, it is greatly appreciated. I included the path that I would like the log file to be stored when i created an object for writing to the file. There are no compiler errors, it runs. I just can't seem to find the file.
Here is my script written in python
soundpoints = open("C:\Users\Melvin\EdisonFiles\soundpoints.txt", "w")
soundsen = mraa.Aio(0) # Using ADC pin 0
s = 0
totalsound = 0
for s in range(0,100)
sound = soundsen.read()
totalsound = sound + totalsound
totalsound = totalsound/100
soundpoints.write(" " + str(totalsound))
I believe I was not understanding what you're trying to do. I thought you were trying to store the file within your Edison's internal memory. However, it looks like you are trying to send the file to your PC, is that right?
If so, you should store the file in your Edison and then send it your PC. Perhaps you can use this document to do it /docs/DOC-109932 https://communities.intel.com/docs/DOC-109932.
Let me know if that is what you're trying to do and if the document is helpful for you.
I wrote this simple code trying to exemplify how to store data into file:
x = 0
f = open('/home/root/test.txt','w')
while x < 15:
x += 1
As you can see it stores the file in the /home/root directory, your code is not that different from my example, after this you should send it to your PC, you can do it with the guide I sent you earlier.
Let me know if it helps you.
I have typed in the code but I don't know where the file is being stored. The code I pasted did not give me any errors so it probably created the file but I don't know where that file is stored, even though I typed a path in the open command it is not stored there.
What is confusing is that if I typed a similar code into my compiler in my computer it will create the file at the correct location but on the intel edison it creates a file elsewhere I assume.
That is strange, everything seems to be working fine for me, check my screenshot bellow:
Could you post a screenshot of what's happening to you?