This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from machine import Pin | |
| import time | |
| # グローバル変数を定義(割り込みフラグ) | |
| touch_detected = False | |
| # 割り込みハンドラ関数 | |
| def touch_handler(pin): | |
| global touch_detected | |
| print("タッチを検知") # 直接ここで反応を表示 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from machine import Pin | |
| import time | |
| # 静電容量タッチセンサーを接続しているピンを設定 | |
| touch_sensor = Pin(28, Pin.IN) | |
| while True: | |
| # タッチセンサーの値を読み取り、タッチされているか確認 | |
| if touch_sensor.value() == 1: | |
| # タッチセンサーがタッチされている場合 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from machine import Pin, I2C | |
| from ssd1306 import SSD1306_I2C | |
| import time | |
| import random | |
| import math | |
| # OLEDディスプレイのサイズ設定 | |
| width = 128 | |
| height = 64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from machine import Pin, I2C | |
| from ssd1306 import SSD1306_I2C | |
| # I2C設定 | |
| i2c = I2C(0, scl=Pin(1), sda=Pin(0)) | |
| # OLEDディスプレイの初期化 | |
| oled = SSD1306_I2C(128, 64, i2c) | |
| # 画面をクリア |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from machine import Pin | |
| import socket | |
| import network | |
| import time | |
| import rp2 | |
| #無線LANへの接続 | |
| def connect_to_wifi(ssid, password): | |
| wlan = network.WLAN(network.STA_IF) | |
| wlan.active(True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from machine import Pin | |
| import network | |
| import time | |
| import socket | |
| #無線LANへの接続 | |
| def connect_to_wifi(ssid, password): | |
| wlan = network.WLAN(network.STA_IF) | |
| wlan.active(True) | |
| wlan.connect(ssid, password) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from machine import Pin | |
| import time | |
| import network | |
| import BlynkLib | |
| #無線LANへの接続 | |
| def connect_to_wifi(ssid, password): | |
| wlan = network.WLAN(network.STA_IF) | |
| wlan.active(True) | |
| wlan.connect(ssid, password) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) 2015-2019 Volodymyr Shymanskyy. See the file LICENSE for copying permission. | |
| __version__ = "1.0.0" | |
| import struct | |
| import time | |
| import sys | |
| import os | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import network | |
| import ntptime | |
| #Wi-Fiへの接続 | |
| def connect_to_wifi(ssid, password): | |
| wlan = network.WLAN(network.STA_IF) | |
| wlan.active(True) | |
| wlan.connect(ssid, password) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import network | |
| import ntptime | |
| def connect_to_wifi(ssid, password): | |
| wlan = network.WLAN(network.STA_IF) | |
| wlan.active(True) | |
| wlan.connect(ssid, password) | |
| max_wait = 10 |
NewerOlder