.. leading zeros are required for `frontmatter` to treat them as dates
rather than strings, apparently per the YAML specification.
This was done by script:
```py
import re
import datetime
import pathlib
import sys
import frontmatter
rx = re.compile(r'^(\s*)date_added:.*$', re.M)
for path_str in sys.argv[1:]:
print(path_str)
path = pathlib.Path(path_str)
post = frontmatter.load(path)
date_added = post.get("date_added", "")
if isinstance(date_added, datetime.date):
continue
if isinstance(date_added, str):
try:
date_added = datetime.datetime.strptime(date_added, "%Y-%m-%d")
except ValueError as exc:
print(f"Failed to parse date {date_added} in {path_str}: {exc}")
continue
date_added = date_added.date()
content = path.read_text("utf-8")
new_content = rx.sub(lambda m: f"{m.group(1)}date_added: {date_added}", content)
assert content != new_content
path.write_text(new_content, "utf-8")
```
1.8 KiB
| layout | board_id | title | name | manufacturer | board_url | board_image | date_added | family | bootloader_id | |
|---|---|---|---|---|---|---|---|---|---|---|
| download | mini_sam_m4 | Mini SAM M4 Download | Mini SAM M4 | Benjamin Shockley |
|
mini_sam_m4.jpg | 2019-03-12 | atmel-samd | mini_sam_m4 |
Mini SAM is a LEGO® minifigure-sized development board based on the Microchip SAMD51G 48-Pin 32-Bit ARM® Cortex®-M4F MCU running at 48Mhz.
Board Features
I/O
The boards includes a micro USB interface for programming and power. Around the edges are 0.050″ spaced breakouts for the six analog pins, including true analog out, and several digital pins available on the SAMD51G including some dedicated I2C, SPI, and UART connections.
The Mini SAM boards include two LED indicators; a standard “Built-In” LED and an APA102 RGB LED. The standard LED is red and located on the reverse side of the board. When illuminated it lights up the spaceship on on the logo. There are two built-in buttons as well; a RESET button and a user programmable BUTTON.
Memory
In order to support CircuitPython, a 2MB Quad-SPI flash memory chip is included. This provides plenty of space for the CircuitPython program as well as space for user programming. It comes pre-loaded with the latest CircuitPython library bundle.
Power
The boards include a 600mA 3.3V regulator, more than enough to power this little board and its built-in features. The board can be powered from a micro-USB or via a battery connected to the BAT pin – it will automatically switch between the two. There are exposed pads to solder on an optional 2-JST battery connector on the back or directly to the BAT pin.
Purchase
When in stock, you can purchase a board from minifigboards.com