Skip to content

Instantly share code, notes, and snippets.

View bakercp's full-sized avatar

Christopher Baker bakercp

View GitHub Profile
@bakercp
bakercp / MFA.ino
Created April 3, 2013 21:01
"LED that I'm soldering to a protoshield to start off, fade up to full brightness for a period of about 45 seconds, begin fading to dark again and as it dims, to strobe."
const byte ledPin = 11; // pwm pin
boolean bIsGoingUp = true;
long fadeUpTime = 15000; // 45 * 1000 milliseconds
long fadeDownTime = 15000; //
long nextTransition = -1;
long strobeOnTime = 200; // the time the strobe effect will be on
long strobeOffTime = 1000; // the time the normal fade out will be on
@bakercp
bakercp / parser.cpp
Last active December 15, 2015 03:09
CSV Parsing in openFrameworks
ofHttpResponse response = ofLoadURL("http://lvaqi.org/data/data.txt");
if(response.status == 200 /* successfully http response */) {
ofBuffer buffer = response.data;
string lastLine = ""; // empty for the moment
// we are going to cycle through until we come to the last line.
// since we stop when the variable is !buffer.isLastLine(), the last line
// will fill the lastLine variable.
###############################################################################
# CONFIGURE CORE PLATFORM MAKEFILE
# This file is where we make platform and architecture specific
# configurations. This file can be specified for a generic architecture or can
# be defined as variants. For instance, normally this file will be located in
# a platform specific subpath such as
#
# $(OF_ROOT)/libs/openFrameworksComplied/linux64
#
# This file will then be a generic platform file like:
@bakercp
bakercp / Getting Started
Last active December 14, 2015 16:49
pcDuino Startup
References:
- https://github.com/sparkfun/pcDuino/wiki/Getting-started
- http://www.youtube.com/watch?feature=player_embedded&v=-2j_ELN3LnU
Before:
You need to prepare an external disk. This can be an SD card via a USB reader, or a USB stick, or an external hard drive. It must be formatted with linux partition, rather than FAT32 (usually the default). There are many ways to format your SD card, but one easy way on the pcDuino is this:
@ the terminal
1. Open up Disk Utility in Start->Preferences->Disk Utility
2. Find your volume (may be an Generic STORAGE DEVICE).
3. Unmount the volume.
@bakercp
bakercp / ofThread.cpp
Last active December 11, 2015 01:19
ofThread updates ...
#include "ofThread.h"
#include "ofLog.h"
#include "ofUtils.h"
#ifdef TARGET_ANDROID
#include <jni.h>
#include "ofxAndroidUtils.h"
#endif
//-------------------------------------------------
@bakercp
bakercp / PulseSensorBasic.pde
Created November 27, 2012 17:24
Barebones Pulse code.
/*
THIS PROGRAM WORKS WITH PulseSensorAmped_Arduino-xx ARDUINO CODE
*/
import processing.serial.*;
Serial port;
int Sensor; // HOLDS PULSE SENSOR DATA FROM ARDUINO
int IBI; // HOLDS TIME BETWEN HEARTBEATS FROM ARDUINO
#include "ofMain.h"
#include "testApp.h"
//========================================================================
int main( ){
ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
pi@rpi ~/openFrameworks/apps/devApps/jvc_fboTest/bin $ ./jvc_fboTest
ofAppEGLWindow constructor
in ofAppEGLWINDOW: setupOpenGL
succes=0
REQUESTED SCREEN SIZE w=1024 and h=768
HARDWARE SCREEN SIZE IS sw=1920 and sh=1080
CREATING A SCREEN THAT IS w=1024 and h=768
[ofAppEGLWindow::setupEGL:notice] setting EGL Display
[ofAppEGLWindow::setupEGL:notice] setting default Display
[ofAppEGLWindow::setupEGL:notice] EGL Display correctly set
@bakercp
bakercp / 1
Created November 27, 2012 07:18
/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so
libudev.so.0 => /lib/arm-linux-gnueabihf/libudev.so.0
libGLESv2.so => /opt/vc/lib/libGLESv2.so
libEGL.so => /opt/vc/lib/libEGL.so
libopenmaxil.so => /opt/vc/lib/libopenmaxil.so
libbcm_host.so => /opt/vc/lib/libbcm_host.so
libvcos.so => /opt/vc/lib/libvcos.so
libvchiq_arm.so => /opt/vc/lib/libvchiq_arm.so
libfreeimage.so.3 => /usr/lib/libfreeimage.so.3
libcairo.so.2 => /usr/lib/arm-linux-gnueabihf/libcairo.so.2
@bakercp
bakercp / ofAppEGLWindow.cpp
Created November 27, 2012 05:26
In between ...
/*==============================================================================
Copyright (c) 2011, 2012 Christopher Baker <http://christopherbaker.net>
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: