Skip to content

Instantly share code, notes, and snippets.

View robinmanuelthiel's full-sized avatar
✌️
Never grow up!

Robin-Manuel Thiel robinmanuelthiel

✌️
Never grow up!
View GitHub Profile
@robinmanuelthiel
robinmanuelthiel / ArduinoLcdKeypadControl.ino
Last active August 17, 2016 22:19
A simple Arduino Sketch to control the LCD Keypad Shield (SKU: DFR0009)
// Use LiquidCrystal library
#include <LiquidCrystal.h>
// Define button values
#define btnNONE 0
#define btnRIGHT 1
#define btnUP 2
#define btnDOWN 3
#define btnLEFT 4
@robinmanuelthiel
robinmanuelthiel / ArduinoMarquee.ino
Created August 17, 2016 16:16
A simple Arduino Sketch to let a marquee run through a LED panel.
// Use LiquidCrystal library to communicate with LCD
#include <LiquidCrystal.h>
// Select the pins used on the LCD panel
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// Define message to show
String message = "My future tweets will be in this format";
void setup() {
<Application
x:Class="App1.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
RequestedTheme="Light">
<Application.Resources>
<!-- The custom color for the new placeholder -->
<SolidColorBrush x:Key="MyCustomPlaceholderForegroundColor" Color="{StaticResource SystemBaseHighColor}"/>
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
if (!string.IsNullOrEmpty(e.Parameter as string))
{
// Check if all paramters for accessing the light are set
if (App.HomeMatic != null && App.SelectedLightId != 0)
{
var args = ((string)e.Parameter).Split('|');
protected override void OnActivated(IActivatedEventArgs args)
{
base.OnActivated(args);
string infos = string.Empty;
// Get voice data
if (args.Kind == ActivationKind.VoiceCommand)
{
var commandArgs = args as VoiceCommandActivatedEventArgs;
var speechRecognitionResult = commandArgs.Result;
Windows.ApplicationModel.VoiceCommands.VoiceCommnadDefinition.VoiceCommandSet commandSet;
if (Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstalledCommandSets.TryGetValue("CortanaCommands_en", out commandSet))
{
await commandSetEnUs.SetPhraseListAsync("room", new string[] {"Bathroom", "Kitchen", "Livingroom", "Bedroom"});
}
// Register Cortana voice commands
var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///CortanaCommands.xml"));
await Windows.ApplicationModel.VoiceCommands.VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(file);
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.1">
<CommandSet xml:lang="en" Name="CortanaCommands_en">
<CommandPrefix>Switch the light</CommandPrefix>
<Example>Switch the light in the bathroom on.</Example>
<Command Name="switchLight">
<Example>in the bathroom on</Example>
<ListenFor>in [the] {room} {status}</ListenFor>
<Feedback>{room}light will be switched {status}.</Feedback>
<Navigate />