Skip to content

Instantly share code, notes, and snippets.

//------------------------------------------------------------------------------
// Include the IRremote library header
//
#include <IRremote.h>
//------------------------------------------------------------------------------
// Tell IRremote which Arduino pin is connected to the IR Receiver (TSOP4838)
//
int recvPin = 11;
IRrecv irrecv(recvPin);
@baobao
baobao / PIRSensor.ino
Last active August 10, 2019 18:55
PIRセンサが反応したらLEDが光るArduinoサンプル
#define LED_OUTPUT 7
#define PIR_IN 2
void setup()
{
Serial.begin(9600);
pinMode(PIR_IN, INPUT);
pinMode(LED_OUTPUT, OUTPUT);
}
// デジタル7番ピン
int sensorPin = 7;
void setup()
{
Serial.begin(9600);
}
void loop()
{
using System.IO;
using System.Linq;
using UnityEngine;
using UnityEditor;
/// <summary>
/// SpriteRendererのSpriteがnullだったら背景を赤くするEditor拡張
/// </summary>
public class SpriteMissingChecker
{
@baobao
baobao / Helloworld.cs
Created July 31, 2019 09:57
UIElementの生成時の初期コード at Unity2019.1.9f1
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEditor.UIElements;
public class Helloworld : EditorWindow
{
[MenuItem("Window/UIElements/Helloworld")]
public static void ShowExample()
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "homebrew/dupes"
tap "homebrew/php"
tap "homebrew/versions"
brew "ansible"
brew "apr"
@baobao
baobao / cleaninstall_boot.sh
Created July 25, 2019 14:31
Macのクリーンインストール後に実行するシェル
# HomeBrew install
echo "brew install"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Setup MacScreenshot"
# ドロップシャドウ削除
defaults write com.apple.screencapture disable-shadow -boolean true
# 保存先変更
defaults write com.apple.screencapture location ~/Desktop/ScreenCaptures/;
killall SystemUIServer
using System;
using Unity.Entities;
[Serializable]
public struct MyData : IComponentData
{
public float hoge;
}
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define LED_NUM 50 //LEDの数
Adafruit_NeoPixel ledtape = Adafruit_NeoPixel(LED_NUM, PIN, NEO_GRB + NEO_KHZ800);
void setup()
{
ledtape.begin();
@baobao
baobao / ESP8266WiFi.ino
Created April 24, 2019 15:35
ESP8266WiFi接続ショートコード
#include <ESP8266WiFi.h>
const char* ssid = "";
const char* password = "";
WiFiServer server(80);
WiFiClient client;
void setup()
{