FoxBit Development Board User Manual
1. Introduction

The FoxBit is a multi-functional development board based on the ESP32 core, designed for education, makers, and electronics enthusiasts. It’s suitable for various scenarios including Internet of Things (IoT), STEAM education, smart control, and DIY projects. It integrates a powerful ESP32 microcontroller chip, supports dual-mode communication via Wi-Fi and Bluetooth, offers high performance and low power consumption, and provides a rich set of peripherals to meet diverse needs from beginners to professional developers.
2. Features
High-Performance Microcontroller: ESP32 dual-core processor, 240MHz, with 520KB SRAM and 4MB Flash, supports FreeRTOS.
Wireless Communication: Supports Wi-Fi (802.11 b/g/n) and Bluetooth (BLE and audio transmission).
Rich Sensor and Peripheral Modules: Includes a temperature and humidity sensor, six-axis accelerometer and gyroscope, light sensor, microphone, buzzer, and a 5x7 RGB LED dot matrix display.
Strong Expandability: Offers 19 digital I/O, 7 touch pins, 2 DACs, and 13 PWM outputs.
Low Power Design: Suitable for low-power applications powered by batteries.
3. Technical Specifications
3.1 Power Supply
Power Supply Methods:
USB Power
DC Power (PH2.0 connector)
Power Supply via Golden Finger I/O ports
Operating Voltage: 3.3V
Maximum Operating Current: 1000mA (all LEDs lit)
3.2 Microcontroller
Chip Model: ESP32-D0WDQ6 (dual-core processor)
Clock Speed: Up to 240MHz
SRAM: 520KB
Flash: 4MB
3.3 Wireless Communication
Wi-Fi:
Protocol: 802.11 b/g/n (supports 802.11n with a maximum speed of 150 Mbps)
Operating Frequency Range: 2412 ~ 2484 MHz
Bluetooth:
Protocol: Compliant with Bluetooth v4.2 BR/EDR and BLE standards
Audio: Supports CVSD and SBC audio
3.4 On-board Resources
Module |
Description |
Interface Type |
GPIO Pins |
|---|---|---|---|
Button A |
Digital Button A |
Digital Interface |
GPIO0 |
Button B |
Digital Button B |
Digital Interface |
GPIO4 |
Touch Function |
Touch Button |
Touch Interface |
GPIO27 |
Six-Axis Accelerometer |
QMI8658C for motion detection and attitude awareness |
I2C |
SDA: GPIO21 SCL: GPIO22 |
Light Sensor |
Phototransistor that detects ambient light intensity |
Analog Interface |
GPIO39 |
Microphone |
Sound Detection |
Analog Interface |
GPIO35 |
Buzzer |
Plays sounds or music |
Digital Interface |
GPIO33 |
5x7 RGB LED Dot Matrix |
35 WS2812 RGB LEDs, single wire control |
Digital Interface |
GPIO13 |
Temperature & Humidity Sensor |
AHT20 for real-time monitoring |
I2C |
SDA: GPIO21 SCL: GPIO22 |
SD Card Expansion Interface |
SPI interface for storage expansion |
SPI |
CS: GPIO5 MOSI: GPIO23 MISO: GPIO19 SCK: GPIO18 |
Current Detection |
Detects current |
Analog Interface |
GPIO36 |

4. Application Scenarios
The Foxbit development board is suitable for the following scenarios:
Internet of Things (IoT) Projects
Connect devices via Wi-Fi or Bluetooth, perfect for smart home, environmental monitoring, and remote control applications.
STEAM Education
Integrates various sensors and peripheral modules, ideal for teaching experiments and maker education, helping students quickly get started with hardware development.
Smart Control
Supports a variety of input and output interfaces, can be used for robot control, automation device development, etc.
DIY Projects
Rich onboard resources and expansion interfaces are perfect for makers and electronics enthusiasts to develop personalized projects.
5. Development Environment Support
The Foxbit development board is compatible with various development environments, supporting quick development and debugging:
Arduino IDE
Great for beginners, offering a wealth of libraries and example codes for quick development.
MicroPython
Supports Python programming, suitable for rapid prototype development, with a simple syntax that’s easy to learn.
KidsBlock
A Scratch-based graphical programming software designed for beginners and children. Users can create programs by dragging and dropping blocks, making it ideal for STEAM education and introductory hardware programming.
MicroBlocks
A live, Scratch-like graphical programming environment that runs code immediately on the board without compilation. It supports real-time sensor feedback, autonomous offline operation, and parallel task execution, making it excellent for interactive learning.
6. Using Arduino IDE to Develop FoxBit
1. Install the Arduino Development Environment
1.1 Install Arduino IDE
Visit the Arduino official website to download Arduino IDE.
Install Arduino IDE based on your operating system (Windows, macOS, or Linux).

