Skip to content

Instantly share code, notes, and snippets.

@alansparrow
alansparrow / nodejs.raspberry
Created November 24, 2014 11:04
audio on the raspberry pi with nodejs
http://nmecdesign.com/blog/audio-on-the-raspberry-pi-with-node-js/
Audio on the Raspberry Pi with Node.js
1st June 2013
I recently wanted to play some audio through the Raspberry Pi programatically, but primarily being a web developer I wasn’t really sure how to approach the task. I can manipulate the DOM all day without breaking a sweat, but without the Web Audio API or <audio> element I was a bit stumped. Previously I’ve played around with Node.js on the Pi, but I didn’t think it would have any packages for audio and thought I’d have to use Python or Scratch which are well supported on the Pi.
Turns out you can use Node and it’s pretty simple too. I based my implementation on this Gist:
@alansparrow
alansparrow / ggmap.ini
Created November 24, 2014 10:29
google map v2 error
-startup
../../../plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
@alansparrow
alansparrow / speaker.js
Created November 7, 2014 15:06
install speaker nodejs
Your error is different. You need to
sudo apt-get install libasound2-dev
most likely to get that missing alsa.h header file.
@alansparrow
alansparrow / DHTLCDTIME
Created October 6, 2014 21:14
DHT LCD TIME
/*-----( Import needed libraries )-----*/
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>
/*-----( Declare Constants )-----*/
/*-----( Declare objects )-----*/
// set the LCD address to 0x27 for a 20 chars 4 line display
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
#include "DHT.h"
@alansparrow
alansparrow / flex1.l
Created October 4, 2014 23:11
flex tmp
"/*" {
for (;;) {
while ((c = input()) != '*' && c != EOF)
; /* eat up text of comment */
if (c == '*') {
while ((c = input()) == '*')
;
if (c == '/')
break; /* found the end */
}
@alansparrow
alansparrow / smartsensor
Created October 1, 2014 21:38
Smart Sensor
/*-----( Import needed libraries )-----*/
#include <Wire.h> // Comes with Arduino IDE
#include <LiquidCrystal_I2C.h>
/*-----( Declare Constants )-----*/
/*-----( Declare objects )-----*/
// set the LCD address to 0x27 for a 20 chars 4 line display
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
#include "DHT.h"
@alansparrow
alansparrow / lcdarduino
Created October 1, 2014 21:00
Arduino LCD
Firstly, go to Sketch->Import Library->Add library
http://arduino-info.wikispaces.com/LCD-Blue-I2C
/* YourDuino.com Example Software Sketch
16 character 2 line I2C Display
Backpack Interface labelled "YwRobot Arduino LCM1602 IIC V1"
terry@yourduino.com */
/*-----( Import needed libraries )-----*/
@alansparrow
alansparrow / raspberry b+ pin
Created September 27, 2014 22:17
raspberry b+ pin
http://www.element14.com/community/servlet/JiveServlet/previewBody/68203-102-6-294412/GPIO.png
@alansparrow
alansparrow / soundraspberry
Created September 27, 2014 19:06
play song/sound on raspberry pi
omxplayer -o local file.mp3
@alansparrow
alansparrow / cpuusage
Created September 26, 2014 17:58
check cpu usage
sudo apt-get install htop
http://askubuntu.com/questions/114997/how-where-do-i-check-my-ubuntu-laptopss-cpu-usage