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
#version 150 | |
uniform mat4 ciModelViewProjection; | |
uniform mat4 ciProjectionMatrix; | |
uniform mat4 ciModelViewMatrix; | |
in vec4 ciPosition; | |
uniform vec3 v3LightPosition; // The direction vector to the light source |
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
#version 150 | |
in vec3 v3LightDirection; | |
in vec3 v3Direction; | |
in vec3 c0; | |
in vec3 c1; | |
out vec4 color; | |
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
void stestingApp::setup() | |
{ | |
mCam.lookAt(vec3(3, 2, 4), vec3(0)); | |
try { | |
mGlsl = gl::GlslProg::create(gl::GlslProg::Format().vertex(loadAsset("sh.vert")).fragment(loadAsset("sh.frag"))); | |
} | |
catch (gl::GlslProgCompileExc ex) { | |
console() <<"Shader Creation failed: "<< ex.what() << endl; | |
quit(); |
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
uint8_t Binary2Gray(uint8_t data) | |
{ | |
int n_data=(data>>1); | |
n_data=(data ^ n_data); | |
return n_data; | |
} | |
uint8_t Gray2Binary(uint8_t data) | |
{ | |
byte b[8]={0,0,0,0,0,0,0,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
/* | |
Copyright (C) 2011 J. Coliz <maniacbug@ymail.com> | |
This program is free software; you can redistribute it and/or | |
modify it under the terms of the GNU General Public License | |
version 2 as published by the Free Software Foundation. | |
TMRh20 2014 - Updates to the library allow sleeping both in TX and RX modes: | |
TX Mode: The radio can be powered down (.9uA current) and the Arduino slept using the watchdog timer | |
RX Mode: The radio can be left in standby mode (22uA current) and the Arduino slept using an interrupt pin |
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
#include <EEPROM.h> | |
#include "EEPROM_store.h" | |
#define PERIODIC_PERIOD 11 | |
#define PERIODIC_PERIOD2 12 | |
#define CONFIG_PERIOD 13 | |
#define CONFIG_PERIOD2 14 | |
//state flags location | |
void setup() { | |
// put your setup code here, to run once: |
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
/*Author:?? | |
found at ESP8266/arduino | |
*/ | |
#include <ESP8266WiFi.h> | |
extern "C" { | |
#include "user_interface.h" | |
} | |
const char* ssid = "UNICORN"; | |
const char* password = "Un1c()rn"; |
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
nrf24.startListening(); | |
Serial.println("waiting.."); | |
unsigned long started_waiting_at =millis(); | |
bool timeout=false; | |
while ( ! nrf24.available() ){ // While nothing is received | |
if ((millis() - started_waiting_at) > 5000 ){ // If waited longer, indicate timeout and exit while loop | |
timeout = true; | |
break; | |
}else |
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
#include <nRF24L01.h> | |
//#include <printf.h> | |
#include <RF24.h> | |
#include <RF24_config.h> | |
// This is test code I am trying out using library | |
#include <nRF24L01.h> | |
//#include <printf.h> | |
#include <RF24.h> | |
#include <RF24_config.h> |
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
if(sState==NSETSERVICESTATE){ | |
Serial.println("Going to locate service"); | |
sState=DISCOVERINGSERVICE; | |
ble.gattClient().launchServiceDiscovery(chandle.connHandle, ServiceCallBack, CharacteristicCallBack, service1_uuid,chars_uuid1); | |
}else if(sState==FOUNDSERVICE && !ble.gattClient().isServiceDiscoveryActive()){ | |
Serial.println(" Discovering Chars"); | |
// if(charB1.cs==NSETCHARSTATE) | |
// { | |
// Serial.println("Searching CharB1."); | |
// charB1.cs=DISCOVERINGCHAR; |
OlderNewer