Skip to content

Instantly share code, notes, and snippets.

View TamojitSaha's full-sized avatar
💭
tamojitsaha.info

Tamojit Saha TamojitSaha

💭
tamojitsaha.info
  • India
View GitHub Profile
#include "color.h"
#include "utilities.h"
#include <math.h>
/*
* Algorithm adapted from https://gist.github.com/hdznrrd/656996. Uses a little libmath.
* */
void color_HSV2RGB(struct color_ColorHSV const *hsv, struct color_ColorRGB *rgb) {
int i;
@TamojitSaha
TamojitSaha / hcsr04.ino
Created July 3, 2020 19:31 — forked from wolph/hcsr04.ino
Simple arduino HC-SR04 (HCSR04) distance detection using interrupts for low latency measurements
#include <Arduino.h>
// Uses https://github.com/PaulStoffregen/TimerOne for sending on a regular interval
#include <TimerOne.h>
// ECHO pin, needs to be a pin that supports interrupts!
#define ULTRASONIC_PIN_INPUT 2
// TRIG pin, can be any output pin
#define ULTRASONIC_PIN_OUTPUT 3
// update interval, make sure to keep it above 20ms
#define ULTRASONIC_TIMER_US 50000
@TamojitSaha
TamojitSaha / index.html
Created July 16, 2021 07:17 — forked from KentaYamada/index.html
Python Flask + JavaScript XMLHttpRequest
<!DOCTYPE html>
<html>
<head>
<title>Practice AJAX</title>
<script type="text/javascript">
function do_ajax() {
var req = new XMLHttpRequest();
var result = document.getElementById('result');
req.onreadystatechange = function()
{