Micro SD Socket
Type | Data Storage |
---|---|
Function | Large external storage |
Description:
The TID tolerance of commercial SD cards varies greatly depending on the charge-storage mechanism and NVM controller used by the card. In general, flash memory fabricated for single-level cells has greater TID thresholds than devices built with multi-level cells. Supported by findings from Kingsbury et al.,
Datasheet(s):
PyCubed Schematic:
PyCubed Board:
Located on the bottom side
Example Code:
'''
List the folders/files in the root of the sd card
'''
from pycubed import cubesat
import os
print(os.listdir('/sd'))
In python, it's convenient to use a with
statement when accessing files because once the with
statement is finished, the file is automatically closed.
'''
Print-out a file on the sd card line by line
'''
from pycubed import cubesat
with open('/sd/test.txt', 'r') as f:
for line in f:
print(line)
The 'a+'
argument allows us to append the file, creating it if it doesn't already exist
'''
Append a file, create the file if it doesn't exist.
After appending, close, reopen, and read the contents.
'''
from pycubed import cubesat
with open('/sd/test.txt', 'a+') as f:
f.write('hello world')
with open('/sd/test.txt', 'r') as f:
for line in f:
print(line)