Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Lots of new Arduino stuff!

Signed-off-by: Seb Lee-Delisle <sebleedelisle@gmail.com>
  • Loading branch information...
commit ffb62fb9a002347a269aa3d2bc490134267bf5f0 1 parent f8853cd
@sebleedelisle authored
Showing with 18,232 additions and 83 deletions.
  1. +1 −0  Arduino/ArcadeController/ArcadeController.ino
  2. +53 −0 Arduino/ArcadeControllerKeyboard/ArcadeControllerKeyboard.ino
  3. +34 −0 Arduino/ArcadeControllerMouse/ArcadeControllerMouse.ino
  4. +91 −0 Arduino/DisplayTest/DisplayTest.ino
  5. +1 −0  Arduino/LEDDisplay1/LEDDisplay1.ino
  6. +81 −0 Arduino/MotorTest/MotorTest.ino
  7. +90 −0 Arduino/MotorTest2/MotorTest2.ino
  8. +42 −0 Arduino/MotorTest3/MotorTest3.ino
  9. +37 −0 Arduino/MotorTest4/MotorTest4.ino
  10. +563 −0 Arduino/libraries/AFMotor/AFMotor.cpp
  11. +104 −0 Arduino/libraries/AFMotor/AFMotor.h
  12. +5 −0 Arduino/libraries/AFMotor/README.txt
  13. +60 −0 Arduino/libraries/AFMotor/examples/MotorParty/MotorParty.pde
  14. +52 −0 Arduino/libraries/AFMotor/examples/MotorTest/MotorTest.pde
  15. +34 −0 Arduino/libraries/AFMotor/examples/StepperTest/StepperTest.pde
  16. +35 −0 Arduino/libraries/AFMotor/keywords.txt
  17. +272 −0 Arduino/libraries/Adafruit_7Seg/Adafruit_7Seg.cpp
  18. +103 −0 Arduino/libraries/Adafruit_7Seg/Adafruit_7Seg.h
  19. +26 −0 Arduino/libraries/Adafruit_7Seg/README.txt
  20. +50 −0 Arduino/libraries/Adafruit_7Seg/examples/HT16K33/HT16K33.ino
  21. +82 −0 Arduino/libraries/Adafruit_7Seg/examples/sevenseg/sevenseg.ino
  22. +26 −0 Arduino/libraries/Adafruit_7Seg/license.txt
  23. +469 −0 Arduino/libraries/Adafruit_GFX/Adafruit_GFX.cpp
  24. +98 −0 Arduino/libraries/Adafruit_GFX/Adafruit_GFX.h
  25. +17 −0 Arduino/libraries/Adafruit_GFX/README.txt
  26. +266 −0 Arduino/libraries/Adafruit_GFX/glcdfont.c
  27. +26 −0 Arduino/libraries/Adafruit_GFX/license.txt
  28. +344 −0 Arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp
  29. +123 −0 Arduino/libraries/Adafruit_LEDBackpack/Adafruit_LEDBackpack.h
  30. +26 −0 Arduino/libraries/Adafruit_LEDBackpack/README.txt
  31. +50 −0 Arduino/libraries/Adafruit_LEDBackpack/examples/HT16K33/HT16K33.ino
  32. +98 −0 Arduino/libraries/Adafruit_LEDBackpack/examples/bicolor8x8/bicolor8x8.pde
  33. +120 −0 Arduino/libraries/Adafruit_LEDBackpack/examples/matrix8x8/matrix8x8.ino
  34. +249 −0 Arduino/libraries/Adafruit_LEDBackpack/examples/roboface/roboface.pde
  35. +82 −0 Arduino/libraries/Adafruit_LEDBackpack/examples/sevenseg/sevenseg.ino
  36. +351 −0 Arduino/libraries/Adafruit_LEDBackpack/examples/wavface/wavface.pde
  37. BIN  Arduino/libraries/Adafruit_LEDBackpack/examples/wavface/wavs/beware_i.wav
  38. BIN  Arduino/libraries/Adafruit_LEDBackpack/examples/wavface/wavs/ihunger.wav
  39. BIN  Arduino/libraries/Adafruit_LEDBackpack/examples/wavface/wavs/run_cowd.wav
  40. +26 −0 Arduino/libraries/Adafruit_LEDBackpack/license.txt
  41. +27 −21 Arduino/polargraphStepDir/configuration.ino
  42. +6 −3 Arduino/polargraphStepDir/exec.ino
  43. +2 −1  Arduino/polargraphStepDir/pixel.ino
  44. +2 −2 Arduino/polargraphStepDir/polargraphStepDir.ino
  45. +32 −4 Game/clientCanvas/KeyTracker.js
  46. +39 −10 Game/clientCanvas/Lander.js
  47. +42 −17 Game/clientCanvas/game.js
  48. +1 −1  Game/clientSVG/game.js
  49. +44 −24 Game/server/llapp.js
  50. +46 −0 GameApp.app/Contents/Info.plist
  51. BIN  GameApp.app/Contents/MacOS/applet
  52. +1 −0  GameApp.app/Contents/PkgInfo
  53. BIN  GameApp.app/Contents/Resources/Scripts/main.scpt
  54. BIN  GameApp.app/Contents/Resources/applet.icns
  55. BIN  GameApp.app/Contents/Resources/applet.rsrc
  56. +4 −0 GameApp.app/Contents/Resources/description.rtfd/TXT.rtf
  57. BIN  GameApp.scpt
  58. BIN  GameOSX/Debug/LunarTrails.build/LunarTrails-all-target-headers.hmap
  59. BIN  GameOSX/Debug/LunarTrails.build/LunarTrails-generated-files.hmap
  60. BIN  GameOSX/Debug/LunarTrails.build/LunarTrails-own-target-headers.hmap
  61. BIN  GameOSX/Debug/LunarTrails.build/LunarTrails-project-headers.hmap
  62. +10 −0 GameOSX/Debug/LunarTrails.build/LunarTrails.dep
  63. BIN  GameOSX/Debug/LunarTrails.build/LunarTrails.hmap
  64. +10 −0 GameOSX/Debug/LunarTrails.build/LunarTrails~.dep
  65. +3 −0  GameOSX/Debug/LunarTrails.build/Objects-normal/x86_64/AppDelegate.d
  66. BIN  GameOSX/Debug/LunarTrails.build/Objects-normal/x86_64/AppDelegate.dia
  67. BIN  GameOSX/Debug/LunarTrails.build/Objects-normal/x86_64/AppDelegate.o
  68. +2 −0  GameOSX/Debug/LunarTrails.build/Objects-normal/x86_64/LunarTrails.LinkFileList
  69. +2 −0  GameOSX/Debug/LunarTrails.build/Objects-normal/x86_64/main.d
  70. BIN  GameOSX/Debug/LunarTrails.build/Objects-normal/x86_64/main.dia
  71. BIN  GameOSX/Debug/LunarTrails.build/Objects-normal/x86_64/main.o
  72. +192 −0 GameOSX/Debug/LunarTrails.build/build-state.dat
  73. +187 −0 GameOSX/Debug/LunarTrails.build/build-state~.dat
  74. BIN  ...rTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/LunarTrails-all-target-headers.hmap
  75. BIN  ...unarTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/LunarTrails-generated-files.hmap
  76. BIN  ...rTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/LunarTrails-own-target-headers.hmap
  77. BIN  ...unarTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/LunarTrails-project-headers.hmap
  78. +20 −0 ...OSX/DerivedData/LunarTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/LunarTrails.dep
  79. BIN  ...SX/DerivedData/LunarTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/LunarTrails.hmap
  80. +11 −0 ...SX/DerivedData/LunarTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/LunarTrails~.dep
  81. +3 −0  ...rTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/Objects-normal/x86_64/AppDelegate.d
  82. BIN  ...rails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/Objects-normal/x86_64/AppDelegate.dia
  83. BIN  ...rTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/Objects-normal/x86_64/AppDelegate.o
  84. +2 −0  ...ld/Intermediates/LunarTrails.build/Release/LunarTrails.build/Objects-normal/x86_64/LunarTrails.LinkFileList
  85. +2 −0  ...ta/LunarTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/Objects-normal/x86_64/main.d
  86. BIN  .../LunarTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/Objects-normal/x86_64/main.dia
  87. BIN  ...ta/LunarTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/Objects-normal/x86_64/main.o
  88. +540 −0 ...OSX/DerivedData/LunarTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/build-state.dat
  89. +234 −0 ...SX/DerivedData/LunarTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrails.build/build-state~.dat
  90. BIN  ...ild/Intermediates/LunarTrails.build/Release/LunarTrailsTests.build/LunarTrailsTests-all-target-headers.hmap
  91. BIN  .../Build/Intermediates/LunarTrails.build/Release/LunarTrailsTests.build/LunarTrailsTests-generated-files.hmap
  92. BIN  ...ild/Intermediates/LunarTrails.build/Release/LunarTrailsTests.build/LunarTrailsTests-own-target-headers.hmap
  93. BIN  .../Build/Intermediates/LunarTrails.build/Release/LunarTrailsTests.build/LunarTrailsTests-project-headers.hmap
  94. BIN  ...Data/LunarTrails/Build/Intermediates/LunarTrails.build/Release/LunarTrailsTests.build/LunarTrailsTests.hmap
  95. +2 −0  ...d/Intermediates/PrecompiledHeaders/LunarTrails-Prefix-cxrehkpoebxmnhcwjufnrlmksssp/LunarTrails-Prefix.pch.d
  96. BIN  ...Intermediates/PrecompiledHeaders/LunarTrails-Prefix-cxrehkpoebxmnhcwjufnrlmksssp/LunarTrails-Prefix.pch.dia
  97. BIN  ...Intermediates/PrecompiledHeaders/LunarTrails-Prefix-cxrehkpoebxmnhcwjufnrlmksssp/LunarTrails-Prefix.pch.pth
  98. +27 −0 ...PrecompiledHeaders/LunarTrails-Prefix-cxrehkpoebxmnhcwjufnrlmksssp/LunarTrails-Prefix.pch.pth.hash-criteria
  99. +20 −0 GameOSX/DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app.dSYM/Contents/Info.plist
  100. BIN  ...SX/DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app.dSYM/Contents/Resources/DWARF/LunarTrails
  101. +48 −0 GameOSX/DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Info.plist
  102. BIN  GameOSX/DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/MacOS/LunarTrails
  103. +1 −0  GameOSX/DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/PkgInfo
  104. BIN  ...DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/bender_italic-webfont.eot
  105. +219 −0 ...DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/bender_italic-webfont.svg
  106. BIN  ...DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/bender_italic-webfont.ttf
  107. BIN  ...erivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/bender_italic-webfont.woff
  108. BIN  .../DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/bender_light-webfont.eot
  109. +219 −0 .../DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/bender_light-webfont.svg
  110. BIN  .../DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/bender_light-webfont.ttf
  111. BIN  ...DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/bender_light-webfont.woff
  112. +29 −0 GameOSX/DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/en.lproj/Credits.rtf
  113. BIN  ...erivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/en.lproj/InfoPlist.strings
  114. BIN  ...OSX/DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/en.lproj/MainMenu.nib
  115. +82 −0 GameOSX/DerivedData/LunarTrails/Build/Products/Release/LunarTrails.app/Contents/Resources/index.html
  116. BIN  GameOSX/DerivedData/LunarTrails/Index/LunarTrails.hmap
  117. BIN  ...ils/Index/PrecompiledHeaders/LunarTrails-Prefix-eowcsrmzmtxlcndyjfepuzepspcz_ast/LunarTrails-Prefix.pch.pth
  118. BIN  ...ils/Index/PrecompiledHeaders/LunarTrails-Prefix-gtehnrosqzuvbsgieoqybhnwkeha_ast/LunarTrails-Prefix.pch.pth
  119. +31 −0 ...ompiledHeaders/LunarTrails-Prefix-gtehnrosqzuvbsgieoqybhnwkeha_ast/LunarTrails-Prefix.pch.pth.hash-criteria
  120. BIN  GameOSX/DerivedData/LunarTrails/Index/Release/macosx10.8-x86_64/LunarTrails.xcindex/db.xcindexdb
  121. BIN  GameOSX/DerivedData/LunarTrails/Index/Release/macosx10.8-x86_64/LunarTrails.xcindex/db.xcindexdb-shm
  122. 0  GameOSX/DerivedData/LunarTrails/Index/Release/macosx10.8-x86_64/LunarTrails.xcindex/db.xcindexdb-wal
  123. BIN  GameOSX/DerivedData/LunarTrails/Index/Release/macosx10.8-x86_64/LunarTrails.xcindex/db.xcindexdb.strings-cmp
  124. BIN  GameOSX/DerivedData/LunarTrails/Index/Release/macosx10.8-x86_64/LunarTrails.xcindex/db.xcindexdb.strings-dir
  125. BIN  GameOSX/DerivedData/LunarTrails/Index/Release/macosx10.8-x86_64/LunarTrails.xcindex/db.xcindexdb.strings-file
  126. BIN  GameOSX/DerivedData/LunarTrails/Index/Release/macosx10.8-x86_64/LunarTrails.xcindex/db.xcindexdb.strings-res
  127. BIN  GameOSX/DerivedData/LunarTrails/Index/Release/macosx10.8-x86_64/LunarTrails.xcindex/db.xcindexdb.strings-sym
  128. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/0EB88916-FD40-48D6-8469-86379C276F54.xcactivitylog
  129. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/15283542-D26C-4282-B155-D6A4889D8609.xcactivitylog
  130. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/1A0FF146-2171-4DC3-94E9-71DC68BA3F78.xcactivitylog
  131. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/1BF86636-8885-4E5A-8B70-E9B45F8EEAD4.xcactivitylog
  132. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/23871A6B-227F-4751-85F2-C0DF785E4C44.xcactivitylog
  133. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/2479E7F0-3D3A-47C4-A3C6-31198060FA29.xcactivitylog
  134. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/299E2967-F4FA-4E1B-9BF9-90B560874AEE.xcactivitylog
  135. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/2C4278E7-BCF6-46E6-8431-3FAEF7ED9266.xcactivitylog
  136. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/3B0EE5CB-F703-4917-A589-4965F9C04086.xcactivitylog
  137. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/3EE5E1D1-F3BB-4BF5-B8DA-56A0B6707DDD.xcactivitylog
  138. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/4629744F-4C47-4BE0-B16E-0706D6D8F34B.xcactivitylog
  139. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/484B36F6-6813-4FBB-84C5-32BDFD4F7586.xcactivitylog
  140. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/4FDB510E-CDAB-41D0-AF65-3AEDA7EC66CA.xcactivitylog
  141. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/517EFE16-3050-4DAE-9601-8524B47C0A2A.xcactivitylog
  142. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/53F798A1-8B88-4083-9BDC-E625C70CB5EE.xcactivitylog
  143. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/551B2C85-355B-4E92-AD83-AFC5D8341527.xcactivitylog
  144. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/611D8ADC-826A-4634-B9F0-AFB0E14497F5.xcactivitylog
  145. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/627CD2BB-343C-48CA-B961-1EFDA323FA9A.xcactivitylog
  146. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/92D7AB3B-0ACF-4093-8E7C-4B1744724C18.xcactivitylog
  147. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/9964ED5F-9F0D-4C6E-838C-13832511212C.xcactivitylog
  148. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/9C7CE97F-198F-4D21-8412-09993564F839.xcactivitylog
  149. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/A1A5CDCF-3C0C-42B9-A7D1-09FE5C837149.xcactivitylog
  150. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/A42EE150-EA27-433C-8681-344C4338BBAF.xcactivitylog
  151. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/A65C9789-F222-4063-B012-F9EAA5139222.xcactivitylog
  152. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/A7E3036E-E267-4F3F-B098-04A6690F0FBB.xcactivitylog
  153. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/AA2240D4-783C-4A47-92BE-83654AC68918.xcactivitylog
  154. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/AD61336E-85CF-4690-AD66-5DC95CAA1D51.xcactivitylog
  155. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/B5567058-0425-4A52-8B8E-FEF628C4C335.xcactivitylog
  156. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/BE5509AD-6943-473F-9325-0C03778CC6EC.xcactivitylog
  157. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/BFE4AEF3-9348-44E8-A715-61199DCF1CF6.xcactivitylog
  158. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/C6581AAA-AE13-4230-94FA-56EE6640B220.xcactivitylog
  159. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/CA9B60FE-E535-4AC4-AE78-B38E65F0B9AC.xcactivitylog
  160. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/Cache.db
  161. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/D23A655E-A9F7-4CF0-B433-5B216FBBF54F.xcactivitylog
  162. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/D52C5743-3633-4961-8232-17A9D14E447B.xcactivitylog
  163. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/D97DB6E2-586F-478C-B9E9-2C0071A2AAE8.xcactivitylog
  164. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/D9F27212-0DA2-4940-B0D7-86269CEC02C7.xcactivitylog
  165. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/D9F5CEE0-6701-4ED6-B542-582160C0A552.xcactivitylog
  166. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/EF5574E0-1D73-409F-99C0-EC90D8AF71BE.xcactivitylog
  167. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/F8A28B30-BE39-4486-B1D8-470AD6EB8F6B.xcactivitylog
  168. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/FAD83F49-DE74-4224-9379-A421916520D8.xcactivitylog
  169. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/FB69F172-CA2B-48EA-9827-E9654A4A1D47.xcactivitylog
  170. BIN  GameOSX/DerivedData/LunarTrails/Logs/Build/FD1ED375-E9B2-455F-9BF9-D3B5401AEDD8.xcactivitylog
  171. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/00CA6DD0-4796-4C27-8264-89F7A69ED00E.xcactivitylog
  172. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/08D889D4-E17C-4F65-B987-B8D032C6EE3D.xcactivitylog
  173. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/12D9CC6F-B554-4824-A5AD-1C3735B5A6BB.xcactivitylog
  174. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/214CEAAB-0D6E-47E7-B7F1-89ECA08DFBF2.xcactivitylog
  175. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/5033BD83-BFA8-4AF9-BC52-A0BF7254BE7F.xcactivitylog
  176. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/521DC751-FA81-44BE-B48C-20A43BAADD1B.xcactivitylog
  177. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/58F24155-7BEA-4089-8787-767BA899EDCE.xcactivitylog
  178. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/6F88613E-5BC4-4FF8-BA9A-A57CC7E474C1.xcactivitylog
  179. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/74A1A434-1FE7-4B8C-BCE1-9AB509CB0381.xcactivitylog
  180. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/7989C6A7-18EF-4F78-82CD-87CEE22A8650.xcactivitylog
  181. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/7D57EADB-48A0-447F-8D13-D4260D38DD9B.xcactivitylog
  182. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/8250FE61-3CF9-4232-ABBB-D7A056F3E477.xcactivitylog
  183. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/86CCCA8B-34C8-409D-BF2D-37D6CD668956.xcactivitylog
  184. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/8BE7B7B5-148C-4783-A16E-3B737320DA5A.xcactivitylog
  185. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/94F86CCD-C75D-4B9B-9E6C-113BAF5FED21.xcactivitylog
  186. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/97B9238A-FEF1-462B-BBCB-24858825251F.xcactivitylog
  187. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/A590D294-17ED-4507-BA43-0039D5A1C893.xcactivitylog
  188. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/BE110994-7BAD-4DC8-AF5F-7BD179194EBE.xcactivitylog
  189. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/CE3AA7EA-4620-4F01-882C-A02CEEC50C5C.xcactivitylog
  190. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/Cache.db
  191. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/D391E72A-E2FF-4EFC-A810-E9C98B79621F.xcactivitylog
  192. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/E315CEF9-B833-4581-A41F-9781C81AAD0B.xcactivitylog
  193. BIN  GameOSX/DerivedData/LunarTrails/Logs/Debug/EB8C24A8-51C3-4C5B-A3B0-215AC59681E5.xcactivitylog
  194. BIN  GameOSX/DerivedData/LunarTrails/Logs/Issues/78BFF1ED-92C4-43D6-9770-EA9A2B0AB8DB.xcactivitylog
  195. BIN  GameOSX/DerivedData/LunarTrails/Logs/Issues/Cache.db
  196. BIN  GameOSX/DerivedData/LunarTrails/TextIndex/text-index.idx
  197. +8 −0 GameOSX/DerivedData/LunarTrails/info.plist
  198. +14 −0 GameOSX/DerivedData/LunarTrails/scm.plist
  199. +574 −0 GameOSX/LunarTrails.xcodeproj/project.pbxproj
  200. +7 −0 GameOSX/LunarTrails.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  201. BIN  ...X/LunarTrails.xcodeproj/project.xcworkspace/xcuserdata/sebretina.xcuserdatad/UserInterfaceState.xcuserstate
  202. +20 −0 GameOSX/LunarTrails.xcodeproj/xcuserdata/sebretina.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  203. +96 −0 GameOSX/LunarTrails.xcodeproj/xcuserdata/sebretina.xcuserdatad/xcschemes/LunarTrails.xcscheme
  204. +27 −0 GameOSX/LunarTrails.xcodeproj/xcuserdata/sebretina.xcuserdatad/xcschemes/xcschememanagement.plist
  205. +19 −0 GameOSX/LunarTrails/AppDelegate.h
  206. +40 −0 GameOSX/LunarTrails/AppDelegate.m
  207. +34 −0 GameOSX/LunarTrails/LunarTrails-Info.plist
  208. +7 −0 GameOSX/LunarTrails/LunarTrails-Prefix.pch
  209. +29 −0 GameOSX/LunarTrails/en.lproj/Credits.rtf
  210. +2 −0  GameOSX/LunarTrails/en.lproj/InfoPlist.strings
  211. +3,449 −0 GameOSX/LunarTrails/en.lproj/MainMenu.xib
  212. +14 −0 GameOSX/LunarTrails/main.m
  213. +22 −0 GameOSX/LunarTrailsTests/LunarTrailsTests-Info.plist
  214. +13 −0 GameOSX/LunarTrailsTests/LunarTrailsTests.h
  215. +32 −0 GameOSX/LunarTrailsTests/LunarTrailsTests.m
  216. +2 −0  GameOSX/LunarTrailsTests/en.lproj/InfoPlist.strings
  217. BIN  GameOSXCordova/CordovaMac/Cordova.icns
  218. +354 −0 GameOSXCordova/CordovaMac/CordovaMac.xcodeproj/project.pbxproj
  219. +7 −0 GameOSXCordova/CordovaMac/CordovaMac.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  220. BIN  ...ac/CordovaMac.xcodeproj/project.xcworkspace/xcuserdata/sebretina.xcuserdatad/UserInterfaceState.xcuserstate
  221. +86 −0 GameOSXCordova/CordovaMac/CordovaMac.xcodeproj/xcuserdata/sebretina.xcuserdatad/xcschemes/CordovaMac.xcscheme
  222. +22 −0 ...Cordova/CordovaMac/CordovaMac.xcodeproj/xcuserdata/sebretina.xcuserdatad/xcschemes/xcschememanagement.plist
  223. +32 −0 GameOSXCordova/CordovaMac/CordovaMac/AppDelegate.h
  224. +49 −0 GameOSXCordova/CordovaMac/CordovaMac/AppDelegate.m
  225. +29 −0 GameOSXCordova/CordovaMac/CordovaMac/Commands/CDVConsole.h
  226. +75 −0 GameOSXCordova/CordovaMac/CordovaMac/Commands/CDVConsole.m
  227. +29 −0 GameOSXCordova/CordovaMac/CordovaMac/Commands/CDVNotification.h
  228. +78 −0 GameOSXCordova/CordovaMac/CordovaMac/Commands/CDVNotification.m
  229. +29 −0 GameOSXCordova/CordovaMac/CordovaMac/Commands/CDVSound.h
  230. +79 −0 GameOSXCordova/CordovaMac/CordovaMac/Commands/CDVSound.m
  231. +22 −0 GameOSXCordova/CordovaMac/CordovaMac/Constants.h
  232. +35 −0 GameOSXCordova/CordovaMac/CordovaMac/ContentView.h
  233. +64 −0 GameOSXCordova/CordovaMac/CordovaMac/ContentView.m
  234. +34 −0 GameOSXCordova/CordovaMac/CordovaMac/CordovaMac-Info.plist
  235. +32 −0 GameOSXCordova/CordovaMac/CordovaMac/CordovaMac-Prefix.pch
  236. +37 −0 GameOSXCordova/CordovaMac/CordovaMac/Utils.h
  237. +94 −0 GameOSXCordova/CordovaMac/CordovaMac/Utils.m
  238. +34 −0 GameOSXCordova/CordovaMac/CordovaMac/WebViewDelegate.h
  239. +80 −0 GameOSXCordova/CordovaMac/CordovaMac/WebViewDelegate.m
  240. +18 −0 GameOSXCordova/CordovaMac/CordovaMac/en.lproj/Credits.rtf
  241. +23 −0 GameOSXCordova/CordovaMac/CordovaMac/en.lproj/InfoPlist.strings
  242. +3,533 −0 GameOSXCordova/CordovaMac/CordovaMac/en.lproj/MainMenu.xib
  243. +25 −0 GameOSXCordova/CordovaMac/CordovaMac/main.m
  244. BIN  ...a/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/CordovaMac-all-target-headers.hmap
  245. BIN  ...Data/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/CordovaMac-generated-files.hmap
  246. BIN  ...a/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/CordovaMac-own-target-headers.hmap
  247. BIN  ...Data/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/CordovaMac-project-headers.hmap
  248. +18 −0 ...ordovaMac/DerivedData/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/CordovaMac.dep
  249. BIN  ...rdovaMac/DerivedData/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/CordovaMac.hmap
  250. +18 −0 ...rdovaMac/DerivedData/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/CordovaMac~.dep
  251. +4 −0 .../CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/AppDelegate.d
  252. BIN  ...ordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/AppDelegate.dia
  253. BIN  .../CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/AppDelegate.o
  254. +3 −0  ...a/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/CDVConsole.d
  255. BIN  ...CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/CDVConsole.dia
  256. BIN  ...a/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/CDVConsole.o
  257. +3 −0  ...dovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/CDVNotification.d
  258. BIN  ...vaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/CDVNotification.dia
  259. BIN  ...dovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/CDVNotification.o
  260. +3 −0  ...ata/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/CDVSound.d
  261. BIN  ...a/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/CDVSound.dia
  262. BIN  ...ata/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/CDVSound.o
  263. +5 −0 .../CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/ContentView.d
  264. BIN  ...ordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/ContentView.dia
  265. BIN  .../CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/ContentView.o
  266. +8 −0 ...c/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/CordovaMac.LinkFileList
  267. +2 −0  ...edData/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/Utils.d
  268. BIN  ...Data/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/Utils.dia
  269. BIN  ...edData/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/Utils.o
  270. +6 −0 ...dovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/WebViewDelegate.d
  271. BIN  ...vaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/WebViewDelegate.dia
  272. BIN  ...dovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/WebViewDelegate.o
  273. +2 −0  ...vedData/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/main.d
  274. BIN  ...dData/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/main.dia
  275. BIN  ...vedData/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/Objects-normal/x86_64/main.o
  276. +452 −0 ...rdovaMac/DerivedData/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/build-state.dat
  277. +412 −0 ...dovaMac/DerivedData/CordovaMac/Build/Intermediates/CordovaMac.build/Debug/CordovaMac.build/build-state~.dat
  278. +4 −0 ...ild/Intermediates/PrecompiledHeaders/CordovaMac-Prefix-dkotpwmuyrigbqddglxnfnwacwtl/CordovaMac-Prefix.pch.d
  279. BIN  ...d/Intermediates/PrecompiledHeaders/CordovaMac-Prefix-dkotpwmuyrigbqddglxnfnwacwtl/CordovaMac-Prefix.pch.dia
  280. BIN  ...d/Intermediates/PrecompiledHeaders/CordovaMac-Prefix-dkotpwmuyrigbqddglxnfnwacwtl/CordovaMac-Prefix.pch.pth
  281. +26 −0 ...s/PrecompiledHeaders/CordovaMac-Prefix-dkotpwmuyrigbqddglxnfnwacwtl/CordovaMac-Prefix.pch.pth.hash-criteria
  282. +50 −0 GameOSXCordova/CordovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Info.plist
  283. BIN  GameOSXCordova/CordovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/MacOS/CordovaMac
  284. +1 −0  GameOSXCordova/CordovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/PkgInfo
  285. BIN  ...rdova/CordovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/Cordova.icns
  286. +18 −0 ...rdovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/en.lproj/Credits.rtf
  287. BIN  ...ac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/en.lproj/InfoPlist.strings
  288. BIN  ...dovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/en.lproj/MainMenu.nib
  289. +223 −0 ...CordovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/InfoDisplay.js
  290. +32 −0 .../CordovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/KeyTracker.js
  291. +294 −0 ...dova/CordovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/Lander.js
  292. +413 −0 ...rdovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/LandscapeData.js
  293. +70 −0 ...dova/CordovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/Sounds.js
  294. +89 −0 ...ovaMac/DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/TouchController.js
  295. BIN  ...DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/bender_italic-webfont.eot
  296. +219 −0 ...DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/bender_italic-webfont.svg
  297. BIN  ...DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/bender_italic-webfont.ttf
  298. BIN  ...erivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/bender_italic-webfont.woff
  299. BIN  .../DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/bender_light-webfont.eot
  300. +219 −0 .../DerivedData/CordovaMac/Build/Products/Debug/CordovaMac.app/Contents/Resources/www/bender_light-webfont.svg
Sorry, we could not display the entire diff because too many files (361) changed.
View
1  Arduino/ArcadeController/ArcadeController.ino
@@ -0,0 +1 @@
+
View
53 Arduino/ArcadeControllerKeyboard/ArcadeControllerKeyboard.ino
@@ -0,0 +1,53 @@
+
+
+int thrustPin = A0;
+
+
+float topValue = 0;
+float bottomValue = 1024;
+float currentReading;
+float smoothReading;
+
+int currentKey = 0;
+int counter =0;
+
+void setup() {
+
+ Serial.begin(9600);
+ Keyboard.begin();
+ Mouse.end();
+
+}
+
+void loop() {
+ currentReading = analogRead(thrustPin);
+
+ if(topValue<currentReading) topValue = currentReading;
+ if(bottomValue>currentReading) bottomValue = currentReading;
+
+ smoothReading += ((currentReading-smoothReading)*0.1f);
+
+ int newKey = round(map(smoothReading, bottomValue, topValue, -1, 11));
+ if(newKey<0) newKey = 0;
+ if(newKey>9) newKey = 9;
+
+
+
+ if(newKey!=currentKey) {
+
+ currentKey = newKey;
+ Keyboard.releaseAll();
+ Keyboard.press(48+currentKey);
+ Serial.println(newKey);
+ counter = 0;
+ } else if (counter>5) {
+ Keyboard.releaseAll();
+
+ }
+
+ counter++;
+
+ //Mouse.move(0,analogRead(thrustPin));
+ delay(10);
+
+}
View
34 Arduino/ArcadeControllerMouse/ArcadeControllerMouse.ino
@@ -0,0 +1,34 @@
+
+
+int thrustPin = A0;
+float currentReading;
+float smoothReading;
+
+int currentMouseY;
+
+void setup() {
+
+ Serial.begin(9600);
+
+
+}
+
+void loop() {
+ currentReading = analogRead(thrustPin);
+ smoothReading += ((currentReading-smoothReading)*0.1f);
+ Serial.println(smoothReading);
+
+ int newMouseY = round(smoothReading);
+ if(newMouseY!=currentMouseY) {
+ Mouse.move(0, newMouseY - currentMouseY);
+ currentMouseY = newMouseY;
+
+
+
+ }
+
+
+ //Mouse.move(0,analogRead(thrustPin));
+ delay(6);
+
+}
View
91 Arduino/DisplayTest/DisplayTest.ino
@@ -0,0 +1,91 @@
+/***************************************************
+ This is a library for our I2C LED Backpacks
+
+ Designed specifically to work with the Adafruit LED 7-Segment backpacks
+ ----> http://www.adafruit.com/products/881
+ ----> http://www.adafruit.com/products/880
+ ----> http://www.adafruit.com/products/879
+ ----> http://www.adafruit.com/products/878
+
+ These displays use I2C to communicate, 2 pins are required to
+ interface. There are multiple selectable I2C addresses. For backpacks
+ with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
+ with 3 Address Select pins: 0x70 thru 0x77
+
+ Adafruit invests time and resources providing this open source code,
+ please support Adafruit and open-source hardware by purchasing
+ products from Adafruit!
+
+ Written by Limor Fried/Ladyada for Adafruit Industries.
+ BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+#include <Wire.h>
+#include "Adafruit_7Seg.h"
+#include "Adafruit_GFX.h"
+
+Adafruit_7segment matrix = Adafruit_7segment();
+
+void setup() {
+ Serial.begin(9600);
+ Serial.println("7 Segment Backpack Test");
+
+ matrix.begin(0x70);
+ matrix.setBrightness(15);
+
+}
+
+void loop() {
+
+
+ // try to print a number thats too long
+
+
+ matrix.print(10000, DEC);
+ matrix.writeDisplay();
+ delay(500);
+
+
+ // print a hex number
+ matrix.print(0xFEED, HEX);
+ matrix.writeDisplay();
+ delay(500);
+
+ // print a floating point
+ /* this isnt working yet, still hacking on it!
+ matrix.print(12.34);
+ matrix.writeDisplay();
+ delay(500);
+ */
+
+ // print with print/println
+ for (uint16_t counter = 0; counter < 9999; counter++) {
+ matrix.println(counter);
+ matrix.writeDisplay();
+ //matrix.setBrightness((sin((float)counter*0.01f)+1.0f)*7.5f);
+
+ delay(1);
+ }
+
+ // method #2 - draw each digit
+ uint16_t blinkcounter = 0;
+ boolean drawDots = false;
+ for (uint16_t counter = 0; counter < 9999; counter ++) {
+ matrix.writeDigitNum(0, (counter / 1000), drawDots);
+ matrix.writeDigitNum(1, (counter / 100) % 10, drawDots);
+ matrix.drawColon(drawDots);
+ matrix.writeDigitNum(3, (counter / 10) % 10, drawDots);
+ matrix.writeDigitNum(4, counter % 10, drawDots);
+
+ blinkcounter+=50;
+ if (blinkcounter < 500) {
+ drawDots = false;
+ } else if (blinkcounter < 1000) {
+ drawDots = true;
+ } else {
+ blinkcounter = 0;
+ }
+ matrix.writeDisplay();
+ delay(10);
+ }
+}
View
1  Arduino/LEDDisplay1/LEDDisplay1.ino
@@ -0,0 +1 @@
+
View
81 Arduino/MotorTest/MotorTest.ino
@@ -0,0 +1,81 @@
+#include <AccelStepper.h>
+
+
+
+//AccelStepper motorA(AccelStepper::DRIVER, 2, 3);
+//AccelStepper motorB(AccelStepper::DRIVER, 2, 3);
+
+
+int PIN_XENABLE = 6;
+int PIN_XSTEP = 2;
+int PIN_XDIRECTION = 3;
+
+int PIN_YENABLE = 7;
+int PIN_YSTEP = 4;
+int PIN_YDIRECTION = 5;
+
+
+int delayTime = 1;
+int counter = 0;
+boolean stepHigh = true;
+boolean enableHigh = true;
+boolean dir = LOW;
+
+float speed = 600;
+float target = 6000;
+
+void setup() {
+
+
+ pinMode(PIN_XENABLE, OUTPUT);
+ pinMode(PIN_XSTEP, OUTPUT);
+ pinMode(PIN_XDIRECTION, OUTPUT);
+ digitalWrite(PIN_XENABLE, LOW);
+ digitalWrite(PIN_XSTEP, LOW);
+ digitalWrite(PIN_XDIRECTION, LOW);
+
+ pinMode(PIN_YENABLE, OUTPUT);
+ pinMode(PIN_YSTEP, OUTPUT);
+ pinMode(PIN_YDIRECTION, OUTPUT);
+ digitalWrite(PIN_YENABLE, LOW);
+ digitalWrite(PIN_YSTEP, LOW);
+ digitalWrite(PIN_YDIRECTION, LOW);
+
+ //Serial.begin(9600);
+
+}
+
+void loop() {
+
+
+ digitalWrite(PIN_XENABLE, HIGH); // HIGH IS ENABLED
+ digitalWrite(PIN_YENABLE, HIGH); // HIGH IS ENABLED
+
+ digitalWrite(PIN_XDIRECTION, dir);
+ digitalWrite(PIN_YDIRECTION, dir);
+
+ //make the step pulse
+ digitalWrite(PIN_XSTEP,HIGH);
+ digitalWrite(PIN_YSTEP,HIGH);
+ delayMicroseconds(2); // it should be 5 usecs but I found that 1 usec actually makes a 5 usec pulse.
+ digitalWrite(PIN_XSTEP,LOW);
+ digitalWrite(PIN_YSTEP,LOW);
+
+ // wait 500 usec (1/2 mil) between steps
+ delayMicroseconds(int(speed));
+
+ speed += (float(target - speed)*0.001f);
+
+
+ counter ++;
+
+ // after 1000 steps change direction
+ if(counter>100000) {
+ target = 2000;
+ //dir=!dir;
+
+ }
+
+
+
+}
View
90 Arduino/MotorTest2/MotorTest2.ino
@@ -0,0 +1,90 @@
+
+
+
+ ////////////////////////////////
+ //TWO WIRE STEP/DIR DRIVER BOARD CODE
+ int Motor1StepPin = 2;
+ int Motor1DirPin = 3;
+
+ int Motor2StepPin = 4;
+ int Motor2DirPin = 5;
+
+ //The number of steps required for your stepper to make one revolution. (Don't forget to take into
+ //account the settings on your driver board. i.e. Microstepping, half stepping etc.)
+ float steps = 96;
+ //Set the travel speed for your stepper motors here. (In Rev/Min)
+ //Note: There is a limit to how fast or slow this code is able to spin the stepper motors.
+ //You can try experimenting with the "delayMicroseconds" code if you need different speeds.
+ int altSpeed=60;
+ int azSpeed=60;
+
+ ////////////////////////////////
+
+ float Motor1Delay, Motor2Delay, doSteps;
+
+void setup()
+{
+ Serial.begin(9600);
+ ////////////////////////////////
+ //TWO WIRE STEP/DIR DRIVER BOARD CODE
+ pinMode(Motor1StepPin, OUTPUT);
+ pinMode(Motor1DirPin, OUTPUT);
+ pinMode(Motor2StepPin, OUTPUT);
+ pinMode(Motor2DirPin, OUTPUT);
+ Motor1Delay = ( 1000000 * ( 60 / (steps * altSpeed) ) ) / 2;
+ Motor2Delay = ( 1000000 * ( 60 / (steps * azSpeed) ) ) / 2;
+ ////////////////////////////////
+
+ pinMode(6, OUTPUT);
+// pinMode(7, OUTPUT);
+// pinMode(13, OUTPUT);
+
+
+
+}
+
+void loop()
+{
+
+ delay(1000);
+ digitalWrite(6, HIGH);
+ delay(100);
+
+ moveToPosition(1, 0, -steps * 1);
+ moveToPosition(1, 0, steps * 1);
+ moveToPosition(1, -steps * 1, 0);
+ moveToPosition(1, steps * 1, 0);
+
+ digitalWrite(6, LOW);
+
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//This code moves the stepper motors
+void moveToPosition(int limitSearch, long altsteps, long azsteps){
+
+ Serial.println("altsteps");
+ Serial.println(altsteps);
+ Serial.println("azsteps");
+ Serial.println(azsteps);
+
+ ////////////////////////////////
+ //TWO WIRE STEP/DIR DRIVER BOARD CODE
+ if (abs(azsteps)==azsteps){digitalWrite(Motor2DirPin, HIGH);}else{digitalWrite(Motor2DirPin, LOW);}
+ if (abs(altsteps)==altsteps){digitalWrite(Motor1DirPin, HIGH);}else{digitalWrite(Motor1DirPin, LOW);}
+
+// for (doSteps=1; doSteps <= abs(azsteps); doSteps++){
+// digitalWrite(Motor2StepPin, HIGH);
+// delayMicroseconds(int(Motor2Delay));
+// digitalWrite(Motor2StepPin, LOW);
+// delayMicroseconds(int(Motor2Delay));
+// }
+
+ for (doSteps=1; doSteps <= abs(altsteps); doSteps++){
+ digitalWrite(Motor1StepPin, LOW);
+ delayMicroseconds(5);
+ digitalWrite(Motor1StepPin, HIGH);
+ delayMicroseconds(int(Motor1Delay));
+ }
+
+}
View
42 Arduino/MotorTest3/MotorTest3.ino
@@ -0,0 +1,42 @@
+//Define pins;
+#define CLK_PIN 2
+#define ENABLE_PIN 6
+#define RESET_PIN 8
+#define CCW_PIN 3
+
+void setup() {
+// Make all the pins OUTPUT and set them to LOW
+for (int i = 8 ; i <= 11 ; i++) {
+pinMode(i, OUTPUT);
+digitalWrite(i, HIGH);
+}
+
+// This is the order according to the application notes
+digitalWrite(RESET_PIN, LOW);
+digitalWrite(ENABLE_PIN, LOW);
+}
+
+int del = 750;
+int counter = 0;
+int dir = LOW;
+
+void loop() {
+// Send out a clock signal. switch the direction bit every 2000 clocks.
+digitalWrite(CLK_PIN, HIGH);
+delayMicroseconds(del);
+digitalWrite(CLK_PIN, LOW);
+delayMicroseconds(del);
+counter++;
+if (counter == 2000) {
+if (dir == LOW) {
+dir = HIGH;
+}
+else {
+dir = LOW;
+}
+digitalWrite(CCW_PIN, dir);
+counter = 0;
+}
+}
+
+
View
37 Arduino/MotorTest4/MotorTest4.ino
@@ -0,0 +1,37 @@
+#include <AccelStepper.h>
+
+int potPin = A0;
+
+int Motor1StepPin = 2;
+int Motor1DirPin = 3;
+
+int Motor2StepPin = 4;
+int Motor2DirPin = 5;
+
+AccelStepper motorA(AccelStepper::DRIVER, Motor1StepPin, Motor1DirPin);
+//AccelStepper motorB(AccelStepper::DRIVER, 2, 3);
+
+void setup() {
+ //Serial.begin(9600);
+
+ motorA.setMinPulseWidth(1);
+ motorA.setMaxSpeed(40000.0);
+ motorA.setAcceleration(5000.0);
+ motorA.setSpeed(10000);
+ motorA.moveTo(10000);
+
+}
+
+
+
+void loop() {
+ //int potValue = analogRead(potPin);
+ if (motorA.distanceToGo() == 0)
+ motorA.moveTo(-motorA.currentPosition());
+ motorA.run();
+
+ //Serial.println(potValue);
+
+
+}
+
View
563 Arduino/libraries/AFMotor/AFMotor.cpp
@@ -0,0 +1,563 @@
+// Adafruit Motor shield library
+// copyright Adafruit Industries LLC, 2009
+// this code is public domain, enjoy!
+
+
+#if (ARDUINO >= 100)
+ #include "Arduino.h"
+#else
+ #include <avr/io.h>
+ #include "WProgram.h"
+#endif
+
+#include "AFMotor.h"
+
+static uint8_t latch_state;
+
+#if (MICROSTEPS == 8)
+uint8_t microstepcurve[] = {0, 50, 98, 142, 180, 212, 236, 250, 255};
+#elif (MICROSTEPS == 16)
+uint8_t microstepcurve[] = {0, 25, 50, 74, 98, 120, 141, 162, 180, 197, 212, 225, 236, 244, 250, 253, 255};
+#endif
+
+AFMotorController::AFMotorController(void) {
+}
+
+void AFMotorController::enable(void) {
+ // setup the latch
+ /*
+ LATCH_DDR |= _BV(LATCH);
+ ENABLE_DDR |= _BV(ENABLE);
+ CLK_DDR |= _BV(CLK);
+ SER_DDR |= _BV(SER);
+ */
+ pinMode(MOTORLATCH, OUTPUT);
+ pinMode(MOTORENABLE, OUTPUT);
+ pinMode(MOTORDATA, OUTPUT);
+ pinMode(MOTORCLK, OUTPUT);
+
+ latch_state = 0;
+
+ latch_tx(); // "reset"
+
+ //ENABLE_PORT &= ~_BV(ENABLE); // enable the chip outputs!
+ digitalWrite(MOTORENABLE, LOW);
+}
+
+
+void AFMotorController::latch_tx(void) {
+ uint8_t i;
+
+ //LATCH_PORT &= ~_BV(LATCH);
+ digitalWrite(MOTORLATCH, LOW);
+
+ //SER_PORT &= ~_BV(SER);
+ digitalWrite(MOTORDATA, LOW);
+
+ for (i=0; i<8; i++) {
+ //CLK_PORT &= ~_BV(CLK);
+ digitalWrite(MOTORCLK, LOW);
+
+ if (latch_state & _BV(7-i)) {
+ //SER_PORT |= _BV(SER);
+ digitalWrite(MOTORDATA, HIGH);
+ } else {
+ //SER_PORT &= ~_BV(SER);
+ digitalWrite(MOTORDATA, LOW);
+ }
+ //CLK_PORT |= _BV(CLK);
+ digitalWrite(MOTORCLK, HIGH);
+ }
+ //LATCH_PORT |= _BV(LATCH);
+ digitalWrite(MOTORLATCH, HIGH);
+}
+
+static AFMotorController MC;
+
+
+/******************************************
+ MOTORS
+******************************************/
+inline void initPWM1(uint8_t freq) {
+#if defined(__AVR_ATmega8__) || \
+ defined(__AVR_ATmega48__) || \
+ defined(__AVR_ATmega88__) || \
+ defined(__AVR_ATmega168__) || \
+ defined(__AVR_ATmega328P__)
+ // use PWM from timer2A on PB3 (Arduino pin #11)
+ TCCR2A |= _BV(COM2A1) | _BV(WGM20) | _BV(WGM21); // fast PWM, turn on oc2a
+ TCCR2B = freq & 0x7;
+ OCR2A = 0;
+#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+ // on arduino mega, pin 11 is now PB5 (OC1A)
+ TCCR1A |= _BV(COM1A1) | _BV(WGM10); // fast PWM, turn on oc1a
+ TCCR1B = (freq & 0x7) | _BV(WGM12);
+ OCR1A = 0;
+#else
+ #error "This chip is not supported!"
+#endif
+ pinMode(11, OUTPUT);
+}
+
+inline void setPWM1(uint8_t s) {
+#if defined(__AVR_ATmega8__) || \
+ defined(__AVR_ATmega48__) || \
+ defined(__AVR_ATmega88__) || \
+ defined(__AVR_ATmega168__) || \
+ defined(__AVR_ATmega328P__)
+ // use PWM from timer2A on PB3 (Arduino pin #11)
+ OCR2A = s;
+#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+ // on arduino mega, pin 11 is now PB5 (OC1A)
+ OCR1A = s;
+#else
+ #error "This chip is not supported!"
+#endif
+}
+
+inline void initPWM2(uint8_t freq) {
+#if defined(__AVR_ATmega8__) || \
+ defined(__AVR_ATmega48__) || \
+ defined(__AVR_ATmega88__) || \
+ defined(__AVR_ATmega168__) || \
+ defined(__AVR_ATmega328P__)
+ // use PWM from timer2B (pin 3)
+ TCCR2A |= _BV(COM2B1) | _BV(WGM20) | _BV(WGM21); // fast PWM, turn on oc2b
+ TCCR2B = freq & 0x7;
+ OCR2B = 0;
+#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+ // on arduino mega, pin 3 is now PE5 (OC3C)
+ TCCR3A |= _BV(COM1C1) | _BV(WGM10); // fast PWM, turn on oc3c
+ TCCR3B = (freq & 0x7) | _BV(WGM12);
+ OCR3C = 0;
+#else
+ #error "This chip is not supported!"
+#endif
+
+ pinMode(3, OUTPUT);
+}
+
+inline void setPWM2(uint8_t s) {
+#if defined(__AVR_ATmega8__) || \
+ defined(__AVR_ATmega48__) || \
+ defined(__AVR_ATmega88__) || \
+ defined(__AVR_ATmega168__) || \
+ defined(__AVR_ATmega328P__)
+ // use PWM from timer2A on PB3 (Arduino pin #11)
+ OCR2B = s;
+#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+ // on arduino mega, pin 11 is now PB5 (OC1A)
+ OCR3C = s;
+#else
+ #error "This chip is not supported!"
+#endif
+}
+
+inline void initPWM3(uint8_t freq) {
+#if defined(__AVR_ATmega8__) || \
+ defined(__AVR_ATmega48__) || \
+ defined(__AVR_ATmega88__) || \
+ defined(__AVR_ATmega168__) || \
+ defined(__AVR_ATmega328P__)
+ // use PWM from timer0A / PD6 (pin 6)
+ TCCR0A |= _BV(COM0A1) | _BV(WGM00) | _BV(WGM01); // fast PWM, turn on OC0A
+ //TCCR0B = freq & 0x7;
+ OCR0A = 0;
+#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+ // on arduino mega, pin 6 is now PH3 (OC4A)
+ TCCR4A |= _BV(COM1A1) | _BV(WGM10); // fast PWM, turn on oc4a
+ TCCR4B = (freq & 0x7) | _BV(WGM12);
+ //TCCR4B = 1 | _BV(WGM12);
+ OCR4A = 0;
+#else
+ #error "This chip is not supported!"
+#endif
+ pinMode(6, OUTPUT);
+}
+
+inline void setPWM3(uint8_t s) {
+#if defined(__AVR_ATmega8__) || \
+ defined(__AVR_ATmega48__) || \
+ defined(__AVR_ATmega88__) || \
+ defined(__AVR_ATmega168__) || \
+ defined(__AVR_ATmega328P__)
+ // use PWM from timer0A on PB3 (Arduino pin #6)
+ OCR0A = s;
+#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+ // on arduino mega, pin 6 is now PH3 (OC4A)
+ OCR4A = s;
+#else
+ #error "This chip is not supported!"
+#endif
+}
+
+
+
+inline void initPWM4(uint8_t freq) {
+#if defined(__AVR_ATmega8__) || \
+ defined(__AVR_ATmega48__) || \
+ defined(__AVR_ATmega88__) || \
+ defined(__AVR_ATmega168__) || \
+ defined(__AVR_ATmega328P__)
+ // use PWM from timer0B / PD5 (pin 5)
+ TCCR0A |= _BV(COM0B1) | _BV(WGM00) | _BV(WGM01); // fast PWM, turn on oc0a
+ //TCCR0B = freq & 0x7;
+ OCR0B = 0;
+#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+ // on arduino mega, pin 5 is now PE3 (OC3A)
+ TCCR3A |= _BV(COM1A1) | _BV(WGM10); // fast PWM, turn on oc3a
+ TCCR3B = (freq & 0x7) | _BV(WGM12);
+ //TCCR4B = 1 | _BV(WGM12);
+ OCR3A = 0;
+#else
+ #error "This chip is not supported!"
+#endif
+ pinMode(5, OUTPUT);
+}
+
+inline void setPWM4(uint8_t s) {
+#if defined(__AVR_ATmega8__) || \
+ defined(__AVR_ATmega48__) || \
+ defined(__AVR_ATmega88__) || \
+ defined(__AVR_ATmega168__) || \
+ defined(__AVR_ATmega328P__)
+ // use PWM from timer0A on PB3 (Arduino pin #6)
+ OCR0B = s;
+#elif defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
+ // on arduino mega, pin 6 is now PH3 (OC4A)
+ OCR3A = s;
+#else
+ #error "This chip is not supported!"
+#endif
+}
+
+AF_DCMotor::AF_DCMotor(uint8_t num, uint8_t freq) {
+ motornum = num;
+ pwmfreq = freq;
+
+ MC.enable();
+
+ switch (num) {
+ case 1:
+ latch_state &= ~_BV(MOTOR1_A) & ~_BV(MOTOR1_B); // set both motor pins to 0
+ MC.latch_tx();
+ initPWM1(freq);
+ break;
+ case 2:
+ latch_state &= ~_BV(MOTOR2_A) & ~_BV(MOTOR2_B); // set both motor pins to 0
+ MC.latch_tx();
+ initPWM2(freq);
+ break;
+ case 3:
+ latch_state &= ~_BV(MOTOR3_A) & ~_BV(MOTOR3_B); // set both motor pins to 0
+ MC.latch_tx();
+ initPWM3(freq);
+ break;
+ case 4:
+ latch_state &= ~_BV(MOTOR4_A) & ~_BV(MOTOR4_B); // set both motor pins to 0
+ MC.latch_tx();
+ initPWM4(freq);
+ break;
+ }
+}
+
+void AF_DCMotor::run(uint8_t cmd) {
+ uint8_t a, b;
+ switch (motornum) {
+ case 1:
+ a = MOTOR1_A; b = MOTOR1_B; break;
+ case 2:
+ a = MOTOR2_A; b = MOTOR2_B; break;
+ case 3:
+ a = MOTOR3_A; b = MOTOR3_B; break;
+ case 4:
+ a = MOTOR4_A; b = MOTOR4_B; break;
+ default:
+ return;
+ }
+
+ switch (cmd) {
+ case FORWARD:
+ latch_state |= _BV(a);
+ latch_state &= ~_BV(b);
+ MC.latch_tx();
+ break;
+ case BACKWARD:
+ latch_state &= ~_BV(a);
+ latch_state |= _BV(b);
+ MC.latch_tx();
+ break;
+ case RELEASE:
+ latch_state &= ~_BV(a);
+ latch_state &= ~_BV(b);
+ MC.latch_tx();
+ break;
+ }
+}
+
+void AF_DCMotor::setSpeed(uint8_t speed) {
+ switch (motornum) {
+ case 1:
+ setPWM1(speed); break;
+ case 2:
+ setPWM2(speed); break;
+ case 3:
+ setPWM3(speed); break;
+ case 4:
+ setPWM4(speed); break;
+ }
+}
+
+/******************************************
+ STEPPERS
+******************************************/
+
+AF_Stepper::AF_Stepper(uint16_t steps, uint8_t num) {
+ MC.enable();
+
+ revsteps = steps;
+ steppernum = num;
+ currentstep = 0;
+
+ if (steppernum == 1) {
+ latch_state &= ~_BV(MOTOR1_A) & ~_BV(MOTOR1_B) &
+ ~_BV(MOTOR2_A) & ~_BV(MOTOR2_B); // all motor pins to 0
+ MC.latch_tx();
+
+ // enable both H bridges
+ pinMode(11, OUTPUT);
+ pinMode(3, OUTPUT);
+ digitalWrite(11, HIGH);
+ digitalWrite(3, HIGH);
+
+ // use PWM for microstepping support
+ initPWM1(MOTOR12_64KHZ);
+ initPWM2(MOTOR12_64KHZ);
+ setPWM1(255);
+ setPWM2(255);
+
+ } else if (steppernum == 2) {
+ latch_state &= ~_BV(MOTOR3_A) & ~_BV(MOTOR3_B) &
+ ~_BV(MOTOR4_A) & ~_BV(MOTOR4_B); // all motor pins to 0
+ MC.latch_tx();
+
+ // enable both H bridges
+ pinMode(5, OUTPUT);
+ pinMode(6, OUTPUT);
+ digitalWrite(5, HIGH);
+ digitalWrite(6, HIGH);
+
+ // use PWM for microstepping support
+ // use PWM for microstepping support
+ initPWM3(1);
+ initPWM4(1);
+ setPWM3(255);
+ setPWM4(255);
+ }
+}
+
+void AF_Stepper::setSpeed(uint16_t rpm) {
+ usperstep = 60000000 / (revsteps * rpm);
+ steppingcounter = 0;
+}
+
+void AF_Stepper::release(void) {
+ if (steppernum == 1) {
+ latch_state &= ~_BV(MOTOR1_A) & ~_BV(MOTOR1_B) &
+ ~_BV(MOTOR2_A) & ~_BV(MOTOR2_B); // all motor pins to 0
+ MC.latch_tx();
+ } else if (steppernum == 2) {
+ latch_state &= ~_BV(MOTOR3_A) & ~_BV(MOTOR3_B) &
+ ~_BV(MOTOR4_A) & ~_BV(MOTOR4_B); // all motor pins to 0
+ MC.latch_tx();
+ }
+}
+
+void AF_Stepper::step(uint16_t steps, uint8_t dir, uint8_t style) {
+ uint32_t uspers = usperstep;
+ uint8_t ret = 0;
+
+ if (style == INTERLEAVE) {
+ uspers /= 2;
+ }
+ else if (style == MICROSTEP) {
+ uspers /= MICROSTEPS;
+ steps *= MICROSTEPS;
+#ifdef MOTORDEBUG
+ Serial.print("steps = "); Serial.println(steps, DEC);
+#endif
+ }
+
+ while (steps--) {
+ ret = onestep(dir, style);
+ delay(uspers/1000); // in ms
+ steppingcounter += (uspers % 1000);
+ if (steppingcounter >= 1000) {
+ delay(1);
+ steppingcounter -= 1000;
+ }
+ }
+ if (style == MICROSTEP) {
+ while ((ret != 0) && (ret != MICROSTEPS)) {
+ ret = onestep(dir, style);
+ delay(uspers/1000); // in ms
+ steppingcounter += (uspers % 1000);
+ if (steppingcounter >= 1000) {
+ delay(1);
+ steppingcounter -= 1000;
+ }
+ }
+ }
+}
+
+uint8_t AF_Stepper::onestep(uint8_t dir, uint8_t style) {
+ uint8_t a, b, c, d;
+ uint8_t ocrb, ocra;
+
+ ocra = ocrb = 255;
+
+ if (steppernum == 1) {
+ a = _BV(MOTOR1_A);
+ b = _BV(MOTOR2_A);
+ c = _BV(MOTOR1_B);
+ d = _BV(MOTOR2_B);
+ } else if (steppernum == 2) {
+ a = _BV(MOTOR3_A);
+ b = _BV(MOTOR4_A);
+ c = _BV(MOTOR3_B);
+ d = _BV(MOTOR4_B);
+ } else {
+ return 0;
+ }
+
+ // next determine what sort of stepping procedure we're up to
+ if (style == SINGLE) {
+ if ((currentstep/(MICROSTEPS/2)) % 2) { // we're at an odd step, weird
+ if (dir == FORWARD) {
+ currentstep += MICROSTEPS/2;
+ }
+ else {
+ currentstep -= MICROSTEPS/2;
+ }
+ } else { // go to the next even step
+ if (dir == FORWARD) {
+ currentstep += MICROSTEPS;
+ }
+ else {
+ currentstep -= MICROSTEPS;
+ }
+ }
+ } else if (style == DOUBLE) {
+ if (! (currentstep/(MICROSTEPS/2) % 2)) { // we're at an even step, weird
+ if (dir == FORWARD) {
+ currentstep += MICROSTEPS/2;
+ } else {
+ currentstep -= MICROSTEPS/2;
+ }
+ } else { // go to the next odd step
+ if (dir == FORWARD) {
+ currentstep += MICROSTEPS;
+ } else {
+ currentstep -= MICROSTEPS;
+ }
+ }
+ } else if (style == INTERLEAVE) {
+ if (dir == FORWARD) {
+ currentstep += MICROSTEPS/2;
+ } else {
+ currentstep -= MICROSTEPS/2;
+ }
+ }
+
+ if (style == MICROSTEP) {
+ if (dir == FORWARD) {
+ currentstep++;
+ } else {
+ // BACKWARDS
+ currentstep--;
+ }
+
+ currentstep += MICROSTEPS*4;
+ currentstep %= MICROSTEPS*4;
+
+ ocra = ocrb = 0;
+ if ( (currentstep >= 0) && (currentstep < MICROSTEPS)) {
+ ocra = microstepcurve[MICROSTEPS - currentstep];
+ ocrb = microstepcurve[currentstep];
+ } else if ( (currentstep >= MICROSTEPS) && (currentstep < MICROSTEPS*2)) {
+ ocra = microstepcurve[currentstep - MICROSTEPS];
+ ocrb = microstepcurve[MICROSTEPS*2 - currentstep];
+ } else if ( (currentstep >= MICROSTEPS*2) && (currentstep < MICROSTEPS*3)) {
+ ocra = microstepcurve[MICROSTEPS*3 - currentstep];
+ ocrb = microstepcurve[currentstep - MICROSTEPS*2];
+ } else if ( (currentstep >= MICROSTEPS*3) && (currentstep < MICROSTEPS*4)) {
+ ocra = microstepcurve[currentstep - MICROSTEPS*3];
+ ocrb = microstepcurve[MICROSTEPS*4 - currentstep];
+ }
+ }
+
+ currentstep += MICROSTEPS*4;
+ currentstep %= MICROSTEPS*4;
+
+#ifdef MOTORDEBUG
+ Serial.print("current step: "); Serial.println(currentstep, DEC);
+ Serial.print(" pwmA = "); Serial.print(ocra, DEC);
+ Serial.print(" pwmB = "); Serial.println(ocrb, DEC);
+#endif
+
+ if (steppernum == 1) {
+ setPWM1(ocra);
+ setPWM2(ocrb);
+ } else if (steppernum == 2) {
+ setPWM3(ocra);
+ setPWM4(ocrb);
+ }
+
+
+ // release all
+ latch_state &= ~a & ~b & ~c & ~d; // all motor pins to 0
+
+ //Serial.println(step, DEC);
+ if (style == MICROSTEP) {
+ if ((currentstep >= 0) && (currentstep < MICROSTEPS))
+ latch_state |= a | b;
+ if ((currentstep >= MICROSTEPS) && (currentstep < MICROSTEPS*2))
+ latch_state |= b | c;
+ if ((currentstep >= MICROSTEPS*2) && (currentstep < MICROSTEPS*3))
+ latch_state |= c | d;
+ if ((currentstep >= MICROSTEPS*3) && (currentstep < MICROSTEPS*4))
+ latch_state |= d | a;
+ } else {
+ switch (currentstep/(MICROSTEPS/2)) {
+ case 0:
+ latch_state |= a; // energize coil 1 only
+ break;
+ case 1:
+ latch_state |= a | b; // energize coil 1+2
+ break;
+ case 2:
+ latch_state |= b; // energize coil 2 only
+ break;
+ case 3:
+ latch_state |= b | c; // energize coil 2+3
+ break;
+ case 4:
+ latch_state |= c; // energize coil 3 only
+ break;
+ case 5:
+ latch_state |= c | d; // energize coil 3+4
+ break;
+ case 6:
+ latch_state |= d; // energize coil 4 only
+ break;
+ case 7:
+ latch_state |= d | a; // energize coil 1+4
+ break;
+ }
+ }
+
+
+ MC.latch_tx();
+ return currentstep;
+}
+
View
104 Arduino/libraries/AFMotor/AFMotor.h
@@ -0,0 +1,104 @@
+// Adafruit Motor shield library
+// copyright Adafruit Industries LLC, 2009
+// this code is public domain, enjoy!
+
+#ifndef _AFMotor_h_
+#define _AFMotor_h_
+
+#include <inttypes.h>
+#include <avr/io.h>
+
+//#define MOTORDEBUG 1
+
+#define MICROSTEPS 16 // 8 or 16
+
+#define MOTOR12_64KHZ _BV(CS20) // no prescale
+#define MOTOR12_8KHZ _BV(CS21) // divide by 8
+#define MOTOR12_2KHZ _BV(CS21) | _BV(CS20) // divide by 32
+#define MOTOR12_1KHZ _BV(CS22) // divide by 64
+
+#define MOTOR34_64KHZ _BV(CS00) // no prescale
+#define MOTOR34_8KHZ _BV(CS01) // divide by 8
+#define MOTOR34_1KHZ _BV(CS01) | _BV(CS00) // divide by 64
+
+#define MOTOR1_A 2
+#define MOTOR1_B 3
+#define MOTOR2_A 1
+#define MOTOR2_B 4
+#define MOTOR4_A 0
+#define MOTOR4_B 6
+#define MOTOR3_A 5
+#define MOTOR3_B 7
+
+#define FORWARD 1
+#define BACKWARD 2
+#define BRAKE 3
+#define RELEASE 4
+
+#define SINGLE 1
+#define DOUBLE 2
+#define INTERLEAVE 3
+#define MICROSTEP 4
+
+/*
+#define LATCH 4
+#define LATCH_DDR DDRB
+#define LATCH_PORT PORTB
+
+#define CLK_PORT PORTD
+#define CLK_DDR DDRD
+#define CLK 4
+
+#define ENABLE_PORT PORTD
+#define ENABLE_DDR DDRD
+#define ENABLE 7
+
+#define SER 0
+#define SER_DDR DDRB
+#define SER_PORT PORTB
+*/
+
+// Arduino pin names
+#define MOTORLATCH 12
+#define MOTORCLK 4
+#define MOTORENABLE 7
+#define MOTORDATA 8
+
+class AFMotorController
+{
+ public:
+ AFMotorController(void);
+ void enable(void);
+ friend class AF_DCMotor;
+ void latch_tx(void);
+};
+
+class AF_DCMotor
+{
+ public:
+ AF_DCMotor(uint8_t motornum, uint8_t freq = MOTOR34_8KHZ);
+ void run(uint8_t);
+ void setSpeed(uint8_t);
+
+ private:
+ uint8_t motornum, pwmfreq;
+};
+
+class AF_Stepper {
+ public:
+ AF_Stepper(uint16_t, uint8_t);
+ void step(uint16_t steps, uint8_t dir, uint8_t style = SINGLE);
+ void setSpeed(uint16_t);
+ uint8_t onestep(uint8_t dir, uint8_t style);
+ void release(void);
+ uint16_t revsteps; // # steps per revolution
+ uint8_t steppernum;
+ uint32_t usperstep, steppingcounter;
+ private:
+ uint8_t currentstep;
+
+};
+
+uint8_t getlatchstate(void);
+
+#endif
View
5 Arduino/libraries/AFMotor/README.txt
@@ -0,0 +1,5 @@
+This is the August 12, 2009 Adafruit Motor shield firmware with basic Microstepping support. Works with all Arduinos and the Mega
+
+For more information on the shield, please visit http://www.ladyada.net/make/mshield/
+
+To install, click DOWNLOAD SOURCE in the top right corner, and see our tutorial at http://www.ladyada.net/library/arduino/libraries.html on Arduino Library installation
View
60 Arduino/libraries/AFMotor/examples/MotorParty/MotorParty.pde
@@ -0,0 +1,60 @@
+// Adafruit Motor shield library
+// copyright Adafruit Industries LLC, 2009
+// this code is public domain, enjoy!
+
+#include <AFMotor.h>
+#include <ServoTimer1.h>
+
+// DC motor on M2
+AF_DCMotor motor(2);
+// DC hobby servo
+ServoTimer1 servo1;
+// Stepper motor on M3+M4 48 steps per revolution
+AF_Stepper stepper(48, 2);
+
+void setup() {
+ Serial.begin(9600); // set up Serial library at 9600 bps
+ Serial.println("Motor party!");
+
+ // turn on servo
+ servo1.attach(9);
+
+ // turn on motor #2
+ motor.setSpeed(200);
+ motor.run(RELEASE);
+}
+
+int i;
+
+// Test the DC motor, stepper and servo ALL AT ONCE!
+void loop() {
+ motor.run(FORWARD);
+ for (i=0; i<255; i++) {
+ servo1.write(i);
+ motor.setSpeed(i);
+ stepper.step(1, FORWARD, INTERLEAVE);
+ delay(3);
+ }
+
+ for (i=255; i!=0; i--) {
+ servo1.write(i-255);
+ motor.setSpeed(i);
+ stepper.step(1, BACKWARD, INTERLEAVE);
+ delay(3);
+ }
+
+ motor.run(BACKWARD);
+ for (i=0; i<255; i++) {
+ servo1.write(i);
+ motor.setSpeed(i);
+ delay(3);
+ stepper.step(1, FORWARD, DOUBLE);
+ }
+
+ for (i=255; i!=0; i--) {
+ servo1.write(i-255);
+ motor.setSpeed(i);
+ stepper.step(1, BACKWARD, DOUBLE);
+ delay(3);
+ }
+}
View
52 Arduino/libraries/AFMotor/examples/MotorTest/MotorTest.pde
@@ -0,0 +1,52 @@
+// Adafruit Motor shield library
+// copyright Adafruit Industries LLC, 2009
+// this code is public domain, enjoy!
+
+#include <AFMotor.h>
+
+AF_DCMotor motor(4);
+
+void setup() {
+ Serial.begin(9600); // set up Serial library at 9600 bps
+ Serial.println("Motor test!");
+
+ // turn on motor
+ motor.setSpeed(200);
+
+ motor.run(RELEASE);
+}
+
+void loop() {
+ uint8_t i;
+
+ Serial.print("tick");
+
+ motor.run(FORWARD);
+ for (i=0; i<255; i++) {
+ motor.setSpeed(i);
+ delay(10);
+ }
+
+ for (i=255; i!=0; i--) {
+ motor.setSpeed(i);
+ delay(10);
+ }
+
+ Serial.print("tock");
+
+ motor.run(BACKWARD);
+ for (i=0; i<255; i++) {
+ motor.setSpeed(i);
+ delay(10);
+ }
+
+ for (i=255; i!=0; i--) {
+ motor.setSpeed(i);
+ delay(10);
+ }
+
+
+ Serial.print("tech");
+ motor.run(RELEASE);
+ delay(1000);
+}
View
34 Arduino/libraries/AFMotor/examples/StepperTest/StepperTest.pde
@@ -0,0 +1,34 @@
+// Adafruit Motor shield library
+// copyright Adafruit Industries LLC, 2009
+// this code is public domain, enjoy!
+
+#include <AFMotor.h>
+
+// Connect a stepper motor with 48 steps per revolution (7.5 degree)
+// to motor port #2 (M3 and M4)
+AF_Stepper motor(48, 2);
+
+void setup() {
+ Serial.begin(9600); // set up Serial library at 9600 bps
+ Serial.println("Stepper test!");
+
+ motor.setSpeed(10); // 10 rpm
+}
+
+void loop() {
+ Serial.println("Single coil steps");
+ motor.step(100, FORWARD, SINGLE);
+ motor.step(100, BACKWARD, SINGLE);
+
+ Serial.println("Double coil steps");
+ motor.step(100, FORWARD, DOUBLE);
+ motor.step(100, BACKWARD, DOUBLE);
+
+ Serial.println("Interleave coil steps");
+ motor.step(100, FORWARD, INTERLEAVE);
+ motor.step(100, BACKWARD, INTERLEAVE);
+
+ Serial.println("Micrsostep steps");
+ motor.step(100, FORWARD, MICROSTEP);
+ motor.step(100, BACKWARD, MICROSTEP);
+}
View
35 Arduino/libraries/AFMotor/keywords.txt
@@ -0,0 +1,35 @@
+#######################################
+# Syntax Coloring Map for AFMotor
+#######################################
+
+#######################################
+# Datatypes (KEYWORD1)
+#######################################
+
+AF_DCMotor KEYWORD1
+AF_Stepper KEYWORD1
+
+#######################################
+# Methods and Functions (KEYWORD2)
+#######################################
+
+enable KEYWORD2
+run KEYWORD2
+setSpeed KEYWORD2
+step KEYWORD2
+onestep KEYWORD2
+release KEYWORD2
+
+#######################################
+# Constants (LITERAL1)
+#######################################
+
+MICROSTEPPING LITERAL1
+FORWARD LITERAL1
+BACKWARD LITERAL1
+BRAKE LITERAL1
+RELEASE LITERAL1
+SINGLE LITERAL1
+DOUBLE LITERAL1
+INTERLEAVE LITERAL1
+MICROSTEP LITERAL1
View
272 Arduino/libraries/Adafruit_7Seg/Adafruit_7Seg.cpp
@@ -0,0 +1,272 @@
+/***************************************************
+ This is a library for our I2C LED Backpacks
+
+ Designed specifically to work with the Adafruit LED Matrix backpacks
+ ----> http://www.adafruit.com/products/
+ ----> http://www.adafruit.com/products/
+
+ These displays use I2C to communicate, 2 pins are required to
+ interface. There are multiple selectable I2C addresses. For backpacks
+ with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
+ with 3 Address Select pins: 0x70 thru 0x77
+
+ Adafruit invests time and resources providing this open source code,
+ please support Adafruit and open-source hardware by purchasing
+ products from Adafruit!
+
+ Written by Limor Fried/Ladyada for Adafruit Industries.
+ BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+#include <Wire.h>
+#include "Adafruit_7Seg.h"
+
+static const uint8_t numbertable[] = {
+ 0x3F, /* 0 */
+ 0x06, /* 1 */
+ 0x5B, /* 2 */
+ 0x4F, /* 3 */
+ 0x66, /* 4 */
+ 0x6D, /* 5 */
+ 0x7D, /* 6 */
+ 0x07, /* 7 */
+ 0x7F, /* 8 */
+ 0x6F, /* 9 */
+ 0x77, /* a */
+ 0x7C, /* b */
+ 0x39, /* C */
+ 0x5E, /* d */
+ 0x79, /* E */
+ 0x71, /* F */
+};
+
+void Adafruit_7Seg::setBrightness(uint8_t b) {
+ if (b > 15) b = 15;
+ Wire.beginTransmission(i2c_addr);
+ Wire.write(0xE0 | b);
+ Wire.endTransmission();
+}
+
+void Adafruit_7Seg::blinkRate(uint8_t b) {
+ Wire.beginTransmission(i2c_addr);
+ if (b > 3) b = 0; // turn off if not sure
+
+ Wire.write(HT16K33_BLINK_CMD | HT16K33_BLINK_DISPLAYON | (b << 1));
+ Wire.endTransmission();
+}
+
+Adafruit_7Seg::Adafruit_7Seg(void) {
+}
+
+void Adafruit_7Seg::begin(uint8_t _addr = 0x70) {
+ i2c_addr = _addr;
+
+ Wire.begin();
+
+ Wire.beginTransmission(i2c_addr);
+ Wire.write(0x21); // turn on oscillator
+ Wire.endTransmission();
+ blinkRate(HT16K33_BLINK_OFF);
+
+ setBrightness(15); // max brightness
+}
+
+void Adafruit_7Seg::writeDisplay(void) {
+ Wire.beginTransmission(i2c_addr);
+ Wire.write((uint8_t)0x00); // start at address $00
+
+ for (uint8_t i=0; i<8; i++) {
+ Wire.write(displaybuffer[i] & 0xFF);
+ Wire.write(displaybuffer[i] >> 8);
+ }
+ Wire.endTransmission();
+}
+
+void Adafruit_7Seg::clear(void) {
+ for (uint8_t i=0; i<8; i++) {
+ displaybuffer[i] = 0;
+ }
+}
+
+Adafruit_7segment::Adafruit_7segment(void) {
+ position = 0;
+}
+
+void Adafruit_7segment::print(unsigned long n, int base)
+{
+ if (base == 0) write(n);
+ else printNumber(n, base);
+}
+
+void Adafruit_7segment::print(char c, int base)
+{
+ print((long) c, base);
+}
+
+void Adafruit_7segment::print(unsigned char b, int base)
+{
+ print((unsigned long) b, base);
+}
+
+void Adafruit_7segment::print(int n, int base)
+{
+ print((long) n, base);
+}
+
+void Adafruit_7segment::print(unsigned int n, int base)
+{
+ print((unsigned long) n, base);
+}
+
+void Adafruit_7segment::println(void) {
+ position = 0;
+}
+
+void Adafruit_7segment::println(char c, int base)
+{
+ print(c, base);
+ println();
+}
+
+void Adafruit_7segment::println(unsigned char b, int base)
+{
+ print(b, base);
+ println();
+}
+
+void Adafruit_7segment::println(int n, int base)
+{
+ print(n, base);
+ println();
+}
+
+void Adafruit_7segment::println(unsigned int n, int base)
+{
+ print(n, base);
+ println();
+}
+
+void Adafruit_7segment::println(long n, int base)
+{
+ print(n, base);
+ println();
+}
+
+void Adafruit_7segment::println(unsigned long n, int base)
+{
+ print(n, base);
+ println();
+}
+
+void Adafruit_7segment::println(double n, int digits)
+{
+ print(n, digits);
+ println();
+}
+
+void Adafruit_7segment::print(double n, int digits)
+{
+ printFloat(n, digits);
+}
+
+
+size_t Adafruit_7segment::write(uint8_t c) {
+
+ if (c == '\n') position = 0;
+ if (c == '\r') position = 0;
+
+ if ((c >= '0') && (c <= '9'))
+ writeDigitNum(position, c-'0');
+
+ position++;
+ if (position == 2) position++;
+}
+
+void Adafruit_7segment::writeDigitRaw(uint8_t d, uint8_t bitmask) {
+ if (d > 4) return;
+ displaybuffer[d] = bitmask;
+}
+
+void Adafruit_7segment::drawColon(boolean state) {
+ if (state)
+ displaybuffer[2] = 0xFF;
+ else
+ displaybuffer[2] = 0;
+}
+
+void Adafruit_7segment::writeDigitNum(uint8_t d, uint8_t num, boolean dot) {
+ if (d > 4) return;
+
+ writeDigitRaw(d, numbertable[num] | (dot << 7));
+}
+
+void Adafruit_7segment::print(long n, int base)
+{
+ printNumber(n, base);
+}
+
+void Adafruit_7segment::printNumber(long n, uint8_t base)
+{
+ printFloat(n, 0, base);
+}
+
+void Adafruit_7segment::printFloat(double n, uint8_t fracDigits, uint8_t base)
+{
+ uint8_t numericDigits = 4; // available digits on display
+ boolean isNegative = false; // true if the number is negative
+
+ // is the number negative?
+ if(n < 0) {
+ isNegative = true; // need to draw sign later
+ --numericDigits; // the sign will take up one digit
+ n *= -1; // pretend the number is positive
+ }
+
+ // calculate the factor required to shift all fractional digits
+ // into the integer part of the number
+ double toIntFactor = 1.0;
+ for(int i = 0; i < fracDigits; ++i) toIntFactor *= base;
+
+ // create integer containing digits to display by applying
+ // shifting factor and rounding adjustment
+ uint32_t displayNumber = n * toIntFactor + 0.5;
+
+ // calculate upper bound on displayNumber given
+ // available digits on display
+ uint32_t tooBig = 1;
+ for(int i = 0; i < numericDigits; ++i) tooBig *= base;
+
+ // if displayNumber is too large, try fewer fractional digits
+ while(displayNumber >= tooBig) {
+ --fracDigits;
+ toIntFactor /= base;
+ displayNumber = n * toIntFactor + 0.5;
+ }
+
+ // did toIntFactor shift the decimal off the display?
+ if (toIntFactor < 1) {
+ printError();
+ } else {
+ // otherwise, display the number
+ int8_t displayPos = 4;
+
+ for(uint8_t i = 0; displayNumber; ++i) {
+ boolean displayDecimal = (fracDigits != 0 && i == fracDigits);
+ writeDigitNum(displayPos--, displayNumber % base, displayDecimal);
+ if(displayPos == 2) writeDigitRaw(displayPos--, 0x00);
+ displayNumber /= base;
+ }
+
+ // display negative sign if negative
+ if(isNegative) writeDigitRaw(displayPos--, 0x40);
+
+ // clear remaining display positions
+ while(displayPos >= 0) writeDigitRaw(displayPos--, 0x00);
+ }
+}
+
+void Adafruit_7segment::printError(void) {
+ for(uint8_t i = 0; i < SEVENSEG_DIGITS; ++i) {
+ writeDigitRaw(i, (i == 2 ? 0x00 : 0x40));
+ }
+}
View
103 Arduino/libraries/Adafruit_7Seg/Adafruit_7Seg.h
@@ -0,0 +1,103 @@
+/***************************************************
+ This is a library for our I2C LED Backpacks
+
+ Designed specifically to work with the Adafruit LED Matrix backpacks
+ ----> http://www.adafruit.com/products/
+ ----> http://www.adafruit.com/products/
+
+ These displays use I2C to communicate, 2 pins are required to
+ interface. There are multiple selectable I2C addresses. For backpacks
+ with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
+ with 3 Address Select pins: 0x70 thru 0x77
+
+ Adafruit invests time and resources providing this open source code,
+ please support Adafruit and open-source hardware by purchasing
+ products from Adafruit!
+
+ Written by Limor Fried/Ladyada for Adafruit Industries.
+ BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+#if (ARDUINO >= 100)
+ #include "Arduino.h"
+#else
+ #include "WProgram.h"
+#endif
+
+#include "Wire.h"
+
+#define LED_ON 1
+#define LED_OFF 0
+
+#define LED_RED 1
+#define LED_YELLOW 2
+#define LED_GREEN 3
+
+
+
+#define HT16K33_BLINK_CMD 0x80
+#define HT16K33_BLINK_DISPLAYON 0x01
+#define HT16K33_BLINK_OFF 0
+#define HT16K33_BLINK_2HZ 1
+#define HT16K33_BLINK_1HZ 2
+#define HT16K33_BLINK_HALFHZ 3
+
+#define HT16K33_CMD_BRIGHTNESS 0x0E
+
+#define SEVENSEG_DIGITS 5
+
+
+// this is the raw HT16K33 controller
+class Adafruit_7Seg {
+ public:
+ Adafruit_7Seg(void);
+ void begin(uint8_t _addr);
+ void setBrightness(uint8_t b);
+ void blinkRate(uint8_t b);
+ void writeDisplay(void);
+ void clear(void);
+
+ uint16_t displaybuffer[8];
+
+ void init(uint8_t a);
+ private:
+ uint8_t i2c_addr;
+};
+
+#define DEC 10
+#define HEX 16
+#define OCT 8
+#define BIN 2
+#define BYTE 0
+
+class Adafruit_7segment : public Adafruit_7Seg {
+ public:
+ Adafruit_7segment(void);
+ size_t write(uint8_t c);
+
+ void print(char, int = BYTE);
+ void print(unsigned char, int = BYTE);
+ void print(int, int = DEC);
+ void print(unsigned int, int = DEC);
+ void print(long, int = DEC);
+ void print(unsigned long, int = DEC);
+ void print(double, int = 2);
+ void println(char, int = BYTE);
+ void println(unsigned char, int = BYTE);
+ void println(int, int = DEC);
+ void println(unsigned int, int = DEC);
+ void println(long, int = DEC);
+ void println(unsigned long, int = DEC);
+ void println(double, int = 2);
+ void println(void);
+
+ void writeDigitRaw(uint8_t x, uint8_t bitmask);
+ void writeDigitNum(uint8_t x, uint8_t num, boolean dot = false);
+ void drawColon(boolean state);
+ void printNumber(long, uint8_t = 2);
+ void printFloat(double, uint8_t = 2, uint8_t = DEC);
+ void printError(void);
+
+ private:
+ uint8_t position;
+};
View
26 Arduino/libraries/Adafruit_7Seg/README.txt
@@ -0,0 +1,26 @@
+This is a library for the Adafruit LED Backpacks
+This library works with the Adafruit Mini 8x8 and 7-Segment LED Backpacks
+ ----> http://www.adafruit.com/products/881
+ ----> http://www.adafruit.com/products/880
+ ----> http://www.adafruit.com/products/879
+ ----> http://www.adafruit.com/products/878
+ ----> http://www.adafruit.com/products/872
+ ----> http://www.adafruit.com/products/871
+ ----> http://www.adafruit.com/products/870
+
+These displays use I2C to communicate, 2 pins are required to
+interface. There are multiple selectable I2C addresses. For backpacks
+with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
+with 3 Address Select pins: 0x70 thru 0x77
+
+
+Written by Limor Fried/Ladyada for Adafruit Industries.
+MIT license, all text above must be included in any redistribution
+
+To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_LEDBackpack. Check that the Adafruit_LEDBackpack folder contains Adafruit_LEDBackpack.cpp and Adafruit_LEDBackpack.
+
+Place the Adafruit_LEDBackpack library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE
+
+**** Also requires the Adafruit_GFX library for Arduino. ****
+Download it from here:
+ https://github.com/adafruit/Adafruit-GFX-Library
View
50 Arduino/libraries/Adafruit_7Seg/examples/HT16K33/HT16K33.ino
@@ -0,0 +1,50 @@
+/***************************************************
+ This is a library for our I2C LED Backpacks
+
+ Designed specifically to work with the Adafruit LED Matrix backpacks
+ ----> http://www.adafruit.com/products/872
+ ----> http://www.adafruit.com/products/871
+ ----> http://www.adafruit.com/products/870
+
+ These displays use I2C to communicate, 2 pins are required to
+ interface. There are multiple selectable I2C addresses. For backpacks
+ with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
+ with 3 Address Select pins: 0x70 thru 0x77
+
+ Adafruit invests time and resources providing this open source code,
+ please support Adafruit and open-source hardware by purchasing
+ products from Adafruit!
+
+ Written by Limor Fried/Ladyada for Adafruit Industries.
+ BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+#include <Wire.h>
+#include "Adafruit_LEDBackpack.h"
+#include "Adafruit_GFX.h"
+
+Adafruit_LEDBackpack matrix = Adafruit_LEDBackpack();
+
+uint8_t counter = 0;
+
+void setup() {
+ Serial.begin(9600);
+ Serial.println("HT16K33 test");
+
+ matrix.begin(0x70); // pass in the address
+}
+
+void loop() {
+ // paint one LED per row. The HT16K33 internal memory looks like
+ // a 8x16 bit matrix (8 rows, 16 columns)
+ for (uint8_t i=0; i<8; i++) {
+ // draw a diagonal row of pixels
+ matrix.displaybuffer[i] = _BV((counter+i) % 16) | _BV((counter+i+8) % 16) ;
+ }
+ // write the changes we just made to the display
+ matrix.writeDisplay();
+ delay(100);
+
+ counter++;
+ if (counter >= 16) counter = 0;
+}
View
82 Arduino/libraries/Adafruit_7Seg/examples/sevenseg/sevenseg.ino
@@ -0,0 +1,82 @@
+/***************************************************
+ This is a library for our I2C LED Backpacks
+
+ Designed specifically to work with the Adafruit LED 7-Segment backpacks
+ ----> http://www.adafruit.com/products/881
+ ----> http://www.adafruit.com/products/880
+ ----> http://www.adafruit.com/products/879
+ ----> http://www.adafruit.com/products/878
+
+ These displays use I2C to communicate, 2 pins are required to
+ interface. There are multiple selectable I2C addresses. For backpacks
+ with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
+ with 3 Address Select pins: 0x70 thru 0x77
+
+ Adafruit invests time and resources providing this open source code,
+ please support Adafruit and open-source hardware by purchasing
+ products from Adafruit!
+
+ Written by Limor Fried/Ladyada for Adafruit Industries.
+ BSD license, all text above must be included in any redistribution
+ ****************************************************/
+
+#include <Wire.h>
+#include "Adafruit_LEDBackpack.h"
+#include "Adafruit_GFX.h"
+
+Adafruit_7segment matrix = Adafruit_7segment();
+
+void setup() {
+ Serial.begin(9600);
+ Serial.println("7 Segment Backpack Test");
+
+ matrix.begin(0x70);
+}
+
+void loop() {
+ // try to print a number thats too long
+ matrix.print(10000, DEC);
+ matrix.writeDisplay();
+ delay(500);
+
+ // print a hex number
+ matrix.print(0xBEEF, HEX);
+ matrix.writeDisplay();
+ delay(500);
+
+ // print a floating point
+ /* this isnt working yet, still hacking on it!
+ matrix.print(12.34);
+ matrix.writeDisplay();
+ delay(500);
+ */
+
+ // print with print/println
+ for (uint16_t counter = 0; counter < 9999; counter++) {
+ matrix.println(counter);
+ matrix.writeDisplay();
+ delay(10);
+ }
+
+ // method #2 - draw each digit
+ uint16_t blinkcounter = 0;
+ boolean drawDots = false;
+ for (uint16_t counter = 0; counter < 9999; counter ++) {
+ matrix.writeDigitNum(0, (counter / 1000), drawDots);
+ matrix.writeDigitNum(1, (counter / 100) % 10, drawDots);
+ matrix.drawColon(drawDots);
+ matrix.writeDigitNum(3, (counter / 10) % 10, drawDots);
+ matrix.writeDigitNum(4, counter % 10, drawDots);
+
+ blinkcounter+=50;
+ if (blinkcounter < 500) {
+ drawDots = false;
+ } else if (blinkcounter < 1000) {
+ drawDots = true;
+ } else {
+ blinkcounter = 0;
+ }
+ matrix.writeDisplay();
+ delay(10);
+ }
+}
View
26 Arduino/libraries/Adafruit_7Seg/license.txt
@@ -0,0 +1,26 @@
+Software License Agreement (BSD License)
+
+Copyright (c) 2012, Adafruit Industries
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+3. Neither the name of the copyright holders nor the
+names of its contributors may be used to endorse or promote products
+derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
469 Arduino/libraries/Adafruit_GFX/Adafruit_GFX.cpp
@@ -0,0 +1,469 @@
+/***********************************
+This is a our graphics core library, for all our displays.
+We'll be adapting all the
+existing libaries to use this core to make updating, support
+and upgrading easier!
+
+Adafruit invests time and resources providing this open source code,
+please support Adafruit and open-source hardware by purchasing
+products from Adafruit!
+
+Written by Limor Fried/Ladyada for Adafruit Industries.
+BSD license, check license.txt for more information
+All text above must be included in any redistribution
+****************************************/
+
+
+#include "Adafruit_GFX.h"
+#include "glcdfont.c"
+#include <avr/pgmspace.h>
+
+void Adafruit_GFX::constructor(int16_t w, int16_t h) {
+ _width = WIDTH = w;
+ _height = HEIGHT = h;
+
+ rotation = 0;
+ cursor_y = cursor_x = 0;
+ textsize = 1;
+ textcolor = textbgcolor = 0xFFFF;
+ wrap = true;
+}
+
+
+// draw a circle outline
+void Adafruit_GFX::drawCircle(int16_t x0, int16_t y0, int16_t r,
+ uint16_t color) {
+ int16_t f = 1 - r;
+ int16_t ddF_x = 1;
+ int16_t ddF_y = -2 * r;
+ int16_t x = 0;
+ int16_t y = r;
+
+ drawPixel(x0, y0+r, color);
+ drawPixel(x0, y0-r, color);
+ drawPixel(x0+r, y0, color);
+ drawPixel(x0-r, y0, color);
+
+ while (x<y) {
+ if (f >= 0) {
+ y--;
+ ddF_y += 2;
+ f += ddF_y;
+ }
+ x++;
+ ddF_x += 2;
+ f += ddF_x;
+
+ drawPixel(x0 + x, y0 + y, color);
+ drawPixel(x0 - x, y0 + y, color);
+ drawPixel(x0 + x, y0 - y, color);
+ drawPixel(x0 - x, y0 - y, color);
+ drawPixel(x0 + y, y0 + x, color);
+ drawPixel(x0 - y, y0 + x, color);
+ drawPixel(x0 + y, y0 - x, color);
+ drawPixel(x0 - y, y0 - x, color);
+
+ }
+}
+
+void Adafruit_GFX::drawCircleHelper( int16_t x0, int16_t y0,
+ int16_t r, uint8_t cornername, uint16_t color) {
+ int16_t f = 1 - r;
+ int16_t ddF_x = 1;
+ int16_t ddF_y = -2 * r;
+ int16_t x = 0;
+ int16_t y = r;
+
+ while (x<y) {
+ if (f >= 0) {
+ y--;
+ ddF_y += 2;
+ f += ddF_y;
+ }
+ x++;
+ ddF_x += 2;
+ f += ddF_x;
+ if (cornername & 0x4) {
+ drawPixel(x0 + x, y0 + y, color);
+ drawPixel(x0 + y, y0 + x, color);
+ }
+ if (cornername & 0x2) {
+ drawPixel(x0 + x, y0 - y, color);
+ drawPixel(x0 + y, y0 - x, color);
+ }
+ if (cornername & 0x8) {
+ drawPixel(x0 - y, y0 + x, color);
+ drawPixel(x0 - x, y0 + y, color);
+ }
+ if (cornername & 0x1) {
+ drawPixel(x0 - y, y0 - x, color);
+ drawPixel(x0 - x, y0 - y, color);
+ }
+ }
+}
+
+void Adafruit_GFX::fillCircle(int16_t x0, int16_t y0, int16_t r,
+ uint16_t color) {
+ drawFastVLine(x0, y0-r, 2*r+1, color);
+ fillCircleHelper(x0, y0, r, 3, 0, color);
+}
+
+// used to do circles and roundrects!
+void Adafruit_GFX::fillCircleHelper(int16_t x0, int16_t y0, int16_t r,
+ uint8_t cornername, int16_t delta, uint16_t color) {
+
+ int16_t f = 1 - r;
+ int16_t ddF_x = 1;
+ int16_t ddF_y = -2 * r;
+ int16_t x = 0;
+ int16_t y = r;
+
+ while (x<y) {
+ if (f >= 0) {
+ y--;
+ ddF_y += 2;
+ f += ddF_y;
+ }
+ x++;
+ ddF_x += 2;
+ f += ddF_x;
+
+ if (cornername & 0x1) {
+ drawFastVLine(x0+x, y0-y, 2*y+1+delta, color);
+ drawFastVLine(x0+y, y0-x, 2*x+1+delta, color);
+ }
+ if (cornername & 0x2) {
+ drawFastVLine(x0-x, y0-y, 2*y+1+delta, color);
+ drawFastVLine(x0-y, y0-x, 2*x+1+delta, color);
+ }
+ }
+}
+
+// bresenham's algorithm - thx wikpedia
+void Adafruit_GFX::drawLine(int16_t x0, int16_t y0,
+ int16_t x1, int16_t y1,
+ uint16_t color) {
+ int16_t steep = abs(y1 - y0) > abs(x1 - x0);
+ if (steep) {
+ swap(x0, y0);
+ swap(x1, y1);
+ }
+
+ if (x0 > x1) {
+ swap(x0, x1);
+ swap(y0, y1);
+ }
+
+ int16_t dx, dy;
+ dx = x1 - x0;
+ dy = abs(y1 - y0);
+
+ int16_t err = dx / 2;
+ int16_t ystep;
+
+ if (y0 &