Skip to content

Instantly share code, notes, and snippets.

View munron's full-sized avatar
👨‍💻
Build Your Dreams

munron munron

👨‍💻
Build Your Dreams
View GitHub Profile
@munron
munron / tdw
Created October 21, 2016 17:11
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_HMC5883_U.h>
/* Assign a unique ID to this sensor at the same time */
Adafruit_HMC5883_Unified mag = Adafruit_HMC5883_Unified(12345);
int a0;
int a1;
int lastA0=0;
int lastA1=0;
@munron
munron / tdw
Last active October 24, 2016 15:21
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_HMC5883_U.h>
/* Assign a unique ID to this sensor at the same time */
Adafruit_HMC5883_Unified mag = Adafruit_HMC5883_Unified(12345);
int a0;
int a1;
int lastA0=0;
int lastA1=0;
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 27 May 2015
###########################################################################
# Copyright (c) 2015 iRobot Corporation
# http://www.irobot.com/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@munron
munron / task.cs
Created September 6, 2016 05:18
C# Task 入門 3
using System;
using System.Threading.Tasks;
using System.Threading;
namespace ConsoleApplication12
{
class Program
{
//Mainメソッドにasyncは適用できない(エラーになる)
@munron
munron / task.cs
Created September 6, 2016 05:03
C# Task 入門 2 async await
using System;
using System.Threading.Tasks;
using System.Threading;
namespace ConsoleApplication13
{
class Program
{
static void Main()
{
@munron
munron / task.cs
Created September 6, 2016 03:03
C# Task入門 1
using System;
using System.Threading.Tasks;
using System.Threading;
//C# Task 入門
namespace ConsoleApplication11
{
class Program
{
@munron
munron / delegate.cs
Created September 6, 2016 02:01
C# デリゲート入門 4
using System;
//デリゲートとラムダ式の応用例
namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
//第二引数にラムダ式による匿名関数を渡すことで簡潔に条件を記述できる
//この場合第一引数配列内の7以下の数字の総和を返す
@munron
munron / delegate.cs
Created September 6, 2016 01:47
C# デリゲート入門 3
using System;
//デリゲートを使った同期、非同期処理のサンプルコード
namespace ConsoleApplication9
{
delegate double AsyncSum(double n);
class Program
{
static void Main(string[] args)
{
AsyncSum asyncSum = sum;
@munron
munron / delegate.cs
Created September 6, 2016 01:15
C#デリゲート入門 2
using System;
//デリゲートを理解するためのサンプルプログラム
namespace ConsoleApplication8
{
//デリゲート型の宣言
delegate void ShowMessage();
delegate int Caluculate(int a,int b);
class Program
{
@munron
munron / delegate.cs
Last active September 6, 2016 03:02
C#のデリゲートを理解する Func<T,returnT> Action<T>
using System;
//デリゲートを理解するためのサンプルプログラム
namespace ConsoleApplication7
{
class Program
{
static void Main(string[] args)
{
//デリゲート