Skip to content

Instantly share code, notes, and snippets.

View lean8086's full-sized avatar

Leandro Linares lean8086

View GitHub Profile
#include "MIDIUSB.h"
const byte TOTAL_BUTTONS = 16;
// All the Arduino pins used for buttons, in order.
const byte BUTTONS_PIN[TOTAL_BUTTONS] = {2,3,4,5,6,7,8,9,10,11,12,A0,A1,A2,A3,A4};
// Every pitch corresponding to every Arduino pin. Each note has an associated numeric pitch (frequency scale).
// See https://github.com/arduino/tutorials/blob/master/ArduinoZeroMidi/PitchToNote.h
const byte BUTTONS_PITCH[TOTAL_BUTTONS] = {36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
// Current state of the pressed buttons.
byte currentRead[TOTAL_BUTTONS];
// Channel can be a number from 0 to 15. Typically displayed as 1 to 16.
byte channel = 0;
// ...
void setup() {
// ...
pinMode(18, INPUT_PULLUP);
pinMode(19, INPUT_PULLUP);
}
#include "FastLED.h"
#define BTN_PIN 3
#define LED_PIN A3
#define LED_TYPE WS2812B
#define LED_COLOR 0x7aff0b
#define TOTAL_LEDS 110
#define BRIGHTNESS 123 /* 0 to 255 */
#define LOWEST_BRIGHTNESS 5 /* 0 to 255 */
#include "FastLED.h"
#define LED_PIN A3
#define TOTAL_LEDS 110
#define BRIGHTNESS 123
#define LED_TYPE WS2812B
#define CHUNK_SIZE_MS 300000 // 5 minute chunks (1 sentence per chunk)
#define CHECK_EVERY_MS 3000 // Check every 3 seconds
#define HOUR_MAX_LEN 6 // Maximum amount of letters an hour can have
#define SENTENCE_MAX_LEN 24 // Maximum amount of letters a sentence can have
@lean8086
lean8086 / servo-rotation.py
Last active June 12, 2022 11:36
Hello world for servo motors on a Pico with MicroPython
from machine import Pin,PWM
import utime
MID = 1500000
MIN = 1000000
MAX = 2000000
led = Pin(25,Pin.OUT)
pwm = PWM(Pin(15))
<button aria-haspopup="true" aria-controls="modal-content" id="modal-trigger">Open modal window</button>
<section role="dialog" aria-hidden="true" id="modal-content">Content inside modal window</section>
<!-- DON'T -->
<div role="button" tabindex="0">X</div>
<!-- DO -->
<button>Close</button>
<button id="modal-trigger">Open modal window</button>
<section id="modal-content">Content inside modal window</section>
#include "MIDIUSB.h"
const byte TOTAL_BUTTONS = 16;
const byte BUTTONS_PIN[TOTAL_BUTTONS] = {2,3,4,5,6,7,8,9,10,11,12,A0,A1,A2,A3,A4};
const byte BUTTONS_PITCH[TOTAL_BUTTONS] = {36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
byte channel = 0; // 16 channels (0-15) Reported to the user as 1-16
void setup() {
for (byte i = 0; i < TOTAL_BUTTONS; i++) {
pinMode(BUTTONS_PIN[i], INPUT_PULLUP);
<article itemscope itemtype="https://schema.org/Product">
<h3 itemprop="name">Bose QuietComfort 35 II</h3>
<p itemprop="offers">$217.99</p>
<a href="...">See all options</a>
<img itemprop="image" src="..." alt="...">
</article>