Permalink
Browse files

initial commit

  • Loading branch information...
madshobye committed Jul 17, 2011
0 parents commit 97e00b735e1b26b7ee1da2cbf6d493e8e6f41243
Showing with 8,998 additions and 0 deletions.
  1. +67 −0 Arduino/xrope2/p01_android.pde
  2. +1,247 −0 Arduino/xrope2/p02_font.pde
  3. +30 −0 Arduino/xrope2/p03_text.pde
  4. +101 −0 Arduino/xrope2/p04_rope.pde
  5. +260 −0 Arduino/xrope2/p05_bikeRope.pde
  6. +44 −0 Arduino/xrope2/p06_wheelSensor.pde
  7. +105 −0 Arduino/xrope2/xrope2.pde
  8. +80 −0 Arduino/xrope3/p01_android.pde
  9. +170 −0 Arduino/xrope3/p05_HL1606.pde
  10. +23 −0 Arduino/xrope3/p06_pattern.pde
  11. +1,277 −0 Arduino/xrope3/p09_font.pde
  12. +51 −0 Arduino/xrope3/p11_message.pde
  13. +70 −0 Arduino/xrope3/p20_patSolid.pde
  14. +179 −0 Arduino/xrope3/p21_patText.pde
  15. +74 −0 Arduino/xrope3/p30_patternSelector.pde
  16. +58 −0 Arduino/xrope3/p50_wheelSensor.pde
  17. +85 −0 Arduino/xrope3/p99_scheduler.pde
  18. +65 −0 Arduino/xrope3/xrope3.pde
  19. +80 −0 Arduino/xrope3b/p01_android.pde
  20. +205 −0 Arduino/xrope3b/p05_HL1606.pde
  21. +18 −0 Arduino/xrope3b/p06_pattern.pde
  22. +1,277 −0 Arduino/xrope3b/p09_font.pde
  23. +51 −0 Arduino/xrope3b/p11_message.pde
  24. +181 −0 Arduino/xrope3b/p15_cimg1.pde
  25. +70 −0 Arduino/xrope3b/p20_patSolid.pde
  26. +190 −0 Arduino/xrope3b/p21_patText.pde
  27. +63 −0 Arduino/xrope3b/p22_patCimg1.pde
  28. +76 −0 Arduino/xrope3b/p30_patternSelector.pde
  29. +58 −0 Arduino/xrope3b/p50_wheelSensor.pde
  30. +85 −0 Arduino/xrope3b/p99_scheduler.pde
  31. +65 −0 Arduino/xrope3b/xrope3b.pde
  32. +80 −0 Arduino/xrope3c/p01_android.pde
  33. +205 −0 Arduino/xrope3c/p05_HL1606.pde
  34. +18 −0 Arduino/xrope3c/p06_pattern.pde
  35. +1,277 −0 Arduino/xrope3c/p09_font.pde
  36. +51 −0 Arduino/xrope3c/p11_message.pde
  37. +181 −0 Arduino/xrope3c/p15_cimg1.pde
  38. +70 −0 Arduino/xrope3c/p20_patSolid.pde
  39. +182 −0 Arduino/xrope3c/p21_patText.pde
  40. +63 −0 Arduino/xrope3c/p22_patCimg1.pde
  41. +76 −0 Arduino/xrope3c/p30_patternSelector.pde
  42. +58 −0 Arduino/xrope3c/p50_wheelSensor.pde
  43. +85 −0 Arduino/xrope3c/p99_scheduler.pde
  44. +65 −0 Arduino/xrope3c/xrope3c.pde
  45. BIN Processing/fontconverter/font.png
  46. +181 −0 Processing/fontconverter/fontconverter.pde
  47. +1 −0 Processing/fontconverter/sketch.properties
@@ -0,0 +1,67 @@
+Connection * connection;
+
+volatile unsigned char androidConnected = false;
+
+void initAndroid()
+{
+ ADB::init();
+}
+
+void connectAndroid()
+{
+ connection = ADB::addConnection("tcp:4567", true, adbEventHandler);
+ androidConnected = true;
+}
+
+void tellAndroid(unsigned int length, uint8_t * data)
+{
+ if (androidConnected)
+ {
+ connection->write(length, data);
+ }
+}
+
+void androidScan()
+{
+ if (androidConnected)
+ {
+ ADB::poll();
+ }
+}
+
+void adbEventHandler(Connection * connection, adb_eventType event, uint16_t length, uint8_t * data)
+{
+ if (event == ADB_CONNECTION_RECEIVE)
+ {
+ int messageType = data[0];
+ switch(messageType)
+ {
+ case 0:
+ {
+ // set mode
+ }
+ break;
+ case 1:
+ {
+ // set message
+ }
+ break;
+ case 2:
+ {
+ // set background color
+ }
+ break;
+ case 3:
+ {
+ // set foreground color
+ }
+ break;
+ case 4:
+ {
+ // set speed
+ }
+ break;
+ }
+ }
+}
+
Oops, something went wrong.

0 comments on commit 97e00b7

Please sign in to comment.