April 2017
Beginner to intermediate
312 pages
7h 23m
English
Let's review an example where we write to a flash memory chip on the Sensorian add-on hardware via the SPI interface. The drivers for the SPI interface and the memory chip are available from the same GitHub repository.
Since we already have the drivers downloaded, let's review an example available with drivers:
import sys import time import S25FL204K as Memory
Let's initialize and write the message hello to the memory:
Flash_memory = Memory.S25FL204K() Flash_memory.writeStatusRegister(0x00) message = "hello" flash_memory.writeArray(0x000000,list(message), message.len())
Now, let's try to read the data we just wrote to the external memory:
data = flash_memory.readArray(0x000000, message.len()) ...
Read now
Unlock full access