Created
October 12, 2018 14:59
-
-
Save kekyo/dad60b0cd5a5e5ca6a5d70c7d84ad70c to your computer and use it in GitHub Desktop.
BrainPad demonstration at MADOBEN YOKKAICHI 2018
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 GHIElectronics.TinyCLR.BrainPad; | |
using System; | |
using System.Collections; | |
using System.Text; | |
using System.Threading; | |
namespace TinyCLRApplication1 | |
{ | |
class Program | |
{ | |
static void Main() | |
{ | |
var display = new Display(); | |
var lightSensor = new LightSensor(); | |
var wait = new Wait(); | |
while (true) | |
{ | |
var light = lightSensor.ReadLightLevel(); | |
var text = string.Format("Light Level: {0}", light); | |
display.Clear(); | |
display.DrawSmallText(20, 0, text); | |
display.RefreshScreen(); | |
wait.Seconds(0.1); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment