博文

目前显示的是标签为“Raspberry Pi”的博文

How to connect a Bluetooth controller to a Raspberry Pi?

图片
 Here’s the usual, reliable way to connect a Bluetooth controller to a Raspberry Pi (Raspberry Pi OS) . I’ll give you both GUI and terminal methods, plus the pairing combos for common controllers. 1) Quick GUI method (Raspberry Pi OS Desktop) Turn on Bluetooth on the Pi: Click the Bluetooth icon in the top bar (or go to Preferences → Bluetooth ). Put your controller into pairing mode (see section 3). In the Bluetooth window: Search / Add Device Select your controller Click Pair After pairing, choose Connect (some controllers auto-connect). Tip: If you don’t see a Bluetooth UI, install it: sudo apt update sudo apt install -y blueman 2) Terminal method (works on Desktop + Lite): bluetoothctl Open a terminal and run: bluetoothctl Inside bluetoothctl , type: power on agent on default-agent scan on Put the controller in pairing mode. Wait until you see it appear, then copy its MAC address (looks like AA:BB:CC:DD:EE:FF ). Pai...

How to turn off Raspberry Pi?

图片
 To safely turn off a Raspberry Pi , do one of these: From the terminal (recommended) Shutdown now sudo shutdown -h now Power off immediately sudo poweroff Halt (stops CPU; usually also powers off) sudo halt With a desktop GUI Click Menu (Raspberry icon) → Shutdown… → Shutdown If it’s frozen Try the “magic SysRq” safe reboot sequence (works only if enabled): Hold Alt + PrintScreen Slowly type: R E I S U B (reboots safely; for shutdown you’d usually still need power control afterward) After shutdown When the Pi finishes shutting down, the green ACT LED stops blinking . Then you can remove power (unless you have a power management board that cuts power automatically).

How to add programs to the Raspberry Pi 4B?

图片
 On a Raspberry Pi 4B (Raspberry Pi OS), you “add programs” mainly in these ways: 1) Easiest (GUI): Add/Remove Software If you’re using the desktop: Menu → Preferences → Add/Remove Software Search the app → install This uses the same package system as the terminal (APT).  2) Recommended (Terminal): APT packages APT is the standard/recommended way to install/update/remove software on Raspberry Pi OS.  sudo apt update sudo apt install <package-name> Examples: sudo apt install git sudo apt install python3 sudo apt install vlc To update everything: sudo apt update sudo apt full-upgrade To remove: sudo apt remove <package-name> sudo apt autoremove 3) Install a downloaded .deb package If you downloaded a Debian package (must match your architecture: armhf/arm64 , not x86_64):  cd ~/Downloads sudo apt install ./some-package.deb (Using apt install ./file.deb is nice because it pulls dependencies automatically.) 4) Python...

What voltage does Raspberry Pi Zero 2 W use?

图片
  The   Raspberry Pi Zero 2 W   operates at   5 volts   like all modern Raspberry Pi models. Here are the key details: Power Input Specifications: Voltage:   5V DC  (±5% tolerance, so ideally between 4.75V and 5.25V) Current:  Minimum 2.5A recommended for reliable operation (especially under load) Power Connector:  Micro USB port (same as original Pi Zero) Important Notes: Do NOT use voltages above 5V  - this can permanently damage the board. Amperage matters:  While the Pi Zero 2 W itself typically draws 0.8-1.2A under load, you need: Official recommendation:  2.5A power supply With accessories:  More if using USB devices, HATs, or cameras Power can also come from: GPIO header pins (Pin 2: 5V, Pin 6: Ground) From a USB hub that supports power delivery Compared to original Pi Zero: Pi Zero 2 W uses more power due to its quad-core processor Original Pi Zero: ~100-150mA idle Pi Zero 2 W: ~240-300mA idle Under load: Can reac...

How to install Raspberry Pi OS?

图片
 Here’s the straightforward way to install Raspberry Pi OS, step by step. 1. Prepare what you need Hardware Raspberry Pi board (any supported model) microSD card (8 GB minimum, 16–32 GB recommended, Class 10) Card reader for your PC Power supply for the Pi (Optional) HDMI cable + monitor, USB keyboard/mouse On your computer A PC running Windows, macOS, or Linux Raspberry Pi Imager (official tool) 2. Download and install Raspberry Pi Imager Go to the official Raspberry Pi website and download Raspberry Pi Imager for your OS. Install it like a normal application and then open it. Imager handles downloading the correct Raspberry Pi OS image and writing it to the SD card for you. 3. Flash Raspberry Pi OS to the microSD card Insert the microSD card into your computer. In Raspberry Pi Imager : Click Choose Device (if available) and select your Pi model (e.g. “ Raspberry Pi 4 ”). Click Choose OS For most users: Raspberry...

Does GPIO 2 on Raspberry Pi 5 work like GPIO 4

图片
 Short answer: electrically they’re mostly the same as GPIOs, but they are not identical in function or “gotchas”. Also, be careful: “GPIO 2” ≠ “pin 2” on the header. 1. If you meant physical pin 2 vs pin 4 On Raspberry Pi 5 : Pin 2 = 5 V power Pin 4 = 5 V power Both are fixed 5 V supply pins , not GPIO at all. You cannot use them like GPIO4.  So: ❌ Pin 2 does not work like GPIO 4 (BCM 4). It’s just a 5 V output from the power supply. 2. If you meant BCM GPIO2 vs BCM GPIO4 On the Raspberry Pi 5 header: GPIO2 = BCM2, physical pin 3 → default I²C1 SDA   GPIO4 = BCM4, physical pin 7 → a “normal” GPIO with extras like GPCLK0 , and often used as the default 1-Wire pin . They are similar in that: Both are 3.3 V GPIOs in the same IO bank on Pi 5. You can configure each as input or output in your code. But they differ in details: Fixed pull-up on GPIO2 GPIO2 (and GPIO3) have a permanent pull-up to 3.3 V because they are the mai...

How do i install QJoyPad on Raspberry Pi operating system?

图片
 You install QJoyPad on Raspberry Pi OS just like any other Debian package – it’s in the standard repos.  Here’s the quick way: 1. Update your package list Open a terminal on your Raspberry Pi and run: sudo apt update (This makes sure you see the latest versions in the repository.)  2. Install QJoyPad Still in the terminal: sudo apt install qjoypad That’s it – this pulls QJoyPad and any needed libraries from the Raspberry Pi OS repo.  QJoyPad is a Qt program that maps joystick/gamepad input to keyboard/mouse events under X11 (the normal Raspberry Pi desktop).  3. Run QJoyPad On Raspberry Pi OS with Desktop: Log into the graphical desktop. Either: Press Ctrl+Alt+T and run: qjoypad & Or find QJoyPad in the main menu (often under Games or Accessories , depending on your setup).  From there you can: Create a new layout . Click each button/axis and assign a key or mouse action. Save the layout (and optionally se...

What pins on Raspberry Pi 5 can use PWM?

图片
  The Raspberry Pi 5 has significantly improved and expanded its PWM capabilities compared to its predecessors. Here's a detailed breakdown of the PWM pins on the Raspberry Pi 5. Quick Answer: Which GPIO Pins Have PWM? The Raspberry Pi 5 has  up to 10 independent PWM channels  that can be output on multiple GPIO pins. PWM0:  GPIO  12 ,  18 ,  40 PWM1:  GPIO  13 ,  19 ,  41 ,  45 PWM2:  GPIO  10  (Note: This is also used for the EEPROM for HATs, so use with caution) PWM3:  GPIO  11  (Note: This is also used for the EEPROM for HATs, so use with caution) PWM4:  GPIO  20 ,  42 ,  52 ,  54 PWM5:  GPIO  21 ,  43 ,  53 ,  55 PWM6:  GPIO  6 ,  31 ,  56 PWM7:  GPIO  7 ,  31 ,  57 PWM8:  GPIO  2 ,  8 ,  44 PWM9:  GPIO  3 ,  9 ,  44 ⚠️ Important Note:  You can only use ...