Stufin
Home Quick Cart Profile

Raspberry Pi Official Mouse (White-Red)

Buy Now

Component Name

Raspberry Pi Official Mouse (White-Red)

Description

The Raspberry Pi Official Mouse (White-Red) is a compact, high-quality computer mouse designed specifically for use with Raspberry Pi single-board computers. This official mouse is a perfect accessory for Raspberry Pi enthusiasts, providing a reliable and efficient way to interact with their projects.

Functionality

The Raspberry Pi Official Mouse (White-Red) is a standard optical mouse that allows users to navigate and interact with their Raspberry Pi device graphically. The mouse connects to the Raspberry Pi via a USB port and provides a plug-and-play experience, requiring no additional drivers or setup.

Key Features

  • Compact Design: The mouse has a compact design, making it ideal for use with Raspberry Pi devices in confined spaces or projects with limited room for peripherals.
  • Optical Sensor: The mouse features an optical sensor, which provides accurate and reliable tracking, even on a variety of surfaces.
  • Three-Button Design: The mouse has a standard three-button design, including left and right mouse buttons, as well as a scroll wheel that also functions as a middle mouse button.
  • USB Connectivity: The mouse connects to the Raspberry Pi via a USB port, making it easy to use and requiring no additional power sources.
  • White-Red Color Scheme: The mouse features a unique white and red color scheme, matching the official Raspberry Pi branding and aesthetic.
  • Ergonomic Design: The mouse is designed to fit comfortably in the user's hand, providing a smooth and intuitive user experience.
  • Compatibility: The Raspberry Pi Official Mouse (White-Red) is compatible with all Raspberry Pi models, ensuring seamless integration with a wide range of projects and applications.

Interface

USB

Sensor Type

Optical

Resolution

1000 DPI

Button Layout

Three-button design (left, right, and scroll wheel)

Cable Length

1.5m

Compatibility

Raspberry Pi models (all)

Conclusion

The Raspberry Pi Official Mouse (White-Red) is a high-quality, reliable, and compact mouse designed specifically for use with Raspberry Pi devices. Its optical sensor, three-button design, and ergonomic shape provide an excellent user experience, making it an ideal accessory for Raspberry Pi enthusiasts and project builders.

Pin Configuration

  • Raspberry Pi Official Mouse (White-Red) Pinout Guide
  • The Raspberry Pi Official Mouse (White-Red) is a compact and affordable mouse designed specifically for use with Raspberry Pi single-board computers. The mouse connects to the Raspberry Pi using a USB interface and is a great addition to any Raspberry Pi project. In this document, we will explore the pinout of the Raspberry Pi Official Mouse (White-Red) and provide a step-by-step guide on how to connect the pins.
  • Pinout Diagram:
  • The Raspberry Pi Official Mouse (White-Red) has a standard USB-A connector with the following pinout:
  • Pin 1: VBUS (5V)
  • Function: Power supply pin, provides 5V power from the Raspberry Pi
  • Description: This pin provides the power required by the mouse to operate. It is connected to the 5V power supply on the Raspberry Pi.
  • Pin 2: D- (Data -)
  • Function: USB data transfer pin, carries data from the mouse to the Raspberry Pi
  • Description: This pin is used for data transmission from the mouse to the Raspberry Pi. It is connected to the corresponding data pin on the Raspberry Pi.
  • Pin 3: D+ (Data +)
  • Function: USB data transfer pin, carries data from the Raspberry Pi to the mouse
  • Description: This pin is used for data transmission from the Raspberry Pi to the mouse. It is connected to the corresponding data pin on the Raspberry Pi.
  • Pin 4: GND (Ground)
  • Function: Ground pin, provides a common ground reference between the mouse and the Raspberry Pi
  • Description: This pin provides a common ground reference between the mouse and the Raspberry Pi, ensuring stable operation and reducing noise.
  • Pin 5: ID (No Connect)
  • Function: Not connected, reserved for future use
  • Description: This pin is not connected and is reserved for future use.
  • Connection Guide:
  • To connect the Raspberry Pi Official Mouse (White-Red) to your Raspberry Pi, follow these steps:
  • 1. Locate the USB ports on your Raspberry Pi: Identify the USB ports on your Raspberry Pi. Typically, they are located on the sides or rear of the board.
  • 2. Identify the USB connector on the mouse: Locate the USB-A connector on the Raspberry Pi Official Mouse (White-Red).
  • 3. Insert the mouse connector into the Raspberry Pi USB port: Carefully insert the mouse connector into one of the available USB ports on the Raspberry Pi. Ensure the connector is fully seated and secure.
  • 4. Verify the connection: Once connected, verify that the mouse is recognized by the Raspberry Pi. You can do this by checking the device list in the Raspberry Pi's operating system or by using the `lsusb` command in the terminal.
  • By following these steps, you should be able to successfully connect the Raspberry Pi Official Mouse (White-Red) to your Raspberry Pi and start using it with your project.
  • Important Notes:
  • Ensure that the Raspberry Pi is powered on before connecting the mouse.
  • The Raspberry Pi Official Mouse (White-Red) is a plug-and-play device and does not require any additional drivers or software installation.
  • If you are experiencing issues with the mouse, try restarting the Raspberry Pi or checking the USB port for any debris or damage.

Code Examples

Raspberry Pi Official Mouse (White-Red) Documentation
The Raspberry Pi Official Mouse (White-Red) is a high-quality, optical mouse designed specifically for use with the Raspberry Pi series of single-board computers. This mouse is a Plug-and-Play device, making it easy to use with your Raspberry Pi projects.
Technical Specifications:
Interface: USB
 Resolution: 1000 dpi optical sensor
 Buttons: 3 (left, right, and middle)
 Power Consumption: Bus-powered
 Compatibility: Raspberry Pi 1, 2, 3, 4, and Zero series
Using the Raspberry Pi Official Mouse with Raspberry Pi OS
To use the Raspberry Pi Official Mouse with Raspberry Pi OS, simply plug it into one of the available USB ports on your Raspberry Pi. The mouse will be automatically recognized by the operating system, and you can start using it immediately.
Code Example 1: Using the Mouse with Python in Raspberry Pi OS
In this example, we will use the `python-uinput` library to read mouse events in Python. First, install the required library by running the following command:
```
sudo pip install python-uinput
```
Then, create a new Python script with the following code:
```python
import uinput
# Create a new uinput device
device = uinput.Device()
# Read mouse events
while True:
    event = device.read()
    if event:
        if event.ev_type == uinput.EV_REL:
            print(f"Mouse moved: {event.code} {event.value}")
        elif event.ev_type == uinput.EV_KEY:
            if event.code == uinput.BTN_LEFT:
                print("Left button pressed")
            elif event.code == uinput.BTN_RIGHT:
                print("Right button pressed")
            elif event.code == uinput.BTN_MIDDLE:
                print("Middle button pressed")
```
Run the script, and you will see mouse events printed to the console as you move the mouse and press the buttons.
Code Example 2: Using the Mouse with Scratch in Raspberry Pi OS
In this example, we will use Scratch to create a simple program that responds to mouse events.
Create a new Scratch project and add the following blocks:
`When space key pressed` block to initialize the program
 `Forever` block to continuously read mouse events
 `Mouse x` and `Mouse y` blocks to get the current mouse position
 `If-Then` block to check for button presses
 `Say` block to print a message to the console when a button is pressed
Here's an example Scratch program:
![Scratch Program](https://i.imgur.com/6R3bV4H.png)
Run the program, and you will see the mouse position printed to the console as you move the mouse and press the buttons.
Code Example 3: Using the Mouse with RetroPie
In this example, we will configure RetroPie to use the Raspberry Pi Official Mouse as a controller for emulated games.
First, install RetroPie on your Raspberry Pi by following the official installation guide. Then, edit the RetroPie configuration file by running the following command:
```
sudo nano /etc/retropie/configs/all/retroarch.cfg
```
Add the following lines to the end of the file:
```
input_player1_mouse_enable = "true"
input_player1_mouse_btn_1 = "1"
input_player1_mouse_btn_2 = "2"
input_player1_mouse_btn_3 = "3"
```
Save and exit the editor. Restart RetroPie, and you can now use the Raspberry Pi Official Mouse as a controller in your emulated games.
These examples demonstrate the ease of use and flexibility of the Raspberry Pi Official Mouse (White-Red) in various contexts. Whether you're developing with Python, creating interactive projects with Scratch, or playing classic games with RetroPie, this mouse is an excellent addition to your Raspberry Pi projects.