Skip to content

Instantly share code, notes, and snippets.

View battlecoder's full-sized avatar

Elias Zacarias battlecoder

View GitHub Profile
@battlecoder
battlecoder / main.c
Last active July 17, 2024 14:00
MAX32650 ADT7420 Temperature sensor demo
/******************************************************************************
* Quick test of the ADT7420 temperature PMOD eval board
******************************************************************************/
/***** Includes *****/
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "i2c.h"
@battlecoder
battlecoder / main.c
Created July 10, 2024 06:29
Quick LCG Test for MAX826550 Power Profiling
/* **** 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
@battlecoder
battlecoder / rand-period-test.c
Last active December 31, 2017 20:48 — forked from unprovable/rand-period-test.c
Random Periodicity Test Code for arduino (compiled in Arduino IDE)
/*
* 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.