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
/* | |
* Test sketch based on rand-period-test.c by @unprovable | |
* His sketch shown an anomaly with Arduino's PRNG, in which the LCG period seems to be unreliable. | |
* Also the function seems to be quite slow; iterating over the stream until we get back to the beginning | |
* takes 199340888ms (55.3724689 hours). It takes 1.5 minutes (approx) to generate 1M numbers. | |
* So I decided to repeat the test with a textbook implementation of a standard LCG to see if we can get a | |
* reliable generator with a stable period (and hopefully faster runtime) under the same conditions. |
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
/* **** Includes **** */ | |
#include "max32650.h" | |
#include "lp.h" | |
#include "mxc_errors.h" | |
#include "mxc_sys.h" | |
#include "led.h" | |
#include "pt.h" | |
/* **** Definitions **** */ | |
// Uncomment to run with slower clock | |
//#define SLOW_SPEED |
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
/****************************************************************************** | |
* Quick test of the ADT7420 temperature PMOD eval board | |
******************************************************************************/ | |
/***** Includes *****/ | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include "i2c.h" |