1.2 Install ESP32 Board Support
Open Arduino IDE.
Click on File > Preferences.
In the “Additional Board Manager URLs” section, paste the following link:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

Click OK to save the settings.
Click on Tools > Board > Board Manager.

In the search box, type ESP32.
Find esp32 by Espressif Systems, then click Install.

1.3 Select the Development Board
Connect the Foxbit development board to your computer using a USB cable.
In Arduino IDE, click on Tools > Board > ESP32 Arduino, and select ESP32 Dev Module (or similar ESP32 development board).

Click on Tools > Port, and select the COM port corresponding to the Foxbit development board.

2. Module Functions and Application Examples
2.2 Touch Functionality
Description
Touch button connected to GPIO27.
Can be used for touch interaction, like switching controls or sliding detection.
Example Code: Detect Touch Input
This code detects the touch state of the button and prints the result to the serial monitor.
#define TOUCH_PIN 27 // Touch button pin
void setup() {
Serial.begin(115200); // Initialize serial communication
touchAttachInterrupt(TOUCH_PIN, onTouch, 40); // Set touch interrupt with a threshold of 40
}
void loop() {
delay(100); // No operations needed in the main loop, touch events are handled by interrupts
}
void onTouch() {
Serial.println("Touch Detected!");
}
2.3 Six-Axis Accelerometer
Description
QMI8658C for motion detection and attitude awareness, using I2C interface (SDA: GPIO21, SCL: GPIO22).
Can detect acceleration and angular velocity, suitable for motion detection and posture recognition applications.
Before starting the code, we need to install the library files. Steps for install QMI8658 Library
Download the Library:
Open Arduino IDE.
Import ZIP Library:
Click on “Sketch” > “Include Library” > “Add .ZIP Library…”.
Choose the downloaded QMI8658 ZIP file and click “Open”.
Example Code: Read Acceleration and Gyroscope Data
#include <Wire.h>
#include "QMI8658.h"
QMI8658 qmi8658;
void setup()
{
Serial.begin(115200); // Initialize serial communication
Wire.begin(21,22); // Initialize I2C
if( qmi8658.begin()== 0)
{
Serial.println("qmi8658_init fail");
}
}
void loop()
{
QMI8658_Test();
}
void QMI8658_Test()
{
float pitch;
float roll;
float yaw;
qmi8658.GetEulerAngles(&pitch,&roll, &yaw);
Serial.print(pitch );Serial.print(" , " );
Serial.print(roll );Serial.print(" , " );
Serial.println(yaw );
}
2.4 Light Sensor
Description
ALS-PT19-315C phototransistor connected to GPIO39 (analog interface).
Used for detecting ambient light intensity, suitable for automatic brightness adjustment and light detection.
Example Code: Read Light Intensity Values
This code reads the analog value from the light sensor and prints the result to the serial monitor.
#define LIGHT_SENSOR_PIN 39 // Light sensor pin
void setup() {
Serial.begin(115200); // Initialize serial communication
}
void loop() {
int lightValue = analogRead(LIGHT_SENSOR_PIN); // Read light intensity value
Serial.print("Light Intensity: ");
Serial.println(lightValue);
delay(500);
}
2.5 Microphone
Description
Used for sound detection, connected to GPIO35 (analog interface).
Suitable for voice recognition and noise monitoring.
Example Code: Detect Sound Intensity
This code reads the analog value from the microphone and prints the sound intensity.
#define MIC_PIN 35 // Microphone pin
void setup() {
Serial.begin(115200); // Initialize serial communication
}
void loop() {
int soundValue = analogRead(MIC_PIN); // Read sound intensity value
Serial.print("Sound Intensity: ");
Serial.println(soundValue);
delay(500);
}
2.6 Buzzer
Description
Used for playing sounds or music, connected to GPIO33 (digital interface).
Example Code: Play Music
This code uses the buzzer to play a simple tune (like “Twinkle, Twinkle Little Star”).
#define BUZZER_PIN 33 // Buzzer pin
// Define note frequencies (in Hz)
#define NOTE_C4 262
#define NOTE_D4 294
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_G4 392
#define NOTE_A4 440
#define NOTE_B4 494
#define NOTE_C5 523
// Define note durations (in milliseconds)
#define WHOLE_NOTE 1000
#define HALF_NOTE 500
#define QUARTER_NOTE 250
#define EIGHTH_NOTE 125
// Define melody notes and rhythm for "Twinkle, Twinkle"
int melody[] = {
NOTE_C4, NOTE_C4, NOTE_G4, NOTE_G4, NOTE_A4, NOTE_A4, NOTE_G4,
NOTE_F4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_D4, NOTE_D4, NOTE_C4
};
int noteDurations[] = {
QUARTER_NOTE, QUARTER_NOTE, QUARTER_NOTE, QUARTER_NOTE, QUARTER_NOTE, QUARTER_NOTE, HALF_NOTE,
QUARTER_NOTE, QUARTER_NOTE, QUARTER_NOTE, QUARTER_NOTE, QUARTER_NOTE, QUARTER_NOTE, HALF_NOTE
};
void setup() {
pinMode(BUZZER_PIN, OUTPUT); // Set buzzer as output
}
void loop() {
// Play "Twinkle, Twinkle"
for (int i = 0; i < sizeof(melody) / sizeof(melody[0]); i++) {
int noteDuration = noteDurations[i];
tone(BUZZER_PIN, melody[i], noteDuration); // Play the note
delay(noteDuration * 1.3); // Delay to ensure a gap between notes
noTone(BUZZER_PIN); // Stop the current note
}
delay(2000); // Wait 2 seconds after playing
}
2.7 RGB LED Dot Matrix
Description
35 WS2812-2020 RGB LEDs, single wire control, connected to GPIO13.
Can be used to display colors, animations, and scrolling text.
Example Code: Light Up the RGB LED Dot Matrix
This code lights up the RGB LED dot matrix and cycles through different colors.
#include <Adafruit_NeoPixel.h>
#define LED_PIN 13 // RGB LED dot matrix pin
#define NUM_LEDS 35 // Total number of LEDs in the matrix
#define MATRIX_WIDTH 5 // Width of the matrix (columns)
#define MATRIX_HEIGHT 7 // Height of the matrix (rows)
Adafruit_NeoPixel strip(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);
// Convert 2D coordinates (x, y) to a 1D LED index
int getLedIndex(int x, int y) {
if (y % 2 == 0) { // Even rows from left to right
return y * MATRIX_WIDTH + x;
} else { // Odd rows from right to left
return y * MATRIX_WIDTH + (MATRIX_WIDTH - 1 - x);
}
}
void setup() {
strip.begin();
strip.show(); // Initialize all LEDs to off
}
void loop() {
// Cycle through lighting each LED
for (int y = 0; y < MATRIX_HEIGHT; y++) {
for (int x = 0; x < MATRIX_WIDTH; x++) {
int index = getLedIndex(x, y);
strip.setPixelColor(index, strip.Color(255, 0, 0)); // Set to red
strip.show();
delay(100);
}
}
delay(500);
// Clear all LEDs
strip.clear();
strip.show();
delay(500);
}
2.8 Temperature and Humidity Sensor
Description
AHT20 for real-time monitoring, uses I2C interface (SDA: GPIO21, SCL: GPIO22).
Monitors ambient temperature and humidity.
Example Code: Read Temperature and Humidity Data
Before starting the code, we need to install the library files. Steps to Import the Adafruit_AHTX0 Library
Open Arduino IDE.
Click on “Tools” > “Manage Libraries…”.
Search for “Adafruit AHTX0” in the Library Manager.
Once you find the library, click the “Install” button.
After installation, you can use the library in your code by adding.
#include <Wire.h>
#include <Adafruit_AHTX0.h>
Adafruit_AHTX0 aht;
void setup() {
Serial.begin(115200);
if (!aht.begin()) {
Serial.println("Failed to initialize AHT20!");
while (1);
}
}
void loop() {
sensors_event_t humidity, temp;
aht.getEvent(&humidity, &temp);
Serial.print("Temperature: ");
Serial.print(temp.temperature);
Serial.println(" °C");
Serial.print("Humidity: ");
Serial.print(humidity.relative_humidity);
Serial.println(" %");
delay(1000);
}
2.9 SD Card Expansion Interface
Description
SPI interface for storage expansion.
Example Code: Read and Write SD Card Files
This code demonstrates reading and writing files with the SD card module.
#include <SPI.h>
#include <SD.h>
#define CS_PIN 5 // SD card CS pin
void setup() {
Serial.begin(115200);
// Initialize SD card
if (!SD.begin(CS_PIN)) {
Serial.println("SD card initialization failed!");
while (1);
}
Serial.println("SD card initialized successfully!");
// Create and write to file
File file = SD.open("/test.txt", FILE_WRITE);
if (file) {
file.println("Hello, SD Card!");
file.close();
Serial.println("File written successfully!");
} else {
Serial.println("Unable to open file for writing!");
}
// Read file content
file = SD.open("/test.txt");
if (file) {
Serial.println("File content:");
while (file.available()) {
Serial.write(file.read());
}
file.close();
} else {
Serial.println("Unable to open file for reading!");
}
}
void loop() {
// Empty loop
}
2.10 Power Detection Module
Description
Power detection module (INA180A1IDBVR) detects supply current via an analog interface (GPIO36).
Can monitor the power supply current or voltage.
Example Code: Read Power Supply Current
This code reads the analog value from the power detection module and converts it to voltage.
#define POWER_SENSOR_PIN 36 // Power detection module pin
#define SENSITIVITY 0.1 // Sensitivity in A/V (100 mV/A)
void setup() {
Serial.begin(115200);
// Initialize ADC
analogReadResolution(12); // Set ADC resolution to 12 bits
analogSetAttenuation(ADC_11db); // Set range to 0-3.3V
}
void loop() {
int rawValue = analogRead(POWER_SENSOR_PIN); // Read ADC raw value
float voltage = rawValue * (3.3 / 4095.0); // Convert ADC value to voltage
float current = voltage / SENSITIVITY; // Convert voltage to current (A)
// Convert current from A to mA
current *= 1000;
Serial.print("Current: ");
Serial.print(current);
Serial.println(" mA");
delay(100);
}
7. Using MicroPython to Develop FoxBit
1. What is MicroPython?
MicroPython is a lightweight implementation of Python designed for microcontrollers. It supports various development boards (like ESP32, micro:bit, etc.) and provides rich hardware control libraries, ideal for rapid development and learning.
2. Download and Install Thonny
Download Thonny
Open the official website: https://thonny.org.
Choose the version based on your operating system:
Windows: thonny-3.2.7.exe
macOS: thonny-3.2.7.pkg
Linux:
sudo apt install thonny # For Debian/Ubuntu systems
Install Thonny
Double-click the downloaded installation file (e.g., thonny-3.3.13.exe).

