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 time import sleep | |
| from machine import Pin, PWM | |
| import struct | |
| # Function to calculate the frequency of a musical note based on its MIDI note number | |
| def get_freq(note): | |
| return int(440 * 2 ** ((note - 69) / 12.0)) | |
| # Lists for note offsets and PWM duty values | |
| offset = [0, -24, 0, 0, 0, -12, 12, 24, 36, 0, 0, 0, 0, 0, 0, 0] |
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 network | |
| import uos | |
| import usocket as socket | |
| import ujson as json | |
| import _thread | |
| from time import sleep_ms | |
| ap = network.WLAN(network.AP_IF) | |
| ap.active(True) | |
| ap.config(essid="PicoJMBox") |
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
| #!/usr/bin/python3 | |
| import colorsys | |
| import subprocess | |
| import traceback | |
| import math | |
| import numpy as np | |
| from rpi_ws281x import Color, PixelStrip |
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
| #include <WeELF328P.h> | |
| WeBuzzer buzzer(OnBoard_Buzzer); | |
| void setup(){ | |
| pinMode(2, INPUT); | |
| } |
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
| <html> | |
| <body> | |
| <script type="text/javascript"> | |
| function sier(){ | |
| let z = 0 | |
| for (z = -50; z < 50; z++) { | |
| let zs = z | |
| draw(z) | |
| } |
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
| function g(num) { | |
| var a = []; | |
| for (var i = 1; i < num + 1; i++) { | |
| if (num % i == 0) { | |
| a=a.concat(i); | |
| } | |
| } | |
| return a; | |
| }; |
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
| var system = client.registerSystem(0, 0); | |
| system.initialize = function () { | |
| }; | |
| system.update = function () { | |
| }; |
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
| //For Microsoft Makecode | |
| player.onChat("run", function () { | |
| let xpos = player.position().getValue(Axis.X) | |
| let ypos = player.position().getValue(Axis.Y) | |
| let zpos = player.position().getValue(Axis.Z) | |
| let z = 0 | |
| for (z = -50; z < 50; z++) { | |
| loops.runInBackground(function () { | |
| let zs = z | |
| draw(xpos, ypos, zpos, z) |
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
| package tk.hywt.piano; | |
| import javax.sound.midi.MidiChannel; | |
| import javax.sound.midi.MidiSystem; | |
| import javax.sound.midi.MidiUnavailableException; | |
| import javax.sound.midi.Synthesizer; | |
| import tk.hywt.piano.Notes; | |
| public class Main { | |
| public static void main(String[] args) throws MidiUnavailableException, InterruptedException { |
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
| /summon falling_block ~ ~1 ~ { | |
| Time:10,Tile:1,Passengers:[ | |
| {id:falling_block,Time:10,Tile:137,TileEntityData:{Command:"/say 1"},Passengers:[ | |
| {id:falling_block,Time:10,Tile:152,Passengers:[ | |
| {id:falling_block,Time:10,Tile:137,TileEntityData:{Command:"/say 2"},Passengers:[ | |
| {id:falling_block,Time:10,Tile:152,Passengers:[ | |
| {id:falling_block,Time:10,Tile:137,TileEntityData:{Command:"/say 3"},Passengers:[ | |
| {id:falling_block,Time:10,Tile:152,Passengers:[ | |
| {id:falling_block,Time:10,Tile:137,TileEntityData:{Command:"/say 4"},Passengers:[ | |
| {id:falling_block,Time:10,Tile:152,Passengers:[ |
NewerOlder