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
/* | |
* Project UNITY-CONTROLLER-FIRMWARE | |
* Description: UDP controller for Unity | |
* Author: Brett Ian Balogh | |
* Email: brettbalogh@gmail.com | |
* Date: April 11, 2017 | |
* License: CC-BY-SA-NC | |
*/ | |
// Include Libraries |
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 UnityEngine; | |
using System.Collections; | |
public class screenshot : MonoBehaviour { | |
void Start () { | |
} | |
void Update () { |
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
/* | |
* Project moving-average-filter | |
* Description: Filters out noise | |
* Author: Brett Balogh | |
* Date: April 29, 2017 | |
* Copyright: CC-BY-SA-NC | |
*/ | |
#define SENSOR_PIN 0 | |
const int numValues = 100 |
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
// | |
// UnityOSC - Example of usage for OSC receiver | |
// | |
// Copyright (c) 2012 Jorge Garcia Martin | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation | |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, | |
// and to permit persons to whom the Software is furnished to do so, subject to 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
/* | |
Define STEP and DIRECTION PINS like: | |
#define STEP_PIN 1 | |
#define DIR_PIN 2 | |
at the start of the main program. | |
Put the function below at the end of the main program. | |
When you want to move, call move(steps, direction) from the main program | |
*/ | |
void move(int steps, int direction){ |
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
// Whichever pin STEP is connected to | |
#define STEP_PIN 0 | |
// Whichever pin DIR is connected to | |
#define DIR_PIN 1 | |
void setup(){ | |
pinMode(STEP_PIN, OUTPUT); | |
pinMode(DIR_PIN, OUTPUT); | |
} |
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
/* | |
Smoothing | |
Reads repeatedly from an analog input, calculating a running average | |
and printing it to the computer. Keeps ten readings in an array and | |
continually averages them. | |
The circuit: | |
* Analog sensor (potentiometer will do) attached to analog input 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
/**************************************** | |
Example Sound Level Sketch for the | |
Adafruit Microphone Amplifier | |
****************************************/ | |
const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz) | |
unsigned int sample; | |
void setup() | |
{ |
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
Timer tempTimer(2000, publishTemp); | |
int val = 0; | |
float voltage = 0.0; | |
float temperatureC = 0.0; | |
void setup() { | |
pinMode(A0, INPUT); | |
Serial.begin(115200); | |
} |