Click Next in the installation wizard and choose the installation path if needed.

Check Create desktop icon to create a shortcut.

Click Install and wait for the installation to complete.

Click Finish when done.

Launch Thonny
Double-click the Thonny icon on your desktop.
For the first startup, select your language and initial settings, then click Let’s go!.

3. Flash MicroPython Firmware
Connect ESP32
Use a USB cable to connect the ESP32 development board to your computer.
Open Device Manager, expand Ports (COM & LPT), and confirm the board’s COM port (e.g., USB-SERIAL CH340 (COM283)).

Open Thonny
Launch Thonny IDE.
Go to the Run menu and select Select interpreter….

Install or Update Firmware
Firmware download link: https://micropython.org/resources/firmware/esp32-20210902-v1.17.bin
In the interpreter settings:
Select MicroPython (ESP32).
Choose the corresponding COM port (e.g., USB-SERIAL CH340 (COM283)).
Click Install or update firmware.

In the firmware installation window:
Select the COM port (e.g., USB-SERIAL CH340 (COM283)).
Click Browse… to choose the downloaded firmware file (e.g., esp32-20210902-v1.17.bin).
Check Erase flash before installing and Flash mode.
Click Install to begin flashing.

After flashing, click Close and then OK.
Return to Main Interface
Close all settings windows to return to Thonny’s main interface.
Click the STOP button on the main interface to ensure the board is ready to run code.

