Advertisement
cmass

모스 부호 통신기(수신기) UP

Nov 19th, 2019
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. from microbit import *      # 마이크로비트 모듈의 모든 명령 사용
  2. import radio                # 라디오 모듈 사용
  3. radio.on()                  # 라디오 기능 활성화
  4.  
  5.     r = radio.receive()                               # 여기서 부터는 수신 기능 코드
  6.  
  7.     if r == 'dot':
  8.         display.show(Image('00000:00000:00900:00000:00000'))    # 디스플레이에 도트(•) 출력
  9.         sleep(500)
  10.         display.clear()
  11.         sleep(300)
  12.     elif r == 'dash':
  13.         display.show(Image('00000:00000:99999:00000:00000'))    # 디스플레이에 "대시(-)" 출력
  14.         sleep(500)
  15.         display.clear()
  16.         sleep(300)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement