Skip to content

Instantly share code, notes, and snippets.

View olafloogman's full-sized avatar

Olaf Loogman olafloogman

  • Sydney, NSW, Australia
View GitHub Profile
@olafloogman
olafloogman / main.cpp
Created November 29, 2014 05:25
WindowsIoT_BasicTemplate
// Main.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include "arduino.h"
int _tmain(int argc, _TCHAR* argv[])
{
return RunArduinoSketch();
}
@olafloogman
olafloogman / main.cpp
Created November 29, 2014 05:31
WindowsIoT_TemperatureToStorageQueue
// Main.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include "arduino.h"
#include "was/storage_account.h"
#include "was/queue.h"
#include <cpprest/http_client.h>
#include <cpprest/filestream.h>
@olafloogman
olafloogman / sendeventhub.py
Last active July 16, 2020 09:58
sendeventhub
#!/user/bin/python
import sys
import azure
import socket
from azure.servicebus import (
_service_bus_error_handler
)
from azure.servicebus.servicebusservice import (
@olafloogman
olafloogman / tempmeter.ino
Created December 4, 2014 23:39
ArduinoEventHub
#include <Process.h>
const int sensorPin = A0;
const int greenLedPin = 4;
const int redLedPin = 2;
// the HTTP status that we expect back from the Event Hub
const char okHttpStatus[] = "201";
void setup() {
pinMode(greenLedPin, OUTPUT);
@olafloogman
olafloogman / eventhubhttppost
Created December 4, 2014 23:41
Arduino HTTP Post
POST https://myservicebusnamespace.servicebus.windows.net/your-event-hub/messages?timeout=60&api-version=2014-01 HTTP/1.1
Authorization: SharedAccessSignature sr=myservicebusnamespace.servicebus.windows.net&sig=tYu8qdH563Pc96Lky0SFs5PhbGnljF7mLYQwCZmk9M0%3d&se=1403736877&skn=MyPolicy
ContentType: application/atom+xml;type=entry;charset=utf-8
Host: your-namespace.servicebus.windows.net
Content-Length: 42
Expect: 100-continue
{ "DeviceId" : "ArduinoYun",
"SensorData" : [ { "SensorId" : "yun",
"SensorType" : "temperature",
@olafloogman
olafloogman / ColorPickerPage.xaml.cs
Created January 14, 2015 02:58
ColorDataToMobileService
private async void lstColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.AddedItems.Count > 0)
{
(Application.Current as App).CurrentColorItem = ((ColorItem)e.AddedItems[0]);
var Color = ((ColorItem)e.AddedItems[0]).Color;
SensorData item = new SensorData
{
DeviceId = "PhoneEmulator",
#include <SPI.h>
#include <Ethernet.h>
#include <sha256.h>
#include <ArduinoJson.h>
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// Set the static IP address to use if the DHCP fails to assign
@olafloogman
olafloogman / rg1
Last active August 29, 2015 14:17
PS C:\> Get-AzureResourceGroup
ResourceGroupName : Default-Networking
Location : australiaeast
ProvisioningState : Succeeded
Tags :
ResourceId : /subscriptions/12360114-0ea0-40a5-8b75-293e7bdbd751/resourceGroups/Default-Networking
ResourceGroupName : Default-SQL-AustraliaEast
Location : australiaeast
@olafloogman
olafloogman / rg2
Last active August 29, 2015 14:17
PS C:\> New-AzureResourceGroup -Name RG-AU-MyApplication -Location "Australia East"
VERBOSE: 6:58:08 AM - Created resource group 'RG-AU-MyApplication' in location 'australiaeast'
ResourceGroupName : RG-AU-MyApplication
Location : australiaeast
ProvisioningState : Succeeded
Tags :
Permissions :
Actions NotActions
======= ==========
PS C:\> Get-AzureResourceGroup -Name myauvm01
ResourceGroupName : myauvm01
Location : australiaeast
ProvisioningState : Succeeded
Tags :
Permissions :
Actions NotActions
======= ==========
*