# data[].attributes.body
파일이름참고해서 저장,제출->기후변화_심화_계성고_(이름OOO)

# data[].attributes.attachment_link.title
넷제로 앱 나만의 아이디어로 업그레이드하기

# data[].attributes.attachment_link.readable_text
import dht11 #온습도센서
import i2c_lcd #lcd센서
import music

dh = dht11.create(5) #온습도센서 장치연결설정
lcd = i2c_lcd.create(1,10) #lcd센서 장치연결설정
music.open(12)
myservo = ServoPin(6)
motorA = ServoPin(19)
motorB = ServoPin(20)
air = AnalogPin(14) #공기질센서

lcd.light_on()

def song():
    music.tone(587)
    delay(0.3)
    music.tone(440)
    delay(0.3)
    music.mute()
    

while True:
    dh.measure()
    h = dh.humidity()
    t = dh.temperature()
    hic = dh.compute_heat_index(t,h)
    di = int(0.81 * t + 0.01 * h * (0.99 * t - 14.3)+46.3)
    air_value = air.read() #공기질센서값 읽기기
    
    if t > 30:
        song()
        
    if di > 80 or air_value > 2000 :
        myservo.angle(90)
        motorA.duty(100)
        motorB.duty(0)
        lcd.clear()
        lcd.move(0,0)
        lcd.write("ventilation")
        lcd.move(0,1)
        lcd.write(f'DI:{di} ,air : {air_value}')
        delay(2)
        
    else:
        music.mute()
        motorA.duty(0)
        myservo.angle(0)
        
        
    
    print(f'Temp : {t} C, Humi : {h} % , HeatIndex : {hic}, DI : {di},air : {air_value}')
    
    lcd.light_on()
    lcd.clear()
    lcd.move(0, 0)
    lcd.write(f'T:{t}C, HI : {hic}')
    lcd.move(0, 1)
    lcd.write(f'H:{h}% , DI : {di} ')
    delay(1)

# data[].attributes.attachment_link.readable_text
from asomeneopixel import NEO
import i2c_lcd
import dht11
import music

dh = dht11.create(5)
lcd = i2c_lcd.create(1, 10)
music.open(12)
myservo = ServoPin(6)
motorA = ServoPin(19)
motorB = ServoPin(20)
air = AnalogPin(14) #ê³µê¸°ì§ì¼ì
NEO.ready(4,8)
light = AnalogPin(1)
ir = AnalogPin(2)

lcd.light_on()

def white():
    for i in range(8):
        NEo.color(i,10,10,10)
        NEO.write()
        delay(0.5)

def song():
    music.tone(587)
    delay(0.3)
    music.tone(440)
    delay(0.3)
    music.mute()
    

while True:
    dh.measure()
    h = dh.humidity()
    t = dh.temperature()
    hic = dh.compute_heat_index(t,h) #ì²´ê°ì¨ë
    
    #ë¶ì¾ì§ì êµ¬íê¸°
    di = int(0.81 * t + 0.01 * h * (0.99 * t - 14.3) + 46.3)
    air_value = air.read() #ê³µê¸°ì§ì¼ìê° ì½ê¸°ê¸°
    li_value = light.read()
    ir_value = ir.read()
    
    
    if li_value > 3000 or ir_value < 100:
        white()
    else : 
        NEO.clear()
        NEO.write()
        
        
    # if t > 30:
    #     song()
    
    
    if di > 80 or air_value > 2000:
        myservo.angle(90)
        motorA.duty(100)
        motorB.duty(0)
        lcd.clear()
        lcd.move(0, 0)
        lcd.write("ventilation")
        lcd.move(0, 1)
        lcd.write(f' DI : {di}, air : {air_value}')
        delay(2)
        
    else:
        music.mute()
        motorA.duty(0)
        myservo.angle(0)
        
    
    print (f'Temp : {t} C, Humi : {h} %, HeatIndex : {hic}, DI : {di}, air : {air_value}')
    lcd.light_on()
    lcd.clear()
    lcd.move(0, 0)
    lcd.write(f'T: {t} C, HI: {hic}')
    lcd.move(0, 1)
    lcd.write(f'H: {hic} %, DI: {di}')


    delay(1)

# data[].attributes.attachment_link.title
탄소배출절감하우스 전체코드

# data[].attributes.headline
온습도,부져,lcd센서 완성코드

# data[].attributes.subject
온습도,부져,lcd센서 완성코드

# data[].attributes.attachment_link.readable_text
import i2c_lcd
import dht11
import music

dh = dht11.create(5)
lcd = i2c_lcd.create(1, 10)
music.open(12)

lcd.light_on()

def song():
    music.tone(587)
    delay(0.3)
    music.tone(440)
    delay(0.3)
    music.mute()
    

while True:
    dh.measure()
    h = dh.humidity()
    t = dh.temperature()
    hic = dh.compute_heat_index(t,h) #ì²´ê°ì¨ë
    
    #ë¶ì¾ì§ì êµ¬íê¸°
    di = int(0.81* 0.01 + h * (0.99*t - 14.3) + 46.3)
    
    if t > 30:
        song()
    else:
        music.mute()
    
    print(f'Temp : {t} C, Humi : {h} %, HeatIndex : {hic}')
    lcd.light_on()
    lcd.clear()
    lcd.move(0, 0)
    lcd.write(f'T: {t} C, HI: {hic}')
    lcd.move(0, 1)
    lcd.write(f'H: {h} %')
    
    delay(1)

# data[].attributes.headline
네오픽셀,적외선,조도센서 완성코드

# data[].attributes.subject
네오픽셀,적외선,조도센서 완성코드

# data[].attributes.attachment_link.readable_text
import i2c_lcd
import dht11
import music

dh = dht11.create(5)
lcd = i2c_lcd.create(1, 10)
music.open(12)

lcd.light_on()

def song():
    music.tone(587)
    delay(0.3)
    music.tone(440)
    delay(0.3)
    music.mute()
    

while True:
    dh.measure()
    h = dh.humidity()
    t = dh.temperature()
    hic = dh.compute_heat_index(t,h) #ì²´ê°ì¨ë
    
    #ë¶ì¾ì§ì êµ¬íê¸°
    di = int(0.81* 0.01 + h * (0.99*t - 14.3) + 46.3)
    
    if t > 30:
        song()
    else:
        music.mute()
    
    print(f'Temp : {t} C, Humi : {h} %, HeatIndex : {hic}')
    lcd.light_on()
    lcd.clear()
    lcd.move(0, 0)
    lcd.write(f'T: {t} C, HI: {hic}')
    lcd.move(0, 1)
    lcd.write(f'H: {h} %')
    
    delay(1)

# data[].attributes.headline
아두이노 호환보드ch340드라이버설치파일

# data[].attributes.subject
아두이노 호환보드ch340드라이버설치파일

# data[].attributes.headline
m블록프로그램 설치하기

# data[].attributes.subject
m블록프로그램 설치하기

# data[].attributes.attachment_link.description
Download and use mBlock across different devices. Supports Windows, Mac, Linux, Chromebook, iOS ,and Android.