Component Documentation: BBC Micro:Bit Silicone Soft Cover Protective Case (Blue) for BBC Micro:Bit V1 & V2
Overview:
The BBC Micro:Bit Silicone Soft Cover Protective Case (Blue) is a protective accessory designed specifically for the BBC Micro:Bit V1 and V2 boards. This soft, flexible case provides a snug fit around the Micro:Bit board, shielding it from scratches, bumps, and other forms of damage.
Compatible with BBC Micro:Bit V1 and V2 boards
Made of soft, flexible silicone material
Blue color
Protects the Micro:Bit board from scratches and damage
Easy to install and remove
### Example 1: Basic LED Animation using Micro:Bit with Silicone Case
In this example, we'll demonstrate how to use the Micro:Bit with the Silicone Soft Cover Protective Case to create a simple LED animation.
BBC Micro:Bit V1 or V2 board
BBC Micro:Bit Silicone Soft Cover Protective Case (Blue)
USB cable
Computer with Micro:Bit software installed
Micro:Bit Python editor ( online or offline)
Code:
```python
import microbit
# Initialize the Micro:Bit
microbit.display.scroll('Hello, World!')
# Define a function to animate the LEDs
def animate_leds():
for i in range(25):
microbit.display.set_pixel(i % 5, i // 5, 9)
microbit.sleep(50)
# Call the animation function
animate_leds()
```
Description: This code initializes the Micro:Bit and defines a function to animate the LEDs. The `animate_leds()` function uses a loop to set individual LEDs to a brightness of 9, creating a simple animation effect.
### Example 2: Micro:Bit Accelerometer with Silicone Case
In this example, we'll demonstrate how to use the Micro:Bit with the Silicone Soft Cover Protective Case to read data from the built-in accelerometer.
BBC Micro:Bit V1 or V2 board
BBC Micro:Bit Silicone Soft Cover Protective Case (Blue)
USB cable
Computer with Micro:Bit software installed
Micro:Bit Python editor (online or offline)
Code:
```python
import microbit
# Initialize the Micro:Bit
microbit.display.show(microbit.Image.HAPPY)
# Read accelerometer data
x, y, z = microbit.accelerometer.get_values()
# Print the accelerometer data
print("X:", x, "Y:", y, "Z:", z)
```
Description: This code initializes the Micro:Bit and reads data from the built-in accelerometer using the `get_values()` function. The x, y, and z values are then printed to the console.
Note: These code examples assume that the Micro:Bit is properly connected to a computer and the Micro:Bit software is installed. The Silicone Soft Cover Protective Case does not affect the functionality of the Micro:Bit's programming.