Auxiliary Function-Saving Photos or Screenshots into SD Card
Last revision 2026/01/20
This article presents a guide on using HUSKYLENS to save photos and screenshots to an SD card, detailing necessary steps and providing sample code for micro:bit and Arduino.
Like a digital camera, HUSKYLENS can take photos or screenshots, and save them on an SD card. With an onboard SD card slot on HUSKYLENS, you can just plug in the SD card and use it. The screenshots contain the texts, frames displayed on the screen, while the photos contain only the image.
All 7 algorithms support this function. An SD card is required when using this function.
- First-line brands, such as SanDisk, Toshiba, Samsung, and Kingston are recommended. Incompatibility problems may exist between SD cards of small brands.
- The images saved by HUSKYLENS is with resolution ratio of 320*240. And it is unchangeable.
- Please format the SD card as FAT32. Taking photos and screenshots, and saving them costs some time. So, it is recommended to use this function at least 0.5 seconds apart.
- The SD card slot is facing inwards, so, the SD card should be inserted outwards as shown below:

Demonstration: Take screenshot then save into SD Card
Press button A of micro:bit or pull down the Arduino Pin A0, then HUSKYLENS will take a screenshot and save it in SD card
- Mind+ Sample Porgram:

- MakeCode Sample Porgram:

- Arduino Sample Porgram:
#include "HUSKYLENS.h"
HUSKYLENS huskylens;
void setup()
{
Serial.begin(115200);
pinMode(A0,INPUT_PULLUP);
Wire.begin();
while (!huskylens.begin(Wire))
{
Serial.println(F("Begin failed!"));
delay(100);
}
}
void loop()
{
if(digitalRead(A0) == 0)
{
while (!huskylens.saveScreenshotToSDCard()) // bool saveScreenshotToSDCard() or bool savePictureToSDCard()
{
Serial.println(F("save screenshot to SD card failed!"));
delay(100);
}
Serial.println(F("saving screenshot to SD card..."));
delay(500); // The interval between calling this function is not less than 0.5 seconds.
}
}
Result
Press button A of micro:bit or pull down the Arduino Pin A0, then HUSKYLENS will take a screenshot and save it in SD card. Take out the SD card and insert it into a computer, then you can view the screenshot taken by HUSKYLENS.
-
The image shown on the sucreen of HUSKYLENS

-
Read the image file(.bmp) on the SD card on a computer

-
Open the image file

Was this article helpful?