4. Test MicroPython Environment
Open Shell
In Thonny, ensure the Shell view is enabled (click View > Shell).
If connected successfully, the Shell should display the >>> prompt.

Test Code
Type the following code in the Shell:
print("Hello, MicroPython!")
If the message is printed successfully, it indicates the environment is set up correctly.
5. Upload Code to Foxbit
Write code in Thonny.
Click File > Save As, select MicroPython Device, and save the code to the ESP32.
6. Module Functions and MicroPython Examples
2.1 Buttons A and B
Description
Button A: Digital button connected to GPIO0.
Button B: Digital button connected to GPIO4.
Used for user input, controlling device power or mode switching.
MicroPython Example: Detect Button States
from machine import Pin
import time
button_a = Pin(0, Pin.IN, Pin.PULL_UP) # Button A
button_b = Pin(4, Pin.IN, Pin.PULL_UP) # Button B
while True:
if not button_a.value(): # Button A pressed
print("Button A Pressed")
if not button_b.value(): # Button B pressed
print("Button B Pressed")
time.sleep(0.1)
2.2 Touch Functionality
Description
Touch button connected to GPIO27.
Can be used for touch interaction, like switching controls or sliding detection.
MicroPython Example: Detect Touch Input
from machine import TouchPad, Pin
import time
touch = TouchPad(Pin(27)) # Initialize touch pin
while True:
touch_value = touch.read() # Read touch value
if touch_value < 500: # Determine touch based on threshold
print("Touch Detected")
else:
print("No Touch Detected")
time.sleep(0.1)
2.3 Six-Axis Accelerometer
Description
QMI8658C for motion detection and attitude awareness.
Uses I2C interface.
MicroPython Example: Read Acceleration Data
from machine import I2C, Pin
import time
i2c = I2C(0, scl=Pin(22), sda=Pin(21)) # Initialize I2C
# QMI8658C I2C address
QMI8658C_ADDR = 0x6A
# Initialize the sensor
i2c.writeto_mem(QMI8658C_ADDR, 0x02, b'\x01') # Set operational mode
while True:
# Read acceleration data
accel_data = i2c.readfrom_mem(QMI8658C_ADDR, 0x35, 6)
ax = int.from_bytes(accel_data[0:2], 'little', signed=True)
ay = int.from_bytes(accel_data[2:4], 'little', signed=True)
az = int.from_bytes(accel_data[4:6], 'little', signed=True)
print("Acceleration X: {}, Y: {}, Z: {}".format(ax, ay, az))
time.sleep(0.5)
2.4 Light Sensor
Description
ALS-PT19-315C phototransistor for detecting ambient light intensity.
Uses analog interface.
MicroPython Example: Read Light Intensity
from machine import ADC, Pin
import time
light_sensor = ADC(Pin(39)) # Initialize light sensor
light_sensor.atten(ADC.ATTN_11DB) # Set range to 0-3.3V
while True:
light_value = light_sensor.read() # Read light intensity value
print("Light Intensity: {}".format(light_value))
time.sleep(0.5)
2.5 Microphone
Description
Used for sound detection, connected to GPIO35.
Suitable for voice recognition and noise monitoring.
MicroPython Example: Detect Sound Intensity
from machine import ADC, Pin
import time
mic = ADC(Pin(35)) # GPIO35
mic.atten(ADC.ATTN_11DB) # Set range to 0-3.3V
while True:
mic_value = mic.read() # Read microphone analog value
print("Sound Intensity: {}".format(mic_value))
time.sleep(0.1)
2.6 Buzzer
Description
Used for playing sounds or music, connected to GPIO33.
MicroPython Example: Play Music
from machine import Pin, PWM
import time
buzzer = PWM(Pin(33)) # Initialize buzzer
# Define note frequencies
tones = {
"C4": 262,
"D4": 294,
"E4": 330,
"F4": 349,
"G4": 392,
"A4": 440,
"B4": 494,
"C5": 523
}
# Define melody notes and rhythm for "Twinkle, Twinkle"
melody = ["C4", "C4", "G4", "G4", "A4", "A4", "G4",
"F4", "F4", "E4", "E4", "D4", "D4", "C4"]
duration = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1]
for note, dur in zip(melody, duration):
buzzer.freq(tones[note]) # Set pitch
buzzer.duty(512) # Set volume
time.sleep(dur) # Duration
buzzer.duty(0) # Stop buzzer
time.sleep(0.1)
2.7 RGB LED Dot Matrix
Description
35 WS2812-2020 RGB LEDs, single wire control.
Supports displaying various colors and dynamic effects.
MicroPython Example: Light Up RGB LEDs
from machine import Pin
import neopixel
import time
np = neopixel.NeoPixel(Pin(13), 35) # Initialize RGB LED dot matrix
# Light up all LEDs in red
for i in range(35):
np[i] = (255, 0, 0) # Red
np.write()
2.8 Temperature and Humidity Sensor
Description
AHT20 for real-time monitoring, uses I2C interface.
MicroPython Example: Read Temperature and Humidity
from machine import I2C, Pin
import time
import ahtx0
i2c = I2C(0, scl=Pin(22), sda=Pin(21)) # Initialize I2C
sensor = ahtx0.AHT20(i2c)
while True:
print("Temperature: {:.2f} °C, Humidity: {:.2f} %".format(sensor.temperature, sensor.relative_humidity))
time.sleep(1)
2.9 SD Card Expansion Interface
Description
SPI interface for storage expansion.
MicroPython Example: Read and Write SD Card
import os
from machine import Pin, SPI, SDCard
spi = SPI(2, sck=Pin(18), mosi=Pin(23), miso=Pin(19))
sd = SDCard(spi, cs=Pin(5))
os.mount(sd, "/sd")
with open("/sd/test.txt", "w") as f:
f.write("Hello, SD Card!")
2.10 Power Detection Module
Description
Detects supply current.
MicroPython Example: Detect Power Supply Current
from machine import ADC, Pin
import time
sensor = ADC(Pin(36))
sensor.atten(ADC.ATTN_11DB)
while True:
value = sensor.read()
print("Power Current: {}".format(value))
time.sleep(1)
8. Using KidsBlock to Develop FoxBit
1. What is KidsBlock?
KidsBlock is a friendly graphical programming software designed for beginners and children. It aims to help users quickly master hardware development through simple drag-and-drop programming. The software presents programming logic in a visual format, allowing users to create complex programs by combining blocks without writing complex code syntax. It supports various development boards including Arduino, Micro:bit, and ESP32.
2. Download and Install KidsBlock
Download KidsBlock
Visit the official download page: https://www.kidsblock.cc/download or use the direct download links:
Windows: KidsBlock.exe
macOS: KidsBlock.dmg
Install KidsBlock
For Windows:
Double-click the downloaded
KidsBlock.exefile.Follow the prompts in the installation wizard.
Choose whether to install for all users or only for the current user.
Click Install and wait for the process to complete.
For macOS:
Double-click the downloaded
KidsBlock.dmgfile.Drag the KidsBlock application icon into the “Applications” folder.
3. Connect FoxBit and Configure KidsBlock
Connect the FoxBit development board to the computer using a USB cable.
Open the KidsBlock software.
Click the Board icon in the top toolbar and select ESP32 (if there is a specific FoxBit board in the list, select it).
Click the Connect icon, select the COM port corresponding to your FoxBit development board, and then click Connect.
After a successful connection, you can start dragging blocks from the left panel to the central workspace to build your program.
4. Module Functions and KidsBlock Examples
4.1 Buttons A and B
Description
Button A: Digital button connected to GPIO0.
Button B: Digital button connected to GPIO4.
Used for user input, such as controlling device power or switching modes.
KidsBlock Example: Detect Button States
From the Events category, drag out the
when Arduino startsblock.From the Control category, attach a
foreverloop block.Inside the loop, add an
ifblock.From the Button category, drag the
Button[A]was be pushed?block into the condition of theifblock, and check if the button is pressed.If true, use the
print "Button A Pressed"block from the Serial category, and delay for 0.3 seconds.Repeat this process for Button B, using pin
4.


