This file contains hidden or 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
| // orthographicSizeはカメラの高さの半分のサイズ | |
| var h = _camera.orthographicSize; | |
| var screenRatio = (float) Screen.width / (float) Screen.height; | |
| var w = screenRatio * h; | |
| // 2048*2048pxの画像をドラッグする | |
| var imageSize = 2048; | |
| // X,Yそれぞれの最大ドラッグできる距離 | |
| var distanceX = (float)imageSize/(100f * 2f) - w; |
This file contains hidden or 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
| // ポテンショメータを使ってLEDを点滅スピードを変更するサンプル | |
| int sensorPin = A0; | |
| int ledPin = 13; | |
| int sensorValue = 0; | |
| void setup() | |
| { | |
| pinMode(ledPin, OUTPUT); | |
| Serial.begin(9600); | |
| } |
This file contains hidden or 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
| // [wip] 1digit 7segment module sample | |
| // 手持ちの配線が足らなかったので一旦 | |
| void setup() | |
| { | |
| // 0は使用できない | |
| // pinMode(0, OUTPUT); | |
| pinMode(1, OUTPUT); | |
| pinMode(2, OUTPUT); | |
| pinMode(3, OUTPUT); | |
| pinMode(4, OUTPUT); |
This file contains hidden or 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 <SPI.h> | |
| #include <CubettoLibrary.h> | |
| #include <AccelStepper.h> | |
| #include <aci.h> | |
| #include <KickstarterBackers.h> | |
| Cubetto CubettoRobot; | |
| /** ************************************************************************************************************************************ | |
| * @function | |
| * @brief |
This file contains hidden or 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 "stdafx.h" | |
| #include <iostream> | |
| typedef struct | |
| { | |
| int id; | |
| float value; | |
| }StructData; | |
| DllExport void TestStruct(StructData* output, StructData* input); |
This file contains hidden or 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
| [DllImport("TestDll.dll", CallingConvention = CallingConvention.Cdecl)] | |
| static extern void TestIntArray(System.IntPtr array, int length); | |
| static void Main() | |
| { | |
| // 配列要素数 | |
| const int Length = 5; | |
| var array = new int[Length] { 0, 1, 2, 3, 4 }; | |
| // アンマネージド配列のメモリ確保 |
This file contains hidden or 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
| #pragma once | |
| #include "targetver.h" | |
| // Windows ヘッダーからほとんど使用されていない部分を除外する | |
| #define WIN32_LEAN_AND_MEAN | |
| // Windows ヘッダー ファイル | |
| #include <windows.h> | |
This file contains hidden or 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 "stdafx.h" | |
| #include <iostream> | |
| // C#から配列と要素数を渡す関数を定義 | |
| DllExport void TestIntArray(int* array, int length); | |
| void TestIntArray(int* array, int length) | |
| { | |
| for (int i = 0; i < length; i++) | |
| { |
This file contains hidden or 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 "stdafx.h" | |
| #include <iostream> | |
| // C#からたたかれる関数定義 | |
| DllExport void TestInt(const int value) { | |
| std::cout << value << std::endl; | |
| } | |
| void TestInt(const int value) | |
| { |
This file contains hidden or 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
| [DllImport("TestDll.dll", CallingConvention = CallingConvention.Cdecl)] | |
| static extern void Test(string str); | |
| static void Main() | |
| { | |
| // DLLのTestを呼ぶ | |
| Test("hogehoge"); | |
| } |