Skip to content

Instantly share code, notes, and snippets.

View JensGrabner's full-sized avatar
💭
in progress

Jens Grabner JensGrabner

💭
in progress
View GitHub Profile
@Keeo
Keeo / yamaha-ras13
Last active April 16, 2025 05:43
Yamaha IR Codes
#
# Yamaha IR codes from RAS13 ZN04290, used for Yamaha A-S301.
# If you find standalone on an off codes please let me know.
# https://www.sbprojects.net/knowledge/ir/nec.php
#
CD on/off
Protocol : NEC
Code : 0x9E6106F9 (32 Bits)
uint16_t rawData[71] = {9012, 4418, 618, 1618, 612, 504, 612, 496, 618, 1614, 616, 1614, 618, 1612, 618, 1614, 616, 496, 612, 504, 612, 1618, 612, 1614, 616, 504, 612, 496, 618, 500, 612, 514, 612, 1608, 618, 500, 612, 500, 612, 504, 612, 500, 612, 500, 616, 1614, 616, 1614, 616, 500, 616, 1614, 618, 1610, 616, 1612, 618, 1612, 618, 1612, 618, 500, 618, 496, 616, 1614, 618, 40206, 8780, 2186, 618}; // NEC 9E6106F9
#include <LiquidCrystal.h>
#include <Keypad.h>
LiquidCrystal lcd(0, 1, 2, 3, 4, 5);
const byte ROWS = 4;
const byte COLS = 4;
char keys [ROWS] [COLS] = {
{'7', '8', '9', '/'},
{'4', '5', '6', '*'},
@foobaz
foobaz / sqrt.c
Last active September 1, 2024 07:25
Integer square root algorithm
/*
Just like integer division, these functions round down to an integer.
Running this program should produce the following output:
sqrt(3735928559) == 61122
61122^2 == 3735898884
sqrt(244837814094590) == 15647294
15647294^2 == 244837809522436
This algorithm comes from Jack W. Crenshaw's 1998 article in Embedded:
@sklaw
sklaw / How to use this class?
Last active January 27, 2024 07:25
C++ Rational Number Class
You can use this class in the same way you use "int".
The following operators are available:
+ - * /
++ --
+= -= *= /=
< > <= >= == !=
<< >>
For example:
RationalNum a, b;
@2N2222A
2N2222A / MCP3421_test.pde
Created October 17, 2012 05:24
Arduino voltmeter using an MCP3421 18 bit ∆-∑ ADC
/*
This revision includes the modified display output to the LCD
mcp adress = 0x68
sr= Sample Rate Selection
sr=0 ; 00 = 240 SPS (12 bits),
sr=1 ; 01 = 60 SPS (14 bits),
sr=2 ; 10 = 15 SPS (16 bits),
@rubik
rubik / a_cfrac.py
Created December 10, 2011 10:32
Creating a simple continued fraction from a square root
import math
def from_root(n):
'''
Construct a continued fraction from a square root. The argument
`n` should be an integer representing the radicand of the root:
>>> from_root(2)
(1, [2])