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
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
/* | |
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
#include?"Wire.h" | |
#define?tcn75address?0x4F?// with pins 5~7 set to GND, the device address is 0x48 | |
void setup() | |
{ | |
??Wire.begin(); // wake up I2C bus | |
??Serial.begin(115200); | |
} | |
float tcn75_getTemperature(int address) |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <math.h> | |
#define CHECKMALLOC(var) if((var) == NULL) {printf("ERROR: malloc\n");abort();} | |
#define MAXOPSTACK 64 | |
#define MAXNUMSTACK 64 |