4.2 Touch Functionality
Description
Touch button connected to GPIO27.
Can be used for touch interaction, like switching controls or sliding detection.
KidsBlock Example: Detect Touch Input
From the Events category, drag out the
when Arduino startsblock.From the Control category, attach a
foreverloop block.Inside the loop, add an
if...elseblock.From the Touch category, drag the
[IO27] was be touched?block into the condition of theifblock, and check if it is touched.If true, use the
print "Touch Detected!"block from the Serial category, otherwise print “Not Touch Detected!”.


4.3 Six-Axis Accelerometer
Description
QMI8658C for motion detection and attitude awareness, using I2C interface (SDA: GPIO21, SCL: GPIO22).
Can detect acceleration and angular velocity.
KidsBlock Example: Read Acceleration Data
From the Events category, drag out the
when Arduino startsblock.From the Acceleration category, drag out the
init QMI8658block.From the Control category, attach a
foreverloop block.Inside the loop, use the
printblock from the Serial category to print the values ofQMI8658 read [Pitch],QMI8658 read [Roll], andQMI8658 read [Yaw].


4.4 Light Sensor
Description
ALS-PT19-315C phototransistor, connected to GPIO39 (analog interface).
Used for detecting ambient light intensity.
KidsBlock Example: Read Light Intensity
From the Events category, drag out the
when Arduino startsblock.From the Control category, attach a
foreverloop block.Inside the loop, use the
printblock from the Serial category to print the value.For the value to print, drag out the
read the value light [IO39]block from the Light category.Add a
wait [0.3] secondsblock from the Control category to slow down the reading speed.


