Skip to content

Instantly share code, notes, and snippets.

@idreamsi
idreamsi / ESP8266-SoftAP-WebServer.ino
Created February 7, 2019 07:46
ESP8266 example: Wi-Fi Access point, static IP, web-server and remote GPIO control
/* Create a WiFi access point and provide a web server on it. */
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
IPAddress apIP(42, 42, 42, 42); // Defining a static IP address: local & gateway
// Default IP in AP mode is 192.168.4.1
/* This are the WiFi access point settings. Update them to your likin */
const char *ssid = "ESP8266";
@chrisengelsma
chrisengelsma / PolynomialRegression.h
Last active February 28, 2024 14:07
Polynomial Regression (Quadratic Fit) in C++
#ifndef _POLYNOMIAL_REGRESSION_H
#define _POLYNOMIAL_REGRESSION_H __POLYNOMIAL_REGRESSION_H
/**
* PURPOSE:
*
* Polynomial Regression aims to fit a non-linear relationship to a set of
* points. It approximates this by solving a series of linear equations using
* a least-squares approach.
*
* We can model the expected value y as an nth degree polynomial, yielding