.. 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")
```
2 KiB
| layout | board_id | title | name | manufacturer | board_url | board_image | date_added | family | features | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| download | pimoroni_badger2040 | Badger 2040 Download | Badger 2040 | Pimoroni |
|
pimoroni_badger2040.jpg | 2022-02-24 | raspberrypi |
|
A hackable, programmable badge(r) with monochrome E Ink® display, powered by Raspberry Pi RP2040. It has a quintet of buttons (one for each claw), a slot so you can clip it onto a lanyard and a battery connector to keep things portable. You can even connect it up to Qwiic and STEMMA QT breakouts!
Features
- 2.9" black and white E Ink® display (296 x 128 pixels)
- Powered by RP2040 (Dual Arm Cortex M0+ running at up to 133Mhz with 264kB of SRAM)
- 2MB of QSPI flash supporting XiP
- Five front user buttons
- Reset and boot buttons (the boot button can also be used as a user button)
- White LED
- USB-C connector for power and programming
- JST-PH connector for attaching a battery (input range 2.7V - 6V)
- High-precision voltage reference for battery level monitoring
- Qw/ST (Qwiic/STEMMA QT) connector for breakouts
About RP2040
Raspberry Pi's RP2040 microcontroller is a dual core ARM Cortex M0+ running at up to 133Mhz. It bundles in 264kB of SRAM, 30 multifunction GPIO pins (including a four channel 12-bit ADC), a heap of standard peripherals (I2C, SPI, UART, PWM, clocks, etc), and USB support.
One very exciting feature of RP2040 is the programmable IOs which allow you to execute custom programs that can manipulate GPIO pins and transfer data between peripherals - they can offload tasks that require high data transfer rates or precise timing that traditionally would have required a lot of heavy lifting from the CPU.