전체 글
-
라즈베리파이5 fan 사용카테고리 없음 2024. 1. 6. 21:41
from enum import Enum import time TEMP_PATH = "/sys/devices/virtual/thermal/thermal_zone0/temp" FAN_PATH = "/sys/class/thermal/cooling_device0/cur_state" class FanSpeed(Enum): OFF = 0 LOW = 1 MEDIUM = 2 HIGH = 3 FULL = 4 def main(): while True: temp = get_temp() if temp > 70: speed = FanSpeed.FULL elif temp > 65: speed = FanSpeed.HIGH elif temp > 60: speed = FanSpeed.MEDIUM elif temp > 40: speed..
-
라즈베리파이5 설치, 설정카테고리 없음 2024. 1. 6. 21:30
라즈베리파이5에서 한글 깨짐 sudo apt install fonts-unfonts-core sudo apt install ibus-hangul sudo apt-get remove system-config-printer sudo vi /boot/config.txt === dpkg -l | grep php ===== next 클라우드 설치하기 sudo add-apt-repository ppa:nextcloud-devs/client sudo apt install nextcloud-clien wget wget https://download.nextcloud.com/server/releases/latest.tar.bz2 sudo chmod 750 /var/www/nextcloud/data ==== sudo ap..
-
코스피와 환율 그래프(python3)카테고리 없음 2023. 8. 19. 13:55
chatgpt가 짜준 소스코드 import yfinance as yf import datetime import matplotlib.pyplot as plt start = datetime.datetime(2004, 1, 1) end = datetime.datetime.now() # 현재 날짜로 업데이트 # Fetch KOSPI index data kospi_data = yf.download("^KS11", start=start, end=end) # Fetch exchange rate data (USD/KRW) exchange_rate_data = yf.download("USDKRW=X", start=start, end=end) # Create a figure and a grid of subplots wit..
-
라즈베리파이 피코 w + bme680카테고리 없음 2023. 7. 30. 12:56
thonny 프로그램의 lib 디렉토리에 bme680.py를 저장합니다. # Spaces, comments and some functions have been removed from the original file to save memory # Original source: https://github.com/adafruit/Adafruit_CircuitPython_BME680/blob/master/adafruit_bme680.py import time import math from micropython import const from ubinascii import hexlify as hex try: import struct except ImportError: import ustruct as struct ..
-
라즈베리파이 피코카테고리 없음 2023. 7. 29. 11:29
rp2-pico-w-20230426-v1.20.0.uf2 이 파일을 잘못 받아서, 하루 시간 날려버렸네요.. 라즈베리파이 피코 wifi 버전을 잘 확인하고 설치하세요. import machine import time led = machine.Pin('LED', machine.Pin.OUT) while (True): led.on() time.sleep(1) led.off() time.sleep(1) led.off() from network import WLAN, STA_IF from time import sleep from machine import Pin from dht import DHT22 import socket led = machine.Pin('LED', machine.Pin.OUT) pin3 =..
-
BME680 온도,습도,압력,대기질센서카테고리 없음 2023. 7. 23. 14:23
curl https://get.pimoroni.com/bme680 | bash git clone https://github.com/pimoroni/bme680-python GitHub - pimoroni/bme680-python: Python library for the BME680 gas, temperature, humidity and pressure sensor. Python library for the BME680 gas, temperature, humidity and pressure sensor. - GitHub - pimoroni/bme680-python: Python library for the BME680 gas, temperature, humidity and pressure sensor. ..