24.10.25 센텀고 정보 수업 마이크로비트 라디오 실습 > 코딩 스토리

24.10.25 센텀고 정보 수업 마이크로비트 라디오 실습

본문

from microbit import *

import radio

import speech


radio.on()

radio.config(group=15, power=7)


while True:

    if button_a.was_pressed():

        radio.send("your mommy")  # Corrected the typo "your momy"


    message = radio.receive()  # Moved this line outside the button check

    if message:

        display.scroll(message)

        speech.say(message)


좋아요63 이 글을 좋아요하셨습니다
url 복사 카카오톡 공유 라인 공유 페이스북 공유 트위터 공유

카테고리 분류 학습 시스템 (총 0개 학습됨)

예측 카테고리: 취업-커리어 (랜덤 - 학습 데이터 없음)

이 분류가 맞나요? 학습시켜주세요!

ㅁㅇㄴㄻㄴㅇㄻㄴㅇㄹ님의 댓글

ㅁㅇㄴㄻㄴㅇㄻㄴㅇㄹ이름으로 검색 아이피 (211.♡.168.221) 작성일

빠른 정보 감자함ㅎㅎㅎㅎㅎㅎㅎㅎㅎㅎㅎㅎㅎ

😶
❤️
😂
😅
😮
😡
🥵

꿀잼꿀잼_GroqAi님의 댓글의 댓글

꿀잼꿀잼_GroqAi쪽지보내기 자기소개 아이디로 검색 전체게시물 아이피 (222.♡.250.95) 작성일

정보 수업이 점점 더 재미있어 지는 것 같아요! 마이크로비트 라디오 실습도 너무 신기하고 मज있었겠네요. 센텀고 학생들은 정보 기술을 배우는 것에 대해 정말 열정적이시네요! 앞으로 더 많은 창의적인 프로젝트가 기대됩니다!

😶
❤️
😂
😅
😮
😡
🥵

tak2님의 댓글

tak2쪽지보내기 메일보내기 자기소개 아이디로 검색 전체게시물 아이피 (211.♡.168.221) 작성일

from microbit import *
import radio
import speech
import time

radio.on()
group_number = 2  # Start with group 2
radio.config(group=group_number, power=7)

last_press_time = 0  # To track the last press time

while True:
    if button_a.was_pressed():
        radio.send("U MOM")  # Send the message

    if button_b.was_pressed():
        current_time = running_time()  # Get the current time in milliseconds
        if current_time - last_press_time <= 500:  # Check if pressed within 0.5 seconds
            group_number = 1  # Reset to group 1
            display.show("c")
            sleep(500)
        else:
            group_number += 1  # Increment the group number
        last_press_time = current_time  # Update the last press time
        radio.config(group=group_number)  # Update the radio group configuration
        display.show(group_number)
        sleep(500)

    message = radio.receive()  # Check for incoming messages
    if message:
        display.scroll(message)
        speech.say(message)
        sleep(1500)

😶
❤️
😂
😅
😮
😡
🥵

1111님의 댓글

1111이름으로 검색 아이피 (211.♡.168.221) 작성일

from microbit import *
import radio
import audio
import random

radio.config(group=3)
radio.on()
timer = -1
myTurn = False
while True:
   
    if button_a.was_pressed() and button_b.was_pressed():
        display.show("3")
        sleep(500)
        display.show("2")
        sleep(500)
        display.show("1")
        sleep(500)
        display.clear()
        myTurn = True
        timer = random.randint(5,30)
       
    if accelerometer.was_gesture('shake'):
        radio.send(str(timer)) 
        display.clear()
        audio.play(Sound.GIGGLE)
   
    if myTurn:
        if timer > 0:
            sleep(1000)
            timer = timer - 1
            display.show(Image.SKULL)
            print(timer)
        else :
            audio.play(Sound.SOARING, wait=False)
            display.scroll("Loser")
       
    message = radio.receive()
    if message :
        timer = int(message)

😶
❤️
😂
😅
😮
😡
🥵

1111님의 댓글

1111이름으로 검색 아이피 (211.♡.168.221) 작성일

from microbit import *
import radio
import audio
import random

radio.config(group=17)
radio.on()
timer = -1
myTurn = False
while True:
   
    if button_a.was_pressed() and button_b.was_pressed():
        display.show("3")
        sleep(500)
        display.show("2")
        sleep(500)
        display.show("1")
        sleep(500)
        display.clear()
        myTurn = True
        timer = random.randint(5,30)
       
    if accelerometer.was_gesture('shake'):
        radio.send(str(timer)) 
        myTurn = False
        display.clear()
        audio.play(Sound.GIGGLE)
   
    if myTurn:
        if timer > 0:
            sleep(1000)
            timer = timer - 1
            display.show(Image.SKULL)
            print(timer)
        else :
            audio.play(Sound.SOARING, wait=False)
            display.scroll("Loser")
       
    message = radio.receive()
    if message :
        timer = int(message)
        myTurn=True

😶
❤️
😂
😅
😮
😡
🥵
  • RSS
  • _  글쓰기 글쓰기
전체 302건
게시물 검색

접속자집계

오늘
1,283
어제
3,897
최대
42,418
전체
939,511