4.5 Microphone
Description
Used for sound detection, connected to GPIO35 (analog interface).
Suitable for voice recognition and noise monitoring.
KidsBlock Example: Detect Sound Intensity
From the Events category, drag out the
when Arduino startsblock.From the Control category, attach a
foreverloop block.Inside the loop, use the
printblock from the Serial category to print the value.For the value to print, drag out the
read the value sound [IO35]block from the Sound category.Add a
wait [0.1] secondsblock from the Control category.


4.6 Buzzer
Description
Used for playing sounds or music, connected to GPIO33 (digital interface).
KidsBlock Example: Play Music
From the Events category, drag out the
when Arduino startsblock.From the Music category, drag out 7
Music PIN#[IO33] frequency[NOTE_C3] duration[131]blocks, sequentially change the frequencies to NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4, NOTE_A4, NOTE_B4, and set the duration to 500 for all.After uploading the code, you will hear the buzzer play Do, Re, Mi, Fa, Sol, La, Si. If you only want to play certain notes, you can press the reset button to play again.

4.7 RGB LED Dot Matrix
Description
35 WS2812-2020 RGB LEDs, single wire control, connected to GPIO13.
Can be used to display colors, animations, and scrolling text.
KidsBlock Example: Light Up RGB LED
From the Events category, drag out the
when Arduino startsblock.From the RGB category, drag out the initialization block:
init RGB length [35] pin [IO13].Drag out the
fill form pixel[0]count[34] withcolor[red]block.Drag out the
refreshblock to update the LEDs.

