Changeset 548a60f in orbit
- Timestamp:
- 08/23/13 19:18:59 (9 years ago)
- Branches:
- master, Servo, Tab_Interface, pyramid
- Children:
- 37edfa3
- Parents:
- 8a0f920f
- Files:
-
- 3 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
android/src/info/puzzlebox/orbit/AudioService.java
ra546cc3 r548a60f 17 17 */ 18 18 AudioTrack track; 19 public int sampleRate = 44100; 19 // public int sampleRate = 44100; 20 public int sampleRate = 48000; 20 21 21 22 short[] audioData = new short[6144]; … … 112 113 /** 113 114 * Half periods in the audio code, in seconds. 114 */ 115 * 116 * Four periods exist in the wave 117 */ 118 // private final double longHIGH = 0.000829649; 119 // private final double longLOW = 0.000797027; 120 // private final double shortHIGH = 0.000412649; 121 // private final double shortLOW = 0.000378351; 122 115 123 private final double longHIGH = 0.000829649; 116 124 private final double longLOW = 0.000797027; … … 118 126 private final double shortLOW = 0.000378351; 119 127 128 120 129 /** 121 130 * Pre-calculated and stored half sine waves. … … 127 136 128 137 /** 129 * Pre-assembled audio code bit array in wave form. 138 * Pre-assembled audio code bit array in wave form. 139 * 140 * waveBit is an array of two wave, each an array of numbers 141 * waveBit[0] is the first wave, waveBit[1] is the second wave 130 142 */ 131 143 private final float[] waveBit[]= {concatFloat(waveShortHIGH,waveShortLOW),concatFloat(waveLongHIGH,waveLongLOW)}; … … 208 220 209 221 float[] wave = halfSineGen('d',longLOW); 222 223 // longHIGH-sampleTime*2 - float number used to tune the period of the wave 224 210 225 float[] tempWave = concatFloat(halfSineGen('u',longHIGH-sampleTime*2),halfSineGen('d',shortLOW+sampleTime*2)); 211 226 wave = concatFloat(wave,tempWave); 212 227 wave = concatFloat(wave,tempWave); 213 228 214 229 230 // Takes out each bit 215 231 for (int i=27; i>=0; i--) 216 232 wave=concatFloat(wave,waveBit[((code >>> i) & 1)]); … … 344 360 /** 345 361 * Generate half sine signal. 362 * This is the smallest component of the wave. 346 363 * @param dir: 'u' or 'd', means it's the upper half or lower half or sine wave. 347 364 * @param halfPeriod: half of the period of sine wave, in seconds -
iOS/Orbit/Orbit/controllers/TutorialViewController.m
rde10cbc r548a60f 18 18 [NSURLRequest requestWithURL: 19 19 [NSURL fileURLWithPath: 20 [[NSBundle mainBundle] pathForResource:@" index" ofType:@"html"]]]];20 [[NSBundle mainBundle] pathForResource:@"frame" ofType:@"html"]]]]; 21 21 [super viewDidLoad]; 22 22 } -
iOS/Orbit/orbit.xcodeproj/project.pbxproj
r6fc29d0 r548a60f 51 51 524B4A3F17AF72BC009076BA /* step03-2.html in Resources */ = {isa = PBXBuildFile; fileRef = 524B4A3E17AF72BC009076BA /* step03-2.html */; }; 52 52 52922BA817004D1400A39146 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 52922BA717004D1400A39146 /* libCorePlot-CocoaTouch.a */; }; 53 5296E9A417C46E510044FCF6 /* frame.html in Resources */ = {isa = PBXBuildFile; fileRef = 5296E9A317C46E510044FCF6 /* frame.html */; }; 54 52E01A0017C7AE8D008151B9 /* tutorial-06-1-headset_properly_worn-front.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 52E019FE17C7AE8D008151B9 /* tutorial-06-1-headset_properly_worn-front.jpg */; }; 55 52E01A0117C7AE8D008151B9 /* tutorial-06-1-headset_properly_worn-side.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 52E019FF17C7AE8D008151B9 /* tutorial-06-1-headset_properly_worn-side.jpg */; }; 56 52E01A0317C7B065008151B9 /* contents.html in Resources */ = {isa = PBXBuildFile; fileRef = 52E01A0217C7B065008151B9 /* contents.html */; }; 53 57 52E3302D17AE9A8B00671D06 /* tutorial-04-headset.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 52E3302117AE9A8B00671D06 /* tutorial-04-headset.jpg */; }; 54 58 52E3302E17AE9A8B00671D06 /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 52E3302217AE9A8B00671D06 /* index.html */; }; … … 220 224 52922BF41700507400A39146 /* NSDecimalNumberExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDecimalNumberExtensions.h; sourceTree = "<group>"; }; 221 225 52922BF51700507400A39146 /* NSNumberExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSNumberExtensions.h; sourceTree = "<group>"; }; 226 5296E9A317C46E510044FCF6 /* frame.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = frame.html; path = tutorial/frame.html; sourceTree = "<group>"; }; 227 52E019FE17C7AE8D008151B9 /* tutorial-06-1-headset_properly_worn-front.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "tutorial-06-1-headset_properly_worn-front.jpg"; sourceTree = "<group>"; }; 228 52E019FF17C7AE8D008151B9 /* tutorial-06-1-headset_properly_worn-side.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "tutorial-06-1-headset_properly_worn-side.jpg"; sourceTree = "<group>"; }; 229 52E01A0217C7B065008151B9 /* contents.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = contents.html; path = tutorial/contents.html; sourceTree = "<group>"; }; 222 230 52E3302117AE9A8B00671D06 /* tutorial-04-headset.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "tutorial-04-headset.jpg"; sourceTree = "<group>"; }; 223 231 52E3302217AE9A8B00671D06 /* index.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = index.html; path = tutorial/index.html; sourceTree = "<group>"; }; … … 283 291 52E3302017AE9A8B00671D06 /* images */, 284 292 52E3302217AE9A8B00671D06 /* index.html */, 293 52E01A0217C7B065008151B9 /* contents.html */, 285 294 52E3302317AE9A8B00671D06 /* step01.html */, 286 295 52E3305D17AEB4ED00671D06 /* step02.html */, … … 300 309 52E3302917AE9A8B00671D06 /* step09.html */, 301 310 52E3302B17AE9A8B00671D06 /* step10.html */, 311 5296E9A317C46E510044FCF6 /* frame.html */, 302 312 52E3302C17AE9A8B00671D06 /* style.css */, 303 313 ); … … 366 376 2815BC08167F428B00F7E6DA /* Libraries */, 367 377 28174C67167F2EA900104752 /* Supporting Files */, 378 28F90132179973EC003FB5ED /* AudioGenerator.m */, 379 28F90131179973EC003FB5ED /* AudioGenerator.h */, 368 380 289C7CCD178C36A9005C08EC /* TutorialViewController.h */, 369 381 289C7CCE178C36A9005C08EC /* TutorialViewController.m */, … … 377 389 288B4BC8178F016F007D588D /* SignalConverter.m */, 378 390 288B4BCA178F0842007D588D /* SignalConverterDelegate.h */, 379 28F90131179973EC003FB5ED /* AudioGenerator.h */,380 28F90132179973EC003FB5ED /* AudioGenerator.m */,381 391 ); 382 392 path = Orbit; … … 511 521 52E3305317AEA7E600671D06 /* tutorial-05-2-eeg_connected.jpg */, 512 522 52E3304917AEA48500671D06 /* tutorial-06-1-headset_properly_worn.jpg */, 523 52E019FE17C7AE8D008151B9 /* tutorial-06-1-headset_properly_worn-front.jpg */, 524 52E019FF17C7AE8D008151B9 /* tutorial-06-1-headset_properly_worn-side.jpg */, 513 525 52E3304A17AEA48500671D06 /* tutorial-06-2-check_headset.jpg */, 514 526 52E3304B17AEA48500671D06 /* tutorial-06-3-check_connection_points.jpg */, … … 632 644 524B4A3D17AF6E72009076BA /* step05-3.html in Resources */, 633 645 524B4A3F17AF72BC009076BA /* step03-2.html in Resources */, 646 5296E9A417C46E510044FCF6 /* frame.html in Resources */, 647 52E01A0017C7AE8D008151B9 /* tutorial-06-1-headset_properly_worn-front.jpg in Resources */, 648 52E01A0117C7AE8D008151B9 /* tutorial-06-1-headset_properly_worn-side.jpg in Resources */, 649 52E01A0317C7B065008151B9 /* contents.html in Resources */, 634 650 ); 635 651 runOnlyForDeploymentPostprocessing = 0; -
iOS/Orbit/tutorial/index.html
r6d0d67b r548a60f 1 1 <!DOCTYPE html> 2 2 <html> 3 <head> 4 <meta name="viewport" content="width=device-width"> 5 <link rel="stylesheet" type="text/css" href="style.css"> 6 <title>Orbit Tutorial</title> 3 <head> 4 <meta name="viewport" content="width=device-width"> 5 <link rel="stylesheet" type="text/css" href="style.css"> 6 <title>Orbit Tutorial</title> 7 </head> 8 <body style="background-color: white;"> 9 10 <center> 11 12 <img src="puzzlebox_logo.pdf" width="240"> 13 14 Welcome to Puzzlebox Orbit 15 16 <p><img src="status_0@2x.png" height="160"><p> 17 18 <p>Please press "Next" to begin the tutorial</p> 19 20 <a class='next button' onclick="parent.changePage('contents.html');">Next »</a> 7 21 8 <body style="background-color: white;"> 9 10 <center> 11 <img src="puzzlebox_logo.pdf" width="240"> 12 13 Welcome to Puzzlebox Orbit 14 15 <p><img src="status_0@2x.png" height="160"><p> 16 17 <p>Please press "Next" to begin the tutorial</p> 18 19 <a class='next button' onclick="parent.changePage('step01.html');">Next »</a> 20 21 </center> 22 23 <!-- 24 <table class='table'> 25 <tbody> 26 <tr> 27 <td> 28 <center> 29 <img src="puzzlebox_logo.pdf" width="240"> 30 </center> 31 </td> 32 </tr> 33 34 <tr> 35 <td> 36 <center> 37 Welcome to Puzzlebox Orbit 38 </center> 39 </td> 40 </tr> 41 42 <tr> 43 <td> 44 <center> 45 <p><img src="status_0@2x.png" height="160"></p> 46 </center> 47 </td> 48 </tr> 49 50 <tr> 51 <td> 52 <center> 53 Please press "Next" to begin the tutorial 54 </center> 55 </td> 56 </tr> 57 58 </td> 59 <tr> 60 <td> 61 <a class='next button' href="step01.html">Next »</a> 62 </td> 63 </tr> 64 </tbody> 65 </table> 66 --> 67 </body> 22 </center> 23 24 <!-- 25 <table class='table'> 26 <tbody> 27 <tr> 28 <td> 29 <center> 30 <img src="puzzlebox_logo.pdf" width="240"> 31 </center> 32 </td> 33 </tr> 34 35 <tr> 36 <td> 37 <center> 38 Welcome to Puzzlebox Orbit 39 </center> 40 </td> 41 </tr> 42 43 <tr> 44 <td> 45 <center> 46 <p><img src="status_0@2x.png" height="160"></p> 47 </center> 48 </td> 49 </tr> 50 51 <tr> 52 <td> 53 <center> 54 Please press "Next" to begin the tutorial 55 </center> 56 </td> 57 </tr> 58 59 </td> 60 <tr> 61 <td> 62 <a class='next button' href="step01.html">Next »</a> 63 </td> 64 </tr> 65 </tbody> 66 </table> 67 --> 68 69 </body> 68 70 </html> -
iOS/Orbit/tutorial/step02.html
r6d0d67b r548a60f 22 22 --> 23 23 <ul> 24 <li> The first step before using your Puzzlebox Orbit is charge both the Orbit helicopter as well as the infrared dongle using the included USB charging cable</li>24 <li>An important step before using your Puzzlebox Orbit is charge both the Orbit helicopter as well as the infrared dongle using the included USB charging cable</li> 25 25 <li>Please be certain the helicopter is in the "Off" position while charging</li> 26 26 <li>A red light will appear inside the USB cable itself when a connected device is fully charged</li> -
iOS/Orbit/tutorial/step04.html
r6d0d67b r548a60f 24 24 <tr> 25 25 <td> 26 <a class='prev button' onclick="parent.changePage('step03 .html');">« Back</a>26 <a class='prev button' onclick="parent.changePage('step03-2.html');">« Back</a> 27 27 <a class='next button' onclick="parent.changePage('step05-1.html');">Next »</a> 28 28 </td> -
iOS/Orbit/tutorial/step06-1.html
r6d0d67b r548a60f 20 20 21 21 <center> 22 <img src="tutorial-06-1-headset_properly_worn.jpg" width="100%" height="300"> 23 </center> 22 23 <h2>This is how the headset should look when properly worn</h2> 24 25 <img src="tutorial-06-1-headset_properly_worn-front.jpg" width="100" height="100"> 26 27 28 29 <img src="tutorial-06-1-headset_properly_worn-side.jpg" width="100" height="100"> 30 31 </center> 32 33 34 <!-- <center> 35 <img src="tutorial-06-1-headset_properly_worn.jpg" width="100%" height="300"> 36 </center>--> 24 37 25 38 </td> -
iOS/Orbit/tutorial/step10.html
r6d0d67b r548a60f 19 19 <center> 20 20 <img src="tutorial-01-orbit.jpg" width="100%"> 21 21 </center> 22 22 23 23 </td> -
iOS/Orbit/tutorial/style.css
r82a1db7 r548a60f 11 11 float: left; 12 12 } 13 14 13 .next { 15 14 float: right; 15 } 16 .left { 17 float: left; 18 } 19 .right { 20 float: right; 21 } 22 .center { 23 float: center; 16 24 } 17 25 .table {
Note: See TracChangeset
for help on using the changeset viewer.