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
#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; |
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
#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; |
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
#!/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 |
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
using System; | |
using System.Threading.Tasks; | |
using System.Threading; | |
namespace ConsoleApplication12 | |
{ | |
class Program | |
{ | |
//Mainメソッドにasyncは適用できない(エラーになる) |
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
using System; | |
using System.Threading.Tasks; | |
using System.Threading; | |
namespace ConsoleApplication13 | |
{ | |
class Program | |
{ | |
static void Main() | |
{ |
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
using System; | |
using System.Threading.Tasks; | |
using System.Threading; | |
//C# Task 入門 | |
namespace ConsoleApplication11 | |
{ | |
class Program | |
{ |
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
using System; | |
//デリゲートとラムダ式の応用例 | |
namespace ConsoleApplication10 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//第二引数にラムダ式による匿名関数を渡すことで簡潔に条件を記述できる | |
//この場合第一引数配列内の7以下の数字の総和を返す |
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
using System; | |
//デリゲートを使った同期、非同期処理のサンプルコード | |
namespace ConsoleApplication9 | |
{ | |
delegate double AsyncSum(double n); | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
AsyncSum asyncSum = sum; |
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
using System; | |
//デリゲートを理解するためのサンプルプログラム | |
namespace ConsoleApplication8 | |
{ | |
//デリゲート型の宣言 | |
delegate void ShowMessage(); | |
delegate int Caluculate(int a,int b); | |
class Program | |
{ |
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
using System; | |
//デリゲートを理解するためのサンプルプログラム | |
namespace ConsoleApplication7 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//デリゲート |
NewerOlder