4.8 Temperature and Humidity Sensor
Description
AHT20 for real-time monitoring, uses I2C interface (SDA: GPIO21, SCL: GPIO22).
Monitors ambient temperature and humidity.
KidsBlock Example: Read Temperature and Humidity Data
From the Events category, drag out the
when Arduino startsblock.From the Control category, attach a
foreverloop block.Inside the loop, use the serial print block to print the values of
Temperature and humidity get[temperature]andTemperature and humidity get[humidity]from the Temperature and humidity category.


4.9 SD Card Expansion Interface
Description
SPI interface for storage expansion.
KidsBlock Example: Read and Write SD Card Files
From the Events category, drag out the
when Arduino startsblock.From the SD Card category, drag out the
init sd card CS:[5] MOSI:[23] MISO:[19] SCK:[18]block.Drag out the
write SD File [file.txt]Data[hello,world]NewLine[true]block and change the file name to “test.txt”.Drag out the
SD refresh datablock to refresh the txt file.Drag out
read[file.txt], change the file name to “test.txt”, and read the content of the test.txt file.


4.10 Power Detection Module
Description
Power detection module (INA180A1IDBVR) detects supply current via an analog interface (GPIO36).
Can monitor the power supply current or voltage.
KidsBlock Example: Detect Power Supply Current
From the Events category, drag out the
when Arduino startsblock.Light up all RGB LEDs to increase current consumption so you can see the current value.
From the Control category, attach a
foreverloop block.Inside the loop, use the
printblock from the Serial category to print the value.For the value to print, drag out the
read the calue of currentblock from the current category.


9. Using MicroBlocks to Develop FoxBit
1. What is MicroBlocks?
MicroBlocks is a free, Scratch-like graphical programming language designed for physical computing. It supports many educational microcontroller boards, including the ESP32. What makes MicroBlocks unique is its combination of live programming and autonomous operation. You can click on a block, and it runs immediately on the board, allowing you to see sensor values in real-time without waiting for code to compile. Once programming is complete, the board can run independently offline.
2. Download and Install MicroBlocks
Download MicroBlocks
Visit the official website: https://microblocks.fun/get-started
You can run MicroBlocks directly in Chrome or Edge browsers, or download the standalone application for your operating system (Windows, macOS, Linux, or Chromebook).
Install MicroBlocks
For Windows:
Download the Windows installer.
Double-click the installer and follow the prompts to install MicroBlocks on your computer.
For macOS:
Download the macOS DMG file.
Open the DMG file and drag the MicroBlocks application into your “Applications” folder.
3. Flash MicroBlocks Firmware to FoxBit
Before programming the FoxBit development board with MicroBlocks, you need to install the MicroBlocks firmware on it.
Connect the FoxBit development board to the computer using a USB cable.
Open the MicroBlocks application or web editor.
Click the Gear icon (Settings) in the top right corner.
Select update firmware on board.
Select ESP32 from the list of board types.
Select the COM port corresponding to your FoxBit development board.
Wait for the firmware flashing process to complete. A success message will be displayed when finished.
4. Connect and Program
After flashing the firmware, click the USB icon (Connect) in the top toolbar.
Select the COM port of your FoxBit development board to connect.
After a successful connection, a green circle will appear next to the USB icon.
You can now drag blocks from the categories on the left to the scripting area to build your program. Click any block or script to run it immediately on the FoxBit development board.
5. Module Functions and MicroBlocks Examples
5.1 Buttons A and B
Description
Button A: Digital button connected to GPIO0.
Button B: Digital button connected to GPIO4.
Used for user input, such as controlling device power or switching modes.
MicroBlocks Example: Detect Button States
From the Control category, drag out the
when startedblock.Attach a
foreverloop block.Inside the loop, add an
ifblock.From the Input category, drag the
Button Ablock into the condition of theifblock, and check if it equals0(low level).If true, use the
say "Button A Pressed"block from the Output category.Repeat this process for Button B, using pin
4.

5.2 Touch Functionality
Description
Touch button connected to GPIO27.
Can be used for touch interaction, like switching controls or sliding detection.
MicroBlocks Example: Detect Touch Input
From the Control category, drag out the
when startedblock.Attach a
foreverloop block.Inside the loop, add an
ifblock.From the Foxbit category, drag the
fb pin 'logo' touchedblock into the condition of theifblock.If true, use the
say "Touch Detected!"block from the Output category. Delay for 500 milliseconds.Add an else block to output “No touch detected”.

5.3 Six-Axis Accelerometer
Description
QMI8658C for motion detection and attitude awareness, using I2C interface (SDA: GPIO21, SCL: GPIO22).
Can detect acceleration and angular velocity.
MicroBlocks Example: Read Acceleration Data
Click the
Add Librarybutton to add the Basic Sensors library.From the Control category, drag out the
when startedblock.Attach a
foreverloop block.Inside the loop, use the
say []block from the Output category to output these values.Use the
tilt x,tilt y, andtilt zblocks from the Basic Sensors category to output.Delay for 200 milliseconds for observation.

5.4 Light Sensor
Description
ALS-PT19-315C phototransistor, connected to GPIO39.
Used for detecting ambient light intensity.
MicroBlocks Example: Read Light Intensity
From the Control category, drag out the
when startedblock.Attach a
foreverloop block.Inside the loop, use the
sayblock from the Output category to output the value.For the value to say, drag out the
fb light levelblock from the Foxbit category.Add a
wait [500] millisecsblock from the Control category to slow down the reading speed.Click the script to start reading and displaying the light intensity value in real-time.

5.5 Microphone
Description
Used for sound detection, connected to GPIO35 (analog interface).
Suitable for voice recognition and noise monitoring.
MicroBlocks Example: Detect Sound Intensity
From the Control category, drag out the
when startedblock.Attach a
foreverloop block.Inside the loop, use the
sayblock from the Output category to output the value.For the value to say, drag out the
fb loudnessblock from the Foxbit category.Add a
wait [100] millisecsblock from the Control category.

5.6 Buzzer
Description
Used for playing sounds or music, connected to GPIO33.
MicroBlocks Example: Play Sound
From the Tone category, drag out the
play note [c] octave [0] for [500] msblock.Sequentially add the notes d, e, f, g, a, b.
Click the block to play once: Do, Re, Mi, Fa, Sol, La, Si.

5.7 RGB LED Dot Matrix
Description
35 WS2812-2020 RGB LEDs, single wire control, connected to GPIO13.
MicroBlocks Example: Light Up RGB LED
From the NeoPixel category, drag out the
fb set all NeoPixelsblock and click it to change the color to red.Click the block to light up the dot matrix.

5.8 Temperature and Humidity Sensor
Description
AHT20 for real-time monitoring, uses I2C interface (SDA: GPIO21, SCL: GPIO22).
Monitors ambient temperature and humidity.
MicroBlocks Example: Read Temperature and Humidity Data
From the Control category, drag out the
when startedblock.Attach a
foreverloop block.Inside the loop, use the
sayblock from the Output category to output these values, and add multiple output boxes to make the blocksay [Temperature:] [ ] [c] [Humidity:] [ ] [%].From the Foxbit category, drag out the
fb temperatureandfb humidityblocks, and place them in the corresponding positions of the output block.Add a 200-millisecond delay.

5.9 SD Card Expansion Interface
Description
SPI interface for storage expansion.
MicroBlocks Example: Read and Write SD Card Files
Click the
Add Librarybutton, go to[] Other, and find the SDCard library.Create a file named ‘test’ on the SD card.
From the SDCard category, drag out the
open sd file []block and enter the file nametestto open the file.From the SDCard category, drag out the
append line [ ] to sd file []block and add the text “Hello, SD Card!” and the file name.From the Output category, drag out the
say []block.From the SDCard category, drag out the
contents of sd file []block, place it in thesay []block, and add the file name “test” to read.Click run to write “Hello, SD Card!” to the test.txt file, and then read it out. Each time you run this code, it will write a new line.

5.10 Power Detection Module
Description
Power detection module (INA180A1IDBVR) detects supply current via an analog interface (GPIO36).
Can monitor the power supply current or voltage.
MicroBlocks Example: Detect Power Supply Current
From the Control category, drag out the
when startedblock.Use the
fb set all NeoPixelsblock to light up all LEDs, increasing current usage to make it easier to view the current.Attach a
foreverloop block.Inside the loop, use the
sayblock from the Output category to output the value.For the value to say, drag out the
fb currentblock from the Foxbit category.Click run to see the current.
