This file contains 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
# Write your code here :-) | |
# core: circuitPython-8.2.9 | |
# dependency: adafruit-circuitpython-bundle-8.x-mpy-20231224 | |
# __ | |
# GP0--| |--VBUS | |
# GP1 VSYS | |
# GND GND | |
# Z |---/ --GP2 3V3EN | |
# X |---/ --GP3 3V3OUT | |
# ENTER |---/ --GP4 VREF |
This file contains 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
int latchPin = 4; // Latch pin (STCP腳位) | |
int clockPin = 5; // Clock pin (SHCP腳位) | |
int dataPin = 6; // Data pin (DS腳位) | |
int blankPin = 7; | |
void setup() | |
{ | |
Serial.begin(115200); | |
// Set all the pins of 74HC595 as OUTPUT | |
pinMode(latchPin, OUTPUT); |
This file contains 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
int latchPin = 6; // Latch pin (STCP腳位) | |
int clockPin = 5; // Clock pin (SHCP腳位) | |
int dataPin = 7; // Data pin (DS腳位) | |
int blankPin = 4; | |
void setup() | |
{ | |
digitalWrite(latchPin, LOW); // 送資料前要先把 latchPin 設成低電位 | |
shiftOut(dataPin, clockPin, MSBFIRST, 0); // | |
shiftOut(dataPin, clockPin, MSBFIRST, 0); // |
This file contains 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
// Santi&be Youtube | |
// https://www.youtube.com/watch?v=I-HbdRWwMVY | |
#include <WiFi.h> | |
#include "esp_camera.h" | |
#include "esp_system.h" | |
hw_timer_t *timer = NULL; | |
void IRAM_ATTR resetModule(){ | |
ets_printf("reboot\n"); |
This file contains 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
#河內塔演算並帶結果展示 | |
#步驟計數器 | |
steps=1 | |
#產生演算法並顯示過程 | |
def hanoi(n, a, b, c): | |
global steps | |
global poles | |
if n == 1: | |
print("第%d步: 盤由柱 %c 移至柱 %c" % (steps,a,c)) | |
steps+=1 |
This file contains 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
# GPIOkbd.py | |
# written by Roger Woollett | |
# This is a python equivalent to the Adafruit Retrogame program. | |
# It translates GPIO button presses into keyboard presses. | |
# It assumes that buttons will gound their GPIO when pressed. | |
# All testing has been done using python3 | |
# This program must have root priviledge. This is fine if run from rc.local | |
# but if you are testing use sudo python3 GPIOkbd.py |
This file contains 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
# GPIOkbd.py | |
# written by Roger Woollett | |
# modify by pondahai 2019.10.3 | |
# This is a python equivalent to the Adafruit Retrogame program. | |
# It translates GPIO button presses into keyboard presses. | |
# It assumes that buttons will gound their GPIO when pressed. | |
# All testing has been done using python3 | |
# This program must have root priviledge. This is fine if run from rc.local |
This file contains 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) 2019 Shajeeb TM | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all |
This file contains 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 microbit import * | |
from neopixel import NeoPixel | |
import music | |
import random | |
num_pixels = 50 | |
foreground = [0xff, 0x00, 0x00] # Hex color - red, green and blue | |
background = [0x10, 0x10, 0x10] | |
red = 0xf0 | |
green = 0x00 |
This file contains 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
/*global self, document, DOMException */ | |
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */ | |
// Full polyfill for browsers with no classList support | |
if (!("classList" in document.createElement("_"))) { | |
(function (view) { | |
"use strict"; |
NewerOlder