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
#define dir_pin 13 | |
#define step_pin 12 | |
#define en_pin 17 | |
#define TIMER1_ON TIMSK1 |= (1 << OCIE1A); | |
#define TIMER1_OFF TIMSK1 &= ~(1 << OCIE1A); | |
int OCR_INIT = 10000; | |
int OCR_VAL = OCR_INIT; |
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
volatile unsigned long overflows = 0; | |
void setup() | |
{ | |
Serial.begin(115200); | |
TIMSK1 = _BV(TOIE1); | |
TCCR0A = 0; | |
TCCR0B = 0; | |
} |
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
/* | |
RGB to HSL | |
Compile with: gcc rgb_to_hsl.c -lm -o rgb_to_hsl | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdint.h> |
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
/* | |
HSL to RGB | |
Compile with: gcc hsl_to_rgb.c -lm -o hsl_to_rgb | |
Attributions to: cburn11, https://forum.level1techs.com/u/cburn11 | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> |