Skip to content

Instantly share code, notes, and snippets.

from linebot import LineBotApi
from linebot.models import TextSendMessage
from linebot.exceptions import LineBotApiError
import search
bot_api = '******'
user_id = '******'
import requests
from bs4 import BeautifulSoup
class switch_s:
def __init__(self):
global soup
url = "https://www.switch-science.com/products/8522"
r = requests.get(url)
soup = BeautifulSoup(r.content,"html.parser")
import segment
import time
import utime
import machine
import math
sensor_temp = machine.ADC(4)
conversion_factor = 3.3/(65535)
/*************************************************
* Public Constants
*************************************************/
#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
import segment
import time
j = 0
while True:
print(j)
segment.C(j)
time.sleep(1)
segment.Coff()
time.sleep(1)
@ugeugeHigh
ugeugeHigh / main.py
Last active February 13, 2022 03:38
import segment
import time
j = 0
while True:
print(j)
segment.A(j)
time.sleep(1)
segment.Aoff()
time.sleep(1)
from machine import Pin
#Cathode common segment pin set up
led1 = Pin(0, Pin.OUT)
led2 = Pin(1,Pin.OUT)
led4 = Pin(2,Pin.OUT)
led6 = Pin(3,Pin.OUT)
led7 = Pin(4,Pin.OUT)
led9 = Pin(5,Pin.OUT)
led10 = Pin(6,Pin.OUT)
#include <SPI.h>
const int SINE = 0x2000;
const int SQUARE = 0x2028;
const int TRAIANGLE = 0x2002;
const float refFreq = 25000000.0;
const int FSYNC = 10;
const int SWpin = 4;
int waveType = TRAIANGLE;
import sys
from PyQt5 import QtWidgets
#matplo_realtime_ui.pyの読み込み
from matplo_realtime_ui import Ui_Form
#以下7~12はpyqt上でmatlaboを動かすのに必要なライブラリ
import matplotlib
matplotlib.use('Qt5Agg')
from PyQt5 import QtCore, QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas