Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 72ce5a3b5ea1acdf26cdb761ad267dfc8a9cb194 @sbstjn committed Apr 10, 2012
Showing with 16,777 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +8 −0 LICENSE
  3. +17 −0 README.md
  4. +7 −0 app.js
  5. +13 −0 package.json
  6. +17 −0 public/scripts/main.js
  7. +11,322 −0 public/scripts/require-jquery.js
  8. +28 −0 public/styles/bootstrap/accordion.less
  9. +58 −0 public/styles/bootstrap/alerts.less
  10. +36 −0 public/styles/bootstrap/badges.less
  11. +24 −0 public/styles/bootstrap/breadcrumbs.less
  12. +172 −0 public/styles/bootstrap/button-groups.less
  13. +187 −0 public/styles/bootstrap/buttons.less
  14. +121 −0 public/styles/bootstrap/carousel.less
  15. +18 −0 public/styles/bootstrap/close.less
  16. +57 −0 public/styles/bootstrap/code.less
  17. +20 −0 public/styles/bootstrap/component-animations.less
  18. +148 −0 public/styles/bootstrap/dropdowns.less
  19. +555 −0 public/styles/bootstrap/forms.less
  20. +5 −0 public/styles/bootstrap/grid.less
  21. +22 −0 public/styles/bootstrap/hero-unit.less
  22. +689 −0 public/styles/bootstrap/init.css
  23. +63 −0 public/styles/bootstrap/init.less
  24. +38 −0 public/styles/bootstrap/labels.less
  25. +17 −0 public/styles/bootstrap/layouts.less
  26. +614 −0 public/styles/bootstrap/mixins.less
  27. +90 −0 public/styles/bootstrap/modals.less
  28. +341 −0 public/styles/bootstrap/navbar.less
  29. +363 −0 public/styles/bootstrap/navs.less
  30. +36 −0 public/styles/bootstrap/pager.less
  31. +56 −0 public/styles/bootstrap/pagination.less
  32. +49 −0 public/styles/bootstrap/popovers.less
  33. +109 −0 public/styles/bootstrap/progress-bars.less
  34. +126 −0 public/styles/bootstrap/reset.less
  35. +371 −0 public/styles/bootstrap/responsive.less
  36. +29 −0 public/styles/bootstrap/scaffolding.less
  37. +158 −0 public/styles/bootstrap/sprites.less
  38. +159 −0 public/styles/bootstrap/tables.less
  39. +35 −0 public/styles/bootstrap/thumbnails.less
  40. +35 −0 public/styles/bootstrap/tooltip.less
  41. +234 −0 public/styles/bootstrap/type.less
  42. +23 −0 public/styles/bootstrap/utilities.less
  43. +201 −0 public/styles/bootstrap/variables.less
  44. +27 −0 public/styles/bootstrap/wells.less
  45. +2 −0 public/styles/init.css
  46. +9 −0 public/styles/init.less
  47. +6 −0 public/styles/reset.less
  48. +19 −0 serial.js
  49. +5 −0 socket.js
  50. +14 −0 views/home.jade
  51. +2 −0 views/includes/snippet.jade
  52. +9 −0 views/layout.jade
  53. +11 −0 web.js
@@ -0,0 +1,2 @@
+.DS_Store
+node_modules
@@ -0,0 +1,8 @@
+The MIT License (MIT)
+Copyright (c) 2012 Sebastian Müller
+
+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:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,17 @@
+Simple Node.js application for piping serial communication from your arduino to a modern web browser with WebSockets.
+
+![arduino-socket](http://semu.mp/screenshots/arduino-socket-20120410-173825.png)
+
+See `serial.js` for setting your serial port and needed baud rate
+
+ define(['child_process', 'serialport'], function(child, serialport) {
+ var serial = {
+ 'connect': function(socket) {
+ board = new serialport.SerialPort('/dev/tty.usbmodem1a21', {
+ baudrate: 9600,
+ parser: serialport.parsers.readline("\n")
+ });
+
+Install dependencies with `npm install`, start the application with `node app.js` and point your web browser to [http://localhost:8080](http://localhost:8080) to see your arduino's serial output…
+
+Using Node.js, Express.js, Socket.IO, bootstrap by twitter and some more libs…
@@ -0,0 +1,7 @@
+var requirejs = require('requirejs');
+requirejs.config({nodeRequire: require});
+
+requirejs(['serial', 'web', 'socket'],function(serial, web, socket) {
+ serial.connect(socket);
+ web.listen(8080);
+});
@@ -0,0 +1,13 @@
+{
+ "name": "arduino-websocket",
+ "description": "Pipe data from serial connection trough websockets to a browser",
+ "author": "Sebastian Müller <mail@semu.mp>",
+ "version": "0.1",
+ "dependencies": {
+ "requirejs": ">= 1.0.7",
+ "serialport": ">= 0.7.3",
+ "kickstart": ">= 0.0.5",
+ "socket.io": ">= 0.9.3"
+ },
+ "engine": "node >= 0.4.1"
+}
@@ -0,0 +1,17 @@
+var isRunning = false;
+
+function ISODateString(d){
+ function padT(n){return (n<10 ? '0'+n : n); }
+ function padH(n){return (n<10 ? '00'+n : (n<100 ? '0'+n : n)); }
+ return padT(d.getUTCHours())+':'+padT(d.getUTCMinutes())+':'+padT(d.getUTCSeconds())+'Z'+padH(d.getUTCMilliseconds());
+}
+
+require(["jquery"], function($) {
+ var socket = io.connect();
+ socket.on('msg', function (data) {
+ if ($("#socket li").length > 20) {
+ $("#socket li:nth-child(1)").remove(); }
+
+ $('#socket').append('<li>' + ISODateString(new Date()) + " " + data + '</li>');
+ });
+});
Oops, something went wrong.

0 comments on commit 72ce5a3

Please sign in to comment.