Skip to content

Instantly share code, notes, and snippets.

View main.py
import segment
import time
import utime
import machine
import math
sensor_temp = machine.ADC(4)
conversion_factor = 3.3/(65535)
View pitches.h
/*************************************************
* 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
View main.py
import segment
import time
j = 0
while True:
print(j)
segment.C(j)
time.sleep(1)
segment.Coff()
time.sleep(1)
View main.py
import segment
import time
j = 0
while True:
print(j)
segment.A(j)
time.sleep(1)
segment.Aoff()
time.sleep(1)
View segment.py
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)
View AD9833_ver1.ino
#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;
View LED_blink_by_ArtyS7.v
View matplolib_realtime_gui.py
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
View matplolib_realtime_ui.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'matplo_realtime.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
View matplo_gui.py
import sys
from PyQt5 import QtWidgets
from matplo_ui import Ui_Form
#below import libraries about matplotlib runing on pyqt5
import matplotlib
#Make sure that we are using QT5
matplotlib.use('Qt5Agg')
from PyQt5 import QtCore, QtWidgets
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas