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
# | |
# 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 |
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
#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', '*'}, |
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
/* | |
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: |
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
You can use this class in the same way you use "int". | |
The following operators are available: | |
+ - * / | |
++ -- | |
+= -= *= /= | |
< > <= >= == != | |
<< >> | |
For example: | |
RationalNum a, b; |
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
/* | |
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), |
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
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]) |