A handsome dashboard framework solution
Dashing is a framework for building web-based dashboards.
Features:
> a = Hash.new([]) | |
=> {} | |
> a[:one] | |
=> [] | |
> a[:one] << "item" | |
=> ["item"] | |
> a[:one] | |
=> ["item"] | |
> a => {} #WAT??? |
int potPin1 = 0; // select the input pin for the potentiometer | |
int potPin2 = 1; // select the input pin for the potentiometer | |
int potPin3 = 2; // select the input pin for the potentiometer | |
int val1 = 0; // variable to store the value coming from the sensor | |
int val2 = 0; // variable to store the value coming from the sensor | |
int val3 = 0; // variable to store the value coming from the sensor | |
void setup() { | |
Serial.begin(9600); | |
} |
require 'serialport' | |
require 'faraday' | |
require 'json' | |
sp = SerialPort.new("/dev/tty.usbmodemfa131", 9600, 8, 1, SerialPort::NONE) | |
def post(widget, value) | |
Faraday.post("http://192.168.10.75:3000/widgets/#{widget}") do |req| | |
req.headers['Content-Type'] = 'application/json' | |
req.body = {auth_token: '60b3d4dd2194e29fa045736e76995cf6', value: value.to_i}.to_json.to_s |
Section "Device" | |
Identifier "Card0" | |
Driver "fbdev" | |
Option "Rotate" "CW" | |
EndSection |
<h1 data-bind="title"></h1> | |
<h3 data-bind="text"></h3> |
class Dashing.SweetWidget extends Dashing.Widget | |
constructor: -> | |
super | |
@set('attr', 'wooo') | |
onData: (data) -> | |
super | |
@set('cool_thing', data.massage.split(',')[2] |
$text_value-color: #fff; | |
$text_title-color: lighten($widget-text-color, 30%); | |
.widget-text { | |
.title {color: $text_title-color;} | |
.p { color: $text_value-color;} | |
} |
# :first_in sets how long it takes before the job is first run. In this case, it is run immediately | |
SCHEDULER.every '1m', :first_in => 0 do |job| | |
send_event('widget_id', {text: "I am #{%w(happy sad hungry).sample}"}) | |
end |
curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "value": 100 }' http://localhost:3000/widgets/synergy |