Zero 2W • ☑ Raspberry Pi 4B • ☑ Raspberry Pi 3B+ • ☑ Raspberry Pi 3A+ • ☑ Raspberry Pi Zero W • ☑ Raspberry Pi 3B • ☑ Raspberry Pi 2B • ☑ Raspberry Pi B+ • ☑ Raspberry Pi Model B 本教學適合
GPIO.PWM(channel, frequency) • To start PWM: • p.start(dc) # dc is the duty cycle • To change the duty cycle: • p.ChangeDutyCycle(dc) # where 0.0 <= dc <= 100.0 • To stop PWM: • p.stop() GPIO.PWM() http://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/
pwm_led.start(0) while True: for dc in range(0, 101, 5): pwm_led.ChangeDutyCycle(dc) time.sleep(0.1) time.sleep(0.5) for dc in range(100, -1, -5): pwm_led.ChangeDutyCycle(dc) time.sleep(0.1) time.sleep(0.5) 呼吸燈就是漸明漸亮
Entertainment System (RetroArch) • Super Nintendo Entertainment System (PiSNES) • PC / x86 (rpix86) Video Game System Emulators https://en.wikipedia.org/wiki/List_of_video_game_emulators
/home/pi/gpio-game-console/13- gaming_console/gaming_console.py & # Print the IP address _IP=$(hostname -I) || true if [ "$_IP" ]; then printf "My IP address is %s\n" "$_IP" fi exit 0 開機就執行搖桿對應按鍵程式 這是同一行