Skip to content

Instantly share code, notes, and snippets.

View mmattamala's full-sized avatar

Matias Mattamala mmattamala

View GitHub Profile
@mmattamala
mmattamala / Using Generic Blue Pill (STM32F103C8T6).md
Last active April 7, 2025 04:02
Configuring generic Blue Pill STM32 boards in Windows
@mmattamala
mmattamala / receiver_rf.ino
Last active June 10, 2019 20:39
Código para recibir mensajes por RF (Equipo ECorp)
#include <RH_ASK.h>
#include <SPI.h> // Not actualy used but needed to compile
RH_ASK driver;
// Estructura Message
// Deebe ser exactamente igual a la del transmisor
struct Message {
int16_t motorSpeedA;
int16_t motorSpeedB;
@mmattamala
mmattamala / Kalman1D.cpp
Created May 7, 2019 15:11
1D Kalman filter implementation with outlier rejection to be used in Arduino applications. Still needs optimization and some tuning (for process with fast dynamics) but at least works
/* Kalman.cpp
Simple 1-dimensional Kalman filter to process signals in Arduino
Process model: x(t+1) = x(t) + n_process
Observation model: h(x) = z_meas + n_meas
*/
class Kalman1D
{
// Internal variables
// State
@mmattamala
mmattamala / Anet A8 PID Autotune.md
Last active September 13, 2022 20:40
How to run the PID Autotune procedure in the Anet A8 (after fan duct installation)

(This assumes that GCode is sent through Pronterface)

Turn on the fan (max speed):

M106 S255

Run PID autotune with 190°C

M303 E0 S190 C8
@mmattamala
mmattamala / parser.ino
Last active November 9, 2017 21:55
Funciones para parsear mensajes
// Se le llama parser a un método que lee un mensaje y separa los contenidos en cosas ms entendibles
// la funcion parser recibirá un string llamado mensaje con el formato 'xNyMf' (sin comillas)
// donde N es un numero entero asociado a la coordenada x, y M es otro numero entero asociado a la coordenada y
// 'f' es un caracter para indicar el in del mensaje
//
// la función guarda los valores de x e y como floats en las variables x_coord e y_coord
// la función retorna true si el mensaje es valido, false si no es valido
bool parser(String& mensaje, float& coord_x, float& coord_y)
{
@mmattamala
mmattamala / cinematica_inversa.ino
Last active October 26, 2017 00:19
Cinemática inversa de robot SCARA
// Este archivo implementa la cinemática inversa de un brazo robtico SCARA
// En lenguaje Arduino, basado en el codigo de https://appliedgo.net/roboticarm/
// algunos datos:
// largo1: largo de la primera sección del brazo
// largo2: largo de la segunda seccin
// angulo1: angulo del primer de la base
// angulo2: angulo de la articulacion
// largo1 y largo2 son números en centímetros
@mmattamala
mmattamala / ROS_on_EV3.md
Last active July 11, 2017 04:20
ROS installation on the EV3