pokitto / PokittoLib

Library for making programs on Pokitto hardware
22 stars 16 forks source link

Added the cookie support for MicroPython #82

Closed haviital closed 4 years ago

haviital commented 4 years ago

Added the Cookie::BeginWithData method Added #error if the USB serial is used but the high ram is already reserved. Updated the micropython libraries.

Example usage of the cookie in Python code:

# Load the cookie from EEPROM 
myCookieData = bytearray(4)
myCookie = umachine.Cookie("tetris", myCookieData)
myCookie.load()
...
# Save the cookie to EEPROM
myCookieData[0] += 1  # change the first byte
myCookie.save()