Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <SoftwareSerial.h>
// Serial.print() outputs to the USB-UART (i.e. eventually to the PC).
//
uint8_t PIN_ORANGE_LED = PD7;
uint8_t PIN_BUZZER = PD6;
uint8_t PIN_SOFT_UART_RX = PD4;
const uint8_t BUFFER_SIZE = 16;
require 'RubyROOT'
require 'colorable'
DEFAULT_CANVAS_WIDTH = 600
DEFAULT_CANVAS_HEIGHT = 600
DEFAULT_FONT = 43 # Helvetica
DEFAULT_FONT_SIZE = 16
DEFAULT_FONT_SIZE_TITLE = 18
Root.gROOT.SetStyle('Plain')
@yuasatakayuki
yuasatakayuki / Dockerfile
Created June 30, 2017 13:02
Example Dockerfile that builds RubyFits on Scientific Linux 6
FROM cern/slc6-base
# Instll prerequisites - yum
RUN yum install -y wget zlib zlib-devel bzip2 bzip2-devel readline-devel git cmake tar gzip
RUN yum groupinstall -y "Development Tools"
RUN wget https://gist.githubusercontent.com/mustafaturan/8290150/raw/a85c6194f36d7b08b7b97bdf676fa5f945815b70/ruby.2.4.0-setup.sh; \
bash ruby.2.4.0-setup.sh
RUN wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/Openwsman/CentOS_CentOS-6/x86_64/swig-3.0.2-5.1.x86_64.rpm; \
@yuasatakayuki
yuasatakayuki / nucleo_l432kc_accelerometer_buzzer.cpp
Last active June 4, 2017 13:18
NUCLEO-L432KC accelerometer example
#include "mbed.h"
#include "LIS3DH.h"
#include <math.h>
#define USE_LED
#define USE_SERIAL
#ifdef USE_SERIAL
Serial pc(SERIAL_TX, SERIAL_RX);
#endif
@yuasatakayuki
yuasatakayuki / Dockerfile
Created April 22, 2017 01:23
RubyFits on Scientific Linux
FROM cern/slc6-base
# Instll prerequisites - yum
RUN yum install -y wget zlib zlib-devel bzip2 bzip2-devel readline-devel git cmake tar gzip
RUN yum groupinstall -y "Development Tools"
RUN wget https://gist.githubusercontent.com/mustafaturan/8290150/raw/a85c6194f36d7b08b7b97bdf676fa5f945815b70/ruby.2.4.0-setup.sh; \
bash ruby.2.4.0-setup.sh
RUN wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/Openwsman/CentOS_CentOS-6/x86_64/swig-3.0.2-5.1.x86_64.rpm; \
@yuasatakayuki
yuasatakayuki / esp01_oled_bme280.cpp
Created January 1, 2017 13:17
Arduino sketch for ESP-01 + OLED + BME280
#include <stdio.h>
#include <Wire.h>
#include <ESP8266WiFi.h>
#include <BME280.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// WiFi configuration
const char* ssid = "WIFI_SSID";
const char* password = "WIFIT_PASSWORD";
@yuasatakayuki
yuasatakayuki / Makefile
Created September 9, 2016 14:54
SpaceWire-RMAP CRC calculation example
all: crc_example
crc_example: crc_example.cc
clang++ -std=c++11 -stdlib=libc++ $^ -o $@
@yuasatakayuki
yuasatakayuki / ruby_gnuplot_time_series.rb
Last active October 6, 2021 14:50
Plot time-series data using Ruby Gnuplot
require "gnuplot"
data=<<EOS
2016-07-19T23:47:53.432Z 33.2
2016-07-19T23:41:59.558Z 33.1
2016-07-19T23:36:06.183Z 32.9
2016-07-19T23:30:09.101Z 32.7
2016-07-19T23:24:15.936Z 32.6
2016-07-19T23:18:19.082Z 32.4
2016-07-19T23:12:20.944Z 32.4
@yuasatakayuki
yuasatakayuki / fft_sample.ipynb
Created July 14, 2016 12:52
Numpy FFT sample (4-bit digitized sin function)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.