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
# WIP of http://wiki.processing.org/w/Ruby_Comparison | |
# Based on http://wiki.processing.org/w/Python_Comparison | |
# todo: | |
# - write intro paragraph on Ruby | |
# - add more examples | |
# - add a separate RubyProcessing_Comparison wiki entry for ruby-processing | |
# [http://wiki.github.com/jashkenas/ruby-processing/] | |
# Data | |
x = 70 # Initialize |
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
<?php | |
/* | |
* Display a sensor value on a webpage | |
* Uses the Pachube PHP Library - download at http://community.pachube.com/tutorials/php | |
*/ | |
require_once('pachube_functions.php'); | |
// Obtain your API key here: http://www.pachube.com/users/my_username/settings |
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
<html> | |
<head> | |
<title>Changing webpage contents in response to a light sensor</title> | |
<script type="text/javascript" src="jquery-1.4.2.min.js"></script> | |
<style type="text/css"> | |
body { | |
margin:0; | |
padding:50px; | |
text-align:center; | |
background-color:#ccc; |
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
<?php | |
/* | |
* sendTweet.php | |
* | |
* To send a tweet, request the URL of this script with a status parameter like this: | |
* http://localhost/sendTweet.php?status=this is a test tweet | |
*/ | |
$status = $_GET['status']; | |
$username = "YOUR_TWITTER_USERNAME"; |
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
char pachube_data[70]; | |
boolean found_status_200 = false; | |
boolean found_session_id = false; | |
boolean found_CSV = false; | |
char *found; | |
unsigned int successes = 0; | |
unsigned int failures = 0; | |
boolean ready_to_update = true; | |
boolean reading_pachube = false; |
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
/* | |
* light_mirror.pde | |
* Turns on an LED when it's bright in a remote location and vice versa | |
* Remote location is set to the Pachube office feed but this can easily be changed | |
*/ | |
/* ============================== | |
* This code, which assumes you're using the official Arduino Ethernet shield, | |
* updates a Pachube feed with your analog-in values and grabs values from a Pachube | |
* feed - basically it enables you to have both "local" and "remote" sensors. |
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
/* | |
* skype_status.pde | |
* Turns on an LED when a Skype user is online and vice versa | |
* See http://apps.pachube.com/onlinestatus/online-status.php for more info and setup instructions. | |
*/ | |
/* ============================== | |
* This code, which assumes you're using the official Arduino Ethernet shield, | |
* updates a Pachube feed with your analog-in values and grabs values from a Pachube | |
* feed - basically it enables you to have both "local" and "remote" sensors. |
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
require 'rubygems' | |
require 'sinatra' | |
require 'data_mapper' | |
require 'carrierwave' | |
require 'carrierwave/orm/datamapper' | |
ROOT = Dir.pwd | |
class ImageUploader < CarrierWave::Uploader::Base | |
storage :file |
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
// these are constants that won't change while the code is running | |
const int lowerBound = 0; | |
const int threshold1 = 350; | |
const int threshold2 = 700; | |
const int upperBound = 1024; | |
// these variables will change | |
int sensorValue = 0; | |
int lastRange = 0; |
OlderNewer