Permalink
Browse files

updated README, added thermal printer submodule library, added initia…

…l code
  • Loading branch information...
Quin Kennedy Quin Kennedy
Quin Kennedy authored and Quin Kennedy committed Nov 3, 2012
1 parent b7a6618 commit d45d0c2837070a0d1a20030a9bd5419c12b9f092
Showing with 75 additions and 2 deletions.
  1. +3 −0 .gitmodules
  2. +1 −0 Libraries/Adafruit_Thermal
  3. +36 −2 README.md
  4. +35 −0 print_memory/print_memory.ino
View
@@ -0,0 +1,3 @@
+[submodule "Libraries/Adafruit_Thermal"]
+ path = Libraries/Adafruit_Thermal
+ url = https://github.com/labatrockwell/Adafruit-Thermal-Printer-Library.git
Submodule Adafruit_Thermal added at 6c8bf1
View
@@ -1,2 +1,36 @@
-print_linkedlist_nyc
-====================
+This is a little project to print "LinkedList NYC". Official rules below
+
+RUNNING
+=======
+* This assumes you have
+1) A Thermal printer like the one available at Adafruit or Sparkfun
+2) An Arduino Uno (may work on other models, but not tested)
+* Download and Install Arduino http://arduino.cc/en/Main/Software
+* Copy the thermal printer library in this repo at Libraries/Adafruit_Thermal to your Arduino library. On OSX this will result in the path ~/Documents/Arduino/Libraries/Adafruit_Thermal/Adafruit_Thermal.h
+* Connect the Thermal printer to a power supply that provides between 5V and 9V and at least 2A
+* Connect the TX wire (Green wire on my model) to pin 5 on the Arduino
+* Connect the RX wire (Yellow wire) to pin 6 on the Arduino
+* Connect the GND wire (Black) to Gnd on the Arduino
+* Connect the Arduino to your USB port
+* Open print_memory.ino, compile, and upload the sketch
+* Enjoy the printer's output
+
+RULES
+======
+Write a program that prints the text "LinkedList NYC". For example, you could write the following in Python:
+
+print "LinkedList NYC"
+
+But that wouldn't be much fun. The goal is to do it in the most inventive way. Here's a slightly more interesting version in Bash:
+
+curl -s http://www.linkedlistnyc.org | sed -n 's/ *<h1>\(.*\)<\/h1>/\1/p'
+
+Bonus points if your code contains a pun, is self-referential, or is particularly clever or elegant. It can be as long or short as you like.
+
+The winner will get five pints of ice cream delivered to his or her door by the List itself [Seriously! -Ed.]. Note: You must live within the five boroughs or an area served by the PATH train to be eligible for delivery.
+
+Your program must:
+
+print or evaluate to the string "LinkedList NYC"
+be sent to tips@linkedlistnyc.org by 10am Saturday, Nov. 3
+include instructions for how to run it (if it's not easy and obvious)
@@ -0,0 +1,35 @@
+#include "Adafruit_Thermal.h"
+#include "SoftwareSerial.h"
+#include "Stream.h"
+#include <avr/pgmspace.h>
+
+uint8_t start;
+
+/**
+ * Declare which pins to communicate to the printer over
+ */
+int printer_RX_Pin = 5; // green wire
+int printer_TX_Pin = 6; // yellow wire
+const int maxWidth = 384;
+const int bytesWidth = maxWidth/8;
+const int bytesMemory = 2000;
+const int maxHeight = bytesMemory/bytesWidth;
+
+/**
+ * Initialize the thermal printer
+ */
+Adafruit_Thermal printer(printer_RX_Pin, printer_TX_Pin);
+
+void setup(){
+ printer.begin();
+ //printer.printBitmap(maxWidth, 1, bmp);
+ printer.println("Hello");
+ int square = sqrt(bytesMemory*8);
+ printer.printBitmap(square, bytesMemory*8/square, ((const uint8_t*)0), false);
+ //printer.feed(1);
+ //printer.printBitmap(maxWidth, 32, bitmap, false);
+ //printer.println((long)bitmap);
+ printer.println("Bye");
+}
+
+void loop(){}

0 comments on commit d45d0c2

Please sign in to comment.