├── src ├── iphone │ ├── Japanese │ ├── Images │ │ ├── bar00.png │ │ ├── bar01.png │ │ ├── bar02.png │ │ ├── bar03.png │ │ ├── bar04.png │ │ ├── bar05.png │ │ ├── bar06.png │ │ ├── bar07.png │ │ ├── bar08.png │ │ ├── bar09.png │ │ ├── bar10.png │ │ ├── icon.png │ │ ├── bar00@2x.png │ │ ├── bar01@2x.png │ │ ├── bar02@2x.png │ │ ├── bar03@2x.png │ │ ├── bar04@2x.png │ │ ├── bar05@2x.png │ │ ├── bar06@2x.png │ │ ├── bar07@2x.png │ │ ├── bar08@2x.png │ │ ├── bar09@2x.png │ │ ├── bar10@2x.png │ │ ├── hiz_icon.png │ │ ├── icon@2x.png │ │ ├── in_icon.png │ │ ├── low_icon.png │ │ ├── out_icon.png │ │ ├── high_icon.png │ │ ├── in_icon@2x.png │ │ ├── off_button.png │ │ ├── on_button.png │ │ ├── bad_ball_icon.png │ │ ├── help_tab_icon.png │ │ ├── io_tab_icon.png │ │ ├── ok_ball_icon.png │ │ ├── out_icon@2x.png │ │ ├── connected_icon.png │ │ ├── io_tab_icon@2x.png │ │ ├── port_red_button.png │ │ ├── connected_icon@2x.png │ │ ├── disconnected_icon.png │ │ ├── help_tab_icon@2x.png │ │ ├── monitor_tab_icon.png │ │ ├── port_gray_button.png │ │ ├── port_red_button@2x.png │ │ ├── disconnected_icon@2x.png │ │ ├── port_gray_button@2x.png │ │ ├── IOControllerBackgroundImage.png │ │ ├── DigitalPortViewBackgroundImage.png │ │ ├── IOControllerBackgroundImage@2x.png │ │ ├── DigitalPortViewBackgroundImage@2x.png │ │ └── MonitorViewControllerBackgroundImage.png │ ├── iphone_and_device.jpg │ ├── otoduino_schematic.tiff │ ├── OTOduino_Prefix.pch │ ├── Classes │ │ ├── OTOplugDetailView.h │ │ ├── ConnectionDialogView.h │ │ ├── ImageSource.h │ │ ├── HelpViewController.h │ │ ├── IOViewController.h │ │ ├── OTOduinoAppDelegate.h │ │ ├── OTOplugDetailView.m │ │ ├── ConnectionDialogView.m │ │ ├── ConnectionStatusView.h │ │ ├── ColorBarView.h │ │ ├── ArduinoModel.h │ │ ├── DigitalPinView.h │ │ ├── VoltageView.h │ │ ├── AnalogPinView.h │ │ ├── VoltageView.m │ │ ├── ColorBarView.m │ │ ├── ArduinoModel.m │ │ ├── ConnectionStatusView.m │ │ ├── OTOduinoAppDelegate.m │ │ ├── ImageSource.m │ │ ├── DigitalPinView.m │ │ ├── HelpViewController.m │ │ ├── AnalogPinView.m │ │ ├── IOViewController.m │ │ ├── HelpViewController.xib │ │ ├── IOViewController.xib │ │ ├── AnalogPinView.xib │ │ └── DigitalPinView.xib │ ├── AnalogPinModel.m │ ├── main.m │ ├── DigitalPinModel.m │ ├── AnalogPinModel.h │ ├── DigitalPinModel.h │ ├── OTOduinoHostDelegate.h │ ├── OTOduino-Info.plist │ ├── OTOduinoSocket.h │ ├── OTOduinoHost.h │ ├── OTOduinoTypes.h │ ├── Japanese.lproj │ │ └── help.html │ ├── English.lproj │ │ └── help.html │ ├── OTOduinoSocket.m │ ├── OTOduinoHost.m │ ├── ConnectionStatusView.xib │ └── VoltageView.xib └── arduino │ └── OTOduinoSimpleClient │ ├── OTOduinoTypes.h │ └── OTOduinoSimpleClient.pde ├── doc ├── icon512.png ├── OTOduinoShield.sch ├── iTunesPreviewDescription_ja.txt └── iTunesPreviewDescription.txt ├── .gitmodules ├── .gitignore ├── README.md └── license.txt /src/iphone/Japanese: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/icon512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/doc/icon512.png -------------------------------------------------------------------------------- /doc/OTOduinoShield.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/doc/OTOduinoShield.sch -------------------------------------------------------------------------------- /src/iphone/Images/bar00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar00.png -------------------------------------------------------------------------------- /src/iphone/Images/bar01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar01.png -------------------------------------------------------------------------------- /src/iphone/Images/bar02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar02.png -------------------------------------------------------------------------------- /src/iphone/Images/bar03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar03.png -------------------------------------------------------------------------------- /src/iphone/Images/bar04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar04.png -------------------------------------------------------------------------------- /src/iphone/Images/bar05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar05.png -------------------------------------------------------------------------------- /src/iphone/Images/bar06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar06.png -------------------------------------------------------------------------------- /src/iphone/Images/bar07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar07.png -------------------------------------------------------------------------------- /src/iphone/Images/bar08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar08.png -------------------------------------------------------------------------------- /src/iphone/Images/bar09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar09.png -------------------------------------------------------------------------------- /src/iphone/Images/bar10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar10.png -------------------------------------------------------------------------------- /src/iphone/Images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/icon.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "OTO-plug"] 2 | path = OTO-plug 3 | url = git://github.com/reinforce-lab/OTO-plug.git 4 | -------------------------------------------------------------------------------- /src/iphone/Images/bar00@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar00@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/bar01@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar01@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/bar02@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar02@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/bar03@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar03@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/bar04@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar04@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/bar05@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar05@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/bar06@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar06@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/bar07@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar07@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/bar08@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar08@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/bar09@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar09@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/bar10@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bar10@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/hiz_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/hiz_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/icon@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/in_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/in_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/low_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/low_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/out_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/out_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/high_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/high_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/in_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/in_icon@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/off_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/off_button.png -------------------------------------------------------------------------------- /src/iphone/Images/on_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/on_button.png -------------------------------------------------------------------------------- /src/iphone/iphone_and_device.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/iphone_and_device.jpg -------------------------------------------------------------------------------- /src/iphone/Images/bad_ball_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/bad_ball_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/help_tab_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/help_tab_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/io_tab_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/io_tab_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/ok_ball_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/ok_ball_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/out_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/out_icon@2x.png -------------------------------------------------------------------------------- /src/iphone/otoduino_schematic.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/otoduino_schematic.tiff -------------------------------------------------------------------------------- /src/iphone/Images/connected_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/connected_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/io_tab_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/io_tab_icon@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/port_red_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/port_red_button.png -------------------------------------------------------------------------------- /src/iphone/Images/connected_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/connected_icon@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/disconnected_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/disconnected_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/help_tab_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/help_tab_icon@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/monitor_tab_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/monitor_tab_icon.png -------------------------------------------------------------------------------- /src/iphone/Images/port_gray_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/port_gray_button.png -------------------------------------------------------------------------------- /src/iphone/Images/port_red_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/port_red_button@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/disconnected_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/disconnected_icon@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/port_gray_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/port_gray_button@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/IOControllerBackgroundImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/IOControllerBackgroundImage.png -------------------------------------------------------------------------------- /src/iphone/Images/DigitalPortViewBackgroundImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/DigitalPortViewBackgroundImage.png -------------------------------------------------------------------------------- /src/iphone/Images/IOControllerBackgroundImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/IOControllerBackgroundImage@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/DigitalPortViewBackgroundImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/DigitalPortViewBackgroundImage@2x.png -------------------------------------------------------------------------------- /src/iphone/Images/MonitorViewControllerBackgroundImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reinforce-lab/OTOduino/HEAD/src/iphone/Images/MonitorViewControllerBackgroundImage.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | .DS_Store 3 | *.swp 4 | *~ 5 | *.nib 6 | *.pbxuser 7 | *.perspective 8 | *.perspectivev3 9 | *.mode1v3 10 | *.mode2v3 11 | 12 | xcuserdata 13 | *.xcworkspace/ 14 | 15 | -------------------------------------------------------------------------------- /src/iphone/OTOduino_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OTOduino' target in the 'OTOduino' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #import 8 | #endif 9 | -------------------------------------------------------------------------------- /src/iphone/Classes/OTOplugDetailView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OTOplugDetailView.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface OTOplugDetailView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /src/iphone/Classes/ConnectionDialogView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ConnectionDialogView.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface ConnectionDialogView : UIView { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /src/iphone/Classes/ImageSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageSource.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | #import 9 | 10 | 11 | @interface ImageSource : NSObject { 12 | } 13 | +(UIImage *)getColorBarImage:(int)index; 14 | @end 15 | -------------------------------------------------------------------------------- /src/iphone/Classes/HelpViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HelpViewController.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/22. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface HelpViewController : UIViewController { 13 | IBOutlet UIWebView *webView_; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /src/iphone/AnalogPinModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // AnalogPinModel.m 3 | // OTOduino 4 | // 5 | // Created by 上原 昭宏 on 11/01/30. 6 | // Copyright 2011 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "AnalogPinModel.h" 10 | 11 | 12 | @implementation AnalogPinModel 13 | #pragma mark Properties 14 | @synthesize pinNumber = pinNumber_; 15 | @synthesize value = value_; 16 | @synthesize enabled = enabled_; 17 | @end 18 | -------------------------------------------------------------------------------- /doc/iTunesPreviewDescription_ja.txt: -------------------------------------------------------------------------------- 1 | "OTOduino"は、グラフィカル表示をするアナログ信号のデータ通信ターミナルアプリです。フィジカルコンピューティングに使われるマイコンボードArduino(TM)とiPhoneをイヤホン端子で接続して、音声信号でArduinoのアナログ端子およびデジタル端子をiPhoneからモニターおよび制御ができます。 2 | 3 | このアプリ "OTOduino" (ソースコードのレポジトリ https://github.com/reinforce-lab/OTOduino) そしてOTOduinoが利用しているソフトウェアモデム "OTO-plug" (レポジトリ https://github.com/reinforce-lab/OTO-plug) は、いずれもThe MIT licenseでオープンソースプロジェクトとして公開されています。いずれのプロジェクトもREINFORCE Lab.が運営しています。 4 | -------------------------------------------------------------------------------- /src/iphone/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 13 | int retVal = UIApplicationMain(argc, argv, nil, nil); 14 | [pool release]; 15 | return retVal; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/iphone/DigitalPinModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // DigitalPinModel.m 3 | // OTOduino 4 | // 5 | // Created by 上原 昭宏 on 11/01/30. 6 | // Copyright 2011 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "DigitalPinModel.h" 10 | 11 | @implementation DigitalPinModel 12 | #pragma mark Properties 13 | @synthesize portNumber = portNumber_; 14 | @synthesize pinNumber = pinNumber_; 15 | @synthesize pinMode = pinMode_; 16 | @synthesize value = value_; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /src/iphone/AnalogPinModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // AnalogPinModel.h 3 | // OTOduino 4 | // 5 | // Created by 上原 昭宏 on 11/01/30. 6 | // Copyright 2011 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface AnalogPinModel : NSObject { 13 | int pinNumber_; 14 | int value_; 15 | bool enabled_; 16 | } 17 | @property (nonatomic, assign) int pinNumber; 18 | @property (nonatomic, assign) int value; 19 | @property (nonatomic, assign) bool enabled; 20 | @end 21 | -------------------------------------------------------------------------------- /doc/iTunesPreviewDescription.txt: -------------------------------------------------------------------------------- 1 | "OTO" means "sound" in Japaniese. 2 | "OTOduino" is a visualized sound modem terminal application for iPhone. You can monitor and control Arduino(TM)digial and analog ports status by connecting your Arduino to iPhone earphone jack. 3 | 4 | Both "OTOduino" (repository https://github.com/reinforce-lab/OTOduino) project and a software modem project "OTO-plug" (repository https://github.com/reinforce-lab/OTO-plug) which "OTOduino" uses are open-source projects released under MIT license. 5 | -------------------------------------------------------------------------------- /src/iphone/DigitalPinModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // digitalPinModel.h 3 | // OTOduino 4 | // 5 | // Created by 上原 昭宏 on 11/01/30. 6 | // Copyright 2011 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OTOduinoTypes.h" 11 | 12 | @interface DigitalPinModel : NSObject { 13 | int portNumber_; 14 | int pinNumber_; 15 | OTOduinoPinModeType pinMode_; 16 | int value; 17 | } 18 | @property (nonatomic, assign) int portNumber; 19 | @property (nonatomic, assign) int pinNumber; 20 | @property (nonatomic, assign) OTOduinoPinModeType pinMode; 21 | @property (nonatomic, assign) int value; 22 | @end 23 | -------------------------------------------------------------------------------- /src/iphone/Classes/IOViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // IOViewController.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/22. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OTOduinoHost.h" 11 | #import "AnalogPinView.h" 12 | #import "DigitalPinView.h" 13 | #import "ConnectionStatusView.h" 14 | 15 | @interface IOViewController : UIViewController { 16 | IBOutlet UIImageView *bakgroundImageView_; 17 | 18 | OTOduinoHost *host_; 19 | // AnalogPinView *analogPorts_[kNumOfAnalogPorts]; 20 | // DigitalPinView *digitalPorts_[kNumOfDigitalPorts]; 21 | ConnectionStatusView *connectStatusView_; 22 | } 23 | @end 24 | -------------------------------------------------------------------------------- /src/iphone/Classes/OTOduinoAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // OTOduinoAppDelegate.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OTOduinoHost.h" 11 | 12 | @interface OTOduinoAppDelegate : NSObject { 13 | UIWindow *window; 14 | UITabBarController *tabBarController; 15 | 16 | OTOduinoHost *host_; 17 | } 18 | 19 | @property (nonatomic, retain) IBOutlet UIWindow *window; 20 | @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; 21 | @property (nonatomic, readonly) OTOduinoHost *host; 22 | @end 23 | -------------------------------------------------------------------------------- /src/iphone/Classes/OTOplugDetailView.m: -------------------------------------------------------------------------------- 1 | // 2 | // OTOplugDetailView.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "OTOplugDetailView.h" 10 | 11 | 12 | @implementation OTOplugDetailView 13 | 14 | 15 | - (id)initWithFrame:(CGRect)frame { 16 | 17 | self = [super initWithFrame:frame]; 18 | if (self) { 19 | // Initialization code. 20 | } 21 | return self; 22 | } 23 | 24 | /* 25 | // Only override drawRect: if you perform custom drawing. 26 | // An empty implementation adversely affects performance during animation. 27 | - (void)drawRect:(CGRect)rect { 28 | // Drawing code. 29 | } 30 | */ 31 | 32 | - (void)dealloc { 33 | [super dealloc]; 34 | } 35 | 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /src/iphone/Classes/ConnectionDialogView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ConnectionDialogView.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "ConnectionDialogView.h" 10 | 11 | 12 | @implementation ConnectionDialogView 13 | 14 | 15 | - (id)initWithFrame:(CGRect)frame { 16 | 17 | self = [super initWithFrame:frame]; 18 | if (self) { 19 | // Initialization code. 20 | } 21 | return self; 22 | } 23 | 24 | /* 25 | // Only override drawRect: if you perform custom drawing. 26 | // An empty implementation adversely affects performance during animation. 27 | - (void)drawRect:(CGRect)rect { 28 | // Drawing code. 29 | } 30 | */ 31 | 32 | - (void)dealloc { 33 | [super dealloc]; 34 | } 35 | 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /src/iphone/Classes/ConnectionStatusView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ConnectionStatusView.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/22. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OTOduinoHost.h" 11 | 12 | /// ConnectionStatusView 13 | /// This class must not be initialized with a selector intWithRect:. 14 | /// An instance of this class must be initialized calling: 15 | /// [[NSBundle mainBundle] loadNibNamed:@"ConnectionStatusView" owner:self options:nil] objectAtInde:0] 16 | @interface ConnectionStatusView : UIView { 17 | IBOutlet UIImageView *iconImageView_; 18 | IBOutlet UILabel *errorTextlabel_; 19 | 20 | OTOduinoHost *host_; 21 | } 22 | @property (nonatomic, assign, getter=getHost, setter=setHost:) OTOduinoHost *host; 23 | @end 24 | -------------------------------------------------------------------------------- /src/iphone/Classes/ColorBarView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ColorBarView.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | #import 9 | #import "ImageSource.h" 10 | 11 | /// Analog color bar meter. 12 | /// Color bar is shown when |highlighted property is TRUE. When highlighted is FALSE 13 | /// Default frame width and height is 109 and 19, previously. 14 | /// 15 | @interface ColorBarView : UIImageView { 16 | int index_; 17 | Float32 value_, maxValue_, minValue_; 18 | } 19 | @property (nonatomic, assign, getter=getValue, setter=setValue:) Float32 value; 20 | @property (nonatomic, assign) Float32 maxValue; 21 | @property (nonatomic, assign) Float32 minValue; 22 | 23 | -(Float32)getValue; 24 | -(void)setValue:(Float32)value; 25 | @end 26 | -------------------------------------------------------------------------------- /src/iphone/Classes/ArduinoModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // ClientState.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/25. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OTOduinoTypes.h" 11 | #import "AnalogPinModel.h" 12 | #import "digitalPinModel.h" 13 | 14 | #define kNumOfAnalogPins 6 15 | #define kNumOfDigitalPins 14 16 | 17 | #define kModemAnalogPinNum 0 18 | #define kModemDigitalPinNum 13 19 | 20 | /// Remote client status 21 | @interface ArduinoModel : NSObject { 22 | @private 23 | NSArray *analogPinModes_; 24 | NSArray *digitalPinModes_; 25 | } 26 | @property (nonatomic, readonly) NSArray *analogPinModels; 27 | @property (nonatomic, readonly) NSArray *digitalPinModels; 28 | 29 | -(bool)isReservedModemDigitalPin:(int)pinnum; 30 | -(bool)isReservedModemAnalogPin:(int) pinnum; 31 | @end 32 | -------------------------------------------------------------------------------- /src/iphone/OTOduinoHostDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // OTOduinoHostDelegate.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/23. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "OTOduinoTypes.h" 10 | 11 | // OTOduinoPinModeType socket delegate protocol 12 | @protocol OTOduinoHostDelegate 13 | @optional 14 | // Lower layer sends bufferEmptyCallback message to the upper layer when it completes sending all byte data. 15 | - (void)sendBufferEmptyNotify; 16 | 17 | //receiving pin/port value 18 | - (void)receiveAnalogPinValue:(Byte)pin value:(int)value; 19 | - (void)receiveDigitalPortValue:(Byte)port value:(int)value; 20 | //receiving pin/port status 21 | -(void)receiveAnalogPinEnabled:(Byte)pin enabled:(BOOL)enabled; 22 | -(void)receiveDigitalPinMode:(Byte)pin pinMode:(OTOduinoPinModeType)pinMode; 23 | //client status 24 | -(void)receiveClientInitializedMessage; 25 | @end 26 | -------------------------------------------------------------------------------- /src/iphone/Classes/DigitalPinView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DigitalPinView.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | #import 9 | #import "OTOduinoHost.h" 10 | #import "DigitalPinModel.h" 11 | 12 | /// Digital port meter view 13 | /// This class must not be initialized with a selector intWithRect:. 14 | /// An instance of this class must be initialized calling: 15 | /// [[NSBundle mainBundle] loadNibNamed:@"DigitalPinView" owner:self options:nil] objectAtInde:0] 16 | @interface DigitalPinView : UIView { 17 | IBOutlet UILabel *titleLabel_; 18 | IBOutlet UIButton *pinDirectionButton_; 19 | IBOutlet UIButton *button_; 20 | 21 | OTOduinoHost *host_; 22 | DigitalPinModel *model_; 23 | } 24 | 25 | -(void)initialize:(int)pinNumber host:(OTOduinoHost *)host; 26 | -(IBAction)pinDirectionButtonTouched:(id)sender; 27 | -(IBAction)buttonTouched:(id)sender; 28 | @end 29 | -------------------------------------------------------------------------------- /src/iphone/Classes/VoltageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoltageView.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ColorBarView.h" 11 | 12 | /// Digital port meter view 13 | /// This class must not be initialized with a selector intWithRect:. 14 | /// An instance of this class must be initialized calling: 15 | /// [[NSBundle mainBundle] loadNibNamed:@"VoltageView" owner:self options:nil] objectAtInde:0] 16 | @interface VoltageView : UIView { 17 | IBOutlet UILabel *valueLabel_; 18 | IBOutlet UILabel *titleLabel_; 19 | 20 | IBOutlet ColorBarView *colorBarView_; 21 | } 22 | @property (nonatomic, assign, getter=getValue, setter=setValue:) Float32 value; 23 | @property (nonatomic, assign, getter=getMaxValue, setter = setMaxValue:) Float32 maxValue; 24 | @property (nonatomic, assign, getter=getMinValue, setter = setMinValue:) Float32 minValue; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /src/iphone/OTOduino-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | icon 13 | CFBundleIdentifier 14 | com.reinforce-lab.otoduino 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0.2 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/iphone/Classes/AnalogPinView.h: -------------------------------------------------------------------------------- 1 | // 2 | // AnalogPinView.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OTOduinoHost.h" 11 | #import "AnalogPinModel.h" 12 | #import "ColorBarView.h" 13 | 14 | /// Digital port meter view 15 | /// This class must not be initialized with a selector intWithRect:. 16 | /// An instance of this class must be initialized calling: 17 | /// [[NSBundle mainBundle] loadNibNamed:@"DigitalPinView" owner:self options:nil] objectAtInde:0] 18 | @interface AnalogPinView : UIView { 19 | IBOutlet UILabel *titleLabel_; 20 | IBOutlet UILabel *valueLabel_; 21 | IBOutlet UILabel *unitLabel_; 22 | IBOutlet ColorBarView *colorBarView_; 23 | 24 | BOOL enabled_; 25 | OTOduinoHost *host_; 26 | AnalogPinModel *model_; 27 | } 28 | 29 | -(void)initialize:(int)pinNumber host:(OTOduinoHost *)host title:(NSString *)title unit:(NSString *)unit maxValue:(Float32)maxValue minValue:(Float32)minValue; 30 | @end 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OTOduino is a visualized sound modem iPhone application for Arduino(TM). With this application, Arduino IO ports can be controlled by iPhone via ear phone. 2 | This source codes are releaesed under The MIT license. 3 | 4 | Making an original iPhone external device was difficult because standard SDK does not provide a framework to access an iPhone dock connector. This application that sends and receives modulated audible signal to communicate with Arduino via ear phone is a good example to start your original iPhone device and its application developments. 5 | 6 | This application has been developed by a freelance engineer Akihiro UEHARA. I have been providing iPhone application development services. If you have questions or troubles in application developments, please contact to me. 7 | 8 | Akihiro UEHARA 9 | Reinforce Lab. 10 | Rose court 102, Miyakita-street 5-173, Gamagori, Aichi 443-0022, JAPAN 11 | TEL: +81-533-68-0815 12 | e-mail: u-akihiro@reinforce-lab.com 13 | Twitter: @reinforcelab 14 | Blog: http://blog.reinforce-lab.com/ 15 | Web: http://www.reinforce-lab.com/ (written in Japanese) 16 | 17 | -------------------------------------------------------------------------------- /src/iphone/Classes/VoltageView.m: -------------------------------------------------------------------------------- 1 | // 2 | // VoltageView.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "VoltageView.h" 10 | 11 | @interface VoltageView (Private) 12 | -(Float32)getValue; 13 | -(void)setValue:(Float32)value; 14 | -(Float32)getMaxValue; 15 | -(void)setMaxValue:(Float32)value; 16 | -(Float32)getMinValue; 17 | -(void)setMinValue:(Float32)value; 18 | @end 19 | 20 | @implementation VoltageView 21 | #pragma mark Properties 22 | @dynamic value; 23 | @dynamic maxValue; 24 | @dynamic minValue; 25 | -(Float32)getValue 26 | { 27 | return colorBarView_.value; 28 | } 29 | -(void)setValue:(Float32)value 30 | { 31 | colorBarView_.value = value; 32 | valueLabel_.text = [NSString stringWithFormat:@"%1.2f V", colorBarView_.value]; 33 | } 34 | -(void)setMaxValue:(Float32)value 35 | { 36 | colorBarView_.maxValue = value; 37 | } 38 | -(Float32)getMaxValue 39 | { 40 | return colorBarView_.maxValue; 41 | } 42 | -(void)setMinValue:(Float32)value 43 | { 44 | colorBarView_.minValue = value; 45 | } 46 | -(Float32)getMinValue 47 | { 48 | return colorBarView_.minValue; 49 | } 50 | @end 51 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2011 REINFORCE Lab. ( http://www.reinforce-lab.com ) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/iphone/Classes/ColorBarView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ColorBarView.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | #import "ColorBarView.h" 9 | #include "math.h" 10 | 11 | @interface ColorBarView(Private) 12 | -(void)initialize; 13 | @end 14 | 15 | @implementation ColorBarView 16 | #pragma mark Properties 17 | @synthesize maxValue = maxValue_; 18 | @synthesize minValue = minValue_; 19 | @dynamic value; 20 | 21 | -(Float32)getValue 22 | { 23 | return value_; 24 | } 25 | -(void)setValue:(Float32)value 26 | { 27 | // update a value and calculate a color bat index 28 | value_ = value; 29 | int index = (int)ceilf(10.0f * value / (maxValue_ - minValue_)); // MEMO 0 div exception? 30 | 31 | // update a color bar image 32 | if(index_ != index) { 33 | index_ = (index > index_) ? (index_ +1) : (index_ -1); 34 | self.image = [ImageSource getColorBarImage:index_]; 35 | } 36 | } 37 | #pragma mark Constructor 38 | -(void)awakeFromNib 39 | { 40 | [self initialize]; 41 | } 42 | -(void)initialize 43 | { 44 | maxValue_ = 255; 45 | minValue_ = 0; 46 | 47 | self.backgroundColor = [UIColor clearColor]; 48 | self.image = [ImageSource getColorBarImage:5]; 49 | } 50 | - (void)dealloc { 51 | [super dealloc]; 52 | } 53 | @end 54 | -------------------------------------------------------------------------------- /src/iphone/OTOduinoSocket.h: -------------------------------------------------------------------------------- 1 | // 2 | // OTOduinoPinModeTypeSocket.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/23. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SWMSocket.h" 11 | #import "FSKModem.h" 12 | #import "AudioPHY.h" 13 | 14 | #import "OTOduinoTypes.h" 15 | #import "OTOduinoHostDelegate.h" 16 | 17 | #define kBufferSize 127 18 | 19 | @interface OTOduinoSocket : NSObject { 20 | FSKModem *modem_; 21 | AudioPHY *audioPHY_; 22 | NSObject *delegate_; 23 | Byte buf_[kBufferSize]; 24 | } 25 | @property (nonatomic, readonly) FSKModem *modem; 26 | @property (nonatomic, readonly) AudioPHY *audioPHY; 27 | 28 | -(id)initWithDelegate:(NSObject *)delegate; 29 | 30 | // configurate pin/port 31 | -(BOOL)enableAnalogPin:(Byte)pin enabled:(BOOL)enabled; 32 | //-(BOOL)enableDigitalPort:(Byte)port enabled:(BOOL)enabled; 33 | -(BOOL)setDigitalPinMode:(Byte)pin pinMode:(OTOduinoPinModeType)pinMode; 34 | 35 | // request pin/port value 36 | -(BOOL)setDigitalOutput:(Byte)port value:(int)value; 37 | 38 | // pin status readback 39 | -(BOOL)requestAnalogPinEnabled:(Byte)pin; 40 | //-(BOOL)requestDigitalPortEnabled:(Byte)port; 41 | -(BOOL)requestDigitalPinMode:(Byte)pin; 42 | 43 | // client status commands 44 | -(BOOL)confirmedClientInitialization; 45 | //-(BOOL)requestVersionReport; 46 | // TODO I2C, sampling interval, Servos 47 | @end 48 | -------------------------------------------------------------------------------- /src/iphone/OTOduinoHost.h: -------------------------------------------------------------------------------- 1 | // 2 | // OTOduinoPinModeTypeHost.h 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/25. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OTOduinoSocket.h" 11 | #import "ArduinoModel.h" 12 | 13 | typedef enum OTOduinoConnectionStat { 14 | HeadsetIsNotAvailable = 0, 15 | InSufficientVolume = 1, 16 | SoftwarePLLUnLock = 2, 17 | NoError = 10 18 | }OTOduinoConnectionErrorType; 19 | 20 | @interface OTOduinoHost : NSObject { 21 | OTOduinoSocket *socket_; 22 | ArduinoModel *client_; 23 | 24 | BOOL shouldCheckAnalogEnabled_[kNumOfAnalogPins]; 25 | // BOOL shouldCheckDigitalEnabled_[kNumOfDigitalPins]; 26 | BOOL shouldCheckPinMode_[kNumOfDigitalPins]; 27 | 28 | int digitalValue_; 29 | OTOduinoConnectionErrorType connectionStat_; 30 | 31 | BOOL mute_; 32 | } 33 | 34 | @property (nonatomic, readonly) OTOduinoSocket *socket; 35 | @property (nonatomic, readonly) ArduinoModel *model; 36 | @property (nonatomic, getter=getMute, setter=setMute:) BOOL mute; 37 | 38 | // connection status flags 39 | @property (nonatomic) OTOduinoConnectionErrorType connectionStat; 40 | 41 | -(void)setAnalogPinEnabled:(Byte)pin enabled:(BOOL)enabled; 42 | //-(void)setDigitalPortEnabled:(Byte)port enabled:(BOOL)enabled; 43 | -(void)setDigitalPinMode:(Byte)pin pinMode:(OTOduinoPinModeType)pinMode; 44 | -(void)setDigitalPinValue:(Byte)pin value:(int)value; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /src/iphone/Classes/ArduinoModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // ClientState.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/25. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "ArduinoModel.h" 10 | 11 | @implementation ArduinoModel 12 | #pragma mark Properties 13 | @synthesize analogPinModels = analogPinModels_; 14 | @synthesize digitalPinModels =digitalPinModels_; 15 | 16 | #pragma mark Constructor 17 | -(id)init 18 | { 19 | self = [super init]; 20 | if(self) { 21 | // analog pin models 22 | NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:kNumOfAnalogPins]; 23 | for(int i=0; i < kNumOfAnalogPins; i++) { 24 | AnalogPinModel *pin = [[[AnalogPinModel alloc] init] autorelease]; 25 | pin.pinNumber = i; 26 | [array addObject:pin]; 27 | } 28 | analogPinModels_ = array; 29 | //digital pin models 30 | array =[[NSMutableArray alloc] initWithCapacity:kNumOfDigitalPins]; 31 | for(int i=0; i < kNumOfDigitalPins; i++) { 32 | DigitalPinModel *pin = [[[DigitalPinModel alloc] init] autorelease]; 33 | pin.pinNumber = i; 34 | pin.pinMode = Input; 35 | [array addObject:pin]; 36 | } 37 | digitalPinModels_ = array; 38 | } 39 | return self; 40 | } 41 | -(void)dealloc 42 | { 43 | [analogPinModels_ release]; 44 | [digitalPinModels_ release]; 45 | 46 | [super dealloc]; 47 | } 48 | #pragma mark Public methods 49 | -(bool)isReservedModemDigitalPin:(int) pinnum 50 | { 51 | return (pinnum == 0) || (pinnum == 1) || (pinnum == kModemDigitalPinNum); 52 | } 53 | -(bool)isReservedModemAnalogPin:(int) pinnum 54 | { 55 | return (pinnum == kModemAnalogPinNum); 56 | } 57 | @end 58 | -------------------------------------------------------------------------------- /src/iphone/Classes/ConnectionStatusView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ConnectionStatusView.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/22. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "ConnectionStatusView.h" 10 | @interface ConnectionStatusView(Private) 11 | -(void)updateView; 12 | @end 13 | 14 | @implementation ConnectionStatusView 15 | #pragma mark Properties 16 | @dynamic host; 17 | -(OTOduinoHost *)getHost 18 | { 19 | return host_; 20 | } 21 | -(void)setHost:(OTOduinoHost *)host 22 | { 23 | if(host == host_) return; 24 | 25 | [host_ removeObserver:self forKeyPath:@"connectionStat"]; 26 | [host_ release]; 27 | 28 | host_ = host; 29 | [host_ addObserver:self forKeyPath:@"connectionStat" options:NSKeyValueObservingOptionNew context:nil]; 30 | 31 | [self updateView]; 32 | } 33 | #pragma mark Constructor 34 | -(void)dealloc 35 | { 36 | self.host = nil; 37 | 38 | [super dealloc]; 39 | } 40 | -(void)updateView 41 | { 42 | iconImageView_.highlighted = (host_.connectionStat == NoError); 43 | switch (host_.connectionStat) { 44 | case HeadsetIsNotAvailable: 45 | errorTextlabel_.text = @"No earphone jack."; 46 | break; 47 | case InSufficientVolume: 48 | errorTextlabel_.text = @"Output volume is small."; 49 | break; 50 | case SoftwarePLLUnLock: 51 | errorTextlabel_.text = @"Cannot receive packets."; 52 | break; 53 | default: 54 | errorTextlabel_.text = @""; 55 | break; 56 | } 57 | } 58 | #pragma mark KVO 59 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 60 | { 61 | // NSLog(@"%s %@ (connection error) %d",__func__, keyPath, host_.connectionStat); 62 | [self updateView]; 63 | } 64 | @end 65 | -------------------------------------------------------------------------------- /src/iphone/Classes/OTOduinoAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // OTOduinoAppDelegate.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "OTOduinoAppDelegate.h" 10 | 11 | @implementation OTOduinoAppDelegate 12 | #pragma mark Properties 13 | @synthesize window; 14 | @synthesize tabBarController; 15 | @synthesize host = host_; 16 | 17 | #pragma mark Application lifecycle 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // prepare firmata host 20 | host_ = [[OTOduinoHost alloc] init]; 21 | 22 | // prepare view controller 23 | [self.window addSubview:tabBarController.view]; 24 | [self.window makeKeyAndVisible]; 25 | 26 | return YES; 27 | } 28 | - (void)applicationWillTerminate:(UIApplication *)application { 29 | [host_ release]; 30 | } 31 | 32 | - (void)applicationWillResignActive:(UIApplication *)application { 33 | } 34 | - (void)applicationDidEnterBackground:(UIApplication *)application { 35 | } 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | } 38 | - (void)applicationDidBecomeActive:(UIApplication *)application { 39 | } 40 | 41 | #pragma mark UITabBarControllerDelegate methods 42 | /* 43 | // Optional UITabBarControllerDelegate method. 44 | - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { 45 | } 46 | */ 47 | /* 48 | // Optional UITabBarControllerDelegate method. 49 | - (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed { 50 | } 51 | */ 52 | #pragma mark Memory management 53 | - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { 54 | } 55 | 56 | - (void)dealloc { 57 | [tabBarController release]; 58 | [window release]; 59 | [super dealloc]; 60 | } 61 | @end 62 | 63 | -------------------------------------------------------------------------------- /src/arduino/OTOduinoSimpleClient/OTOduinoTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OTOduinoTypes.h 3 | * 4 | * Created by UEHARA AKIHIRO on 10/12/23. 5 | * Copyright 2010 REINFORCE Lab. All rights reserved. 6 | * 7 | */ 8 | 9 | /// OTOduinoPinModeType 2.1 protocol header 10 | /// Details of the protocol is desribed in : http://firmata.org/wiki/Protocol 11 | #ifndef _OTODUINO_TYPES_H_ 12 | #define _OTODUINO_TYPES_H_ 13 | 14 | // Protocol version which this library supports 15 | #define kOTOduinoPinModeTypeProtocolVersion 2.1 16 | 17 | // OTOduinoPinModeType command type 18 | typedef enum OTOduinoCommand { 19 | //** Analog pin commands ** 20 | // client reports analog pin value 21 | analogIOMessage = 0x11, //(analogIOMessage, pin#, lsb<7:0>, msb<15:8>) 22 | // host sets an analog pin enable/disable 23 | setAnalogPinEnabled = 0x12, // 24 | // host requests the client to report analog pin enable/disable flag 25 | requestAnalogPinEnabled = 0x13, // 26 | // client rports its analog pin enable/disable flag 27 | analogPinEnabledMessage = 0x14, // 28 | 29 | //** Digital pin commands ** 30 | // client reports digital port value 31 | digitalIOMessage = 0x21, //, msb<15:8>> 32 | setDigitalPinMode = 0x22, // 33 | requestDigitalPinMode = 0x23, // 34 | digitalPinModeMessage = 0x24, // 35 | 36 | //** Board status commands ** 37 | clientInitMessage = 0x31, // 38 | clientInitConfirmedMessage = 0x32, // 39 | // firmware version and name 40 | // 41 | } OTOduinoCommandType; 42 | 43 | // Pin mode type 44 | typedef enum OTOduinoPinModeType { 45 | Disabled = 0, 46 | Input = 1, 47 | Output = 2, 48 | Analog = 3, 49 | PWM = 4, 50 | Servo = 5 51 | } OTOduinoPinModeType; 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /src/iphone/OTOduinoTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OTOduinoTypes.h 3 | * 4 | * Created by UEHARA AKIHIRO on 10/12/23. 5 | * Copyright 2010 REINFORCE Lab. All rights reserved. 6 | * 7 | */ 8 | 9 | /// OTOduinoPinModeType 2.1 protocol header 10 | /// Details of the protocol is desribed in : http://firmata.org/wiki/Protocol 11 | #ifndef _OTODUINO_TYPES_H_ 12 | #define _OTODUINO_TYPES_H_ 13 | 14 | // Protocol version which this library supports 15 | #define kOTOduinoPinModeTypeProtocolVersion 2.1 16 | 17 | // OTOduinoPinModeType command type 18 | typedef enum OTOduinoCommand { 19 | //** Analog pin commands ** 20 | // client reports analog pin value 21 | analogIOMessage = 0x11, //(analogIOMessage, pin#, lsb<7:0>, msb<15:8>) 22 | // host sets an analog pin enable/disable 23 | setAnalogPinEnabled = 0x12, // 24 | // host requests the client to report analog pin enable/disable flag 25 | requestAnalogPinEnabled = 0x13, // 26 | // client rports its analog pin enable/disable flag 27 | analogPinEnabledMessage = 0x14, // 28 | 29 | //** Digital pin commands ** 30 | // client reports digital port value 31 | digitalIOMessage = 0x21, //, msb<15:8>> 32 | setDigitalPinMode = 0x22, // 33 | requestDigitalPinMode = 0x23, // 34 | digitalPinModeMessage = 0x24, // 35 | 36 | //** Board status commands ** 37 | clientInitMessage = 0x31, // 38 | clientInitConfirmedMessage = 0x32, // 39 | // firmware version and name 40 | // 41 | } OTOduinoCommandType; 42 | 43 | // Pin mode type 44 | typedef enum OTOduinoPinModeType { 45 | Disabled = 0, 46 | Input = 1, 47 | Output = 2, 48 | Analog = 3, 49 | PWM = 4, 50 | Servo = 5 51 | } OTOduinoPinModeType; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/iphone/Classes/ImageSource.m: -------------------------------------------------------------------------------- 1 | // 2 | // ImageSource.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "ImageSource.h" 10 | 11 | 12 | @interface ImageSource(Private) 13 | +(NSString *)getImagePath:(NSString *)fileNameWithoutExtention; 14 | +(UIImage *)getUIImage:(NSString *)fileNameWithoutExtension; 15 | +(UIImageView *)getUIImageView:(NSString *)fileNameWithoutExtention; 16 | @end 17 | 18 | @implementation ImageSource 19 | #pragma mark Helper methods 20 | +(NSString *)getImagePath:(NSString * )fileNameWithoutExtention 21 | { 22 | // return [[NSBundle mainBundle] pathForResource:fileNameWithoutExtention ofType:@"png" inDirectory:@"Image"]; 23 | return [[NSBundle mainBundle] pathForResource:fileNameWithoutExtention ofType:@"png"]; 24 | } 25 | +(UIImage *)getUIImage:(NSString *)fileNameWithoutExtention 26 | { 27 | return [UIImage imageWithContentsOfFile:[ImageSource getImagePath:fileNameWithoutExtention]]; 28 | } 29 | +(UIImageView *)getUIImageView:(NSString *)fileNameWithoutExtention 30 | { 31 | return [[[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:[ImageSource getImagePath:fileNameWithoutExtention]]] autorelease]; 32 | } 33 | #pragma mark Class methods 34 | +(UIImage *)getColorBarImage:(int)index 35 | { 36 | switch(index) { 37 | // case 0: return [ImageSource getUIImage:@"bar00"]; 38 | case 1: return [ImageSource getUIImage:@"bar01"]; 39 | case 2: return [ImageSource getUIImage:@"bar02"]; 40 | case 3: return [ImageSource getUIImage:@"bar03"]; 41 | case 4: return [ImageSource getUIImage:@"bar04"]; 42 | case 5: return [ImageSource getUIImage:@"bar05"]; 43 | case 6: return [ImageSource getUIImage:@"bar06"]; 44 | case 7: return [ImageSource getUIImage:@"bar07"]; 45 | case 8: return [ImageSource getUIImage:@"bar08"]; 46 | case 9: return [ImageSource getUIImage:@"bar09"]; 47 | case 10: return [ImageSource getUIImage:@"bar10"]; 48 | } 49 | return [ImageSource getUIImage:@"bar00"]; 50 | } 51 | @end 52 | -------------------------------------------------------------------------------- /src/iphone/Classes/DigitalPinView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DigitalPinView.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "DigitalPinView.h" 10 | 11 | @interface DigitalPinView (Private) 12 | @end 13 | 14 | @implementation DigitalPinView 15 | #pragma mark Constructor 16 | -(void)awakeFromNib 17 | { 18 | } 19 | -(void)dealloc 20 | { 21 | [model_ removeObserver:self forKeyPath:@"value"]; 22 | [model_ removeObserver:self forKeyPath:@"pinMode"]; 23 | [host_ release]; 24 | } 25 | #pragma mark Event handler 26 | -(IBAction)pinDirectionButtonTouched:(id)sender 27 | { 28 | OTOduinoPinModeType mode = (model_.pinMode == Input) ? Output : Input; 29 | [host_ setDigitalPinMode:model_.pinNumber pinMode:mode]; 30 | } 31 | -(IBAction)buttonTouched:(id)sender 32 | { 33 | if(model_.pinMode == Output) { 34 | NSLog(@"%s", __func__); 35 | int val = (model_.value == 0) ? 1 : 0; 36 | [host_ setDigitalPinValue:model_.pinNumber value:val]; 37 | } 38 | } 39 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 40 | { 41 | // NSLog(@"%s keypath:%@ ofObject:%@ change:%@ context:%@", __func__,keyPath, object, change, context ); 42 | if([keyPath isEqualToString:@"pinMode"]) { 43 | pinDirectionButton_.selected = (model_.pinMode == Output); 44 | } else if([keyPath isEqualToString:@"value"] ){ 45 | button_.selected = (model_.value == 0) ? false : true; 46 | } 47 | } 48 | #pragma mark Public methods 49 | -(void)initialize:(int)pinNumber host:(OTOduinoHost *)host 50 | { 51 | host_ = [host retain]; 52 | model_ = [host_.model.digitalPinModels objectAtIndex:pinNumber]; 53 | 54 | // add observer 55 | [model_ addObserver:self forKeyPath:@"value" options:NSKeyValueObservingOptionNew context:nil]; 56 | [model_ addObserver:self forKeyPath:@"pinMode" options:NSKeyValueObservingOptionNew context:nil]; 57 | 58 | // set default values 59 | titleLabel_.text = [NSString stringWithFormat:@"D%02d", pinNumber]; 60 | pinDirectionButton_.selected = (model_.pinMode == Output); 61 | button_.selected = (model_.value == 0) ? false : true; 62 | } 63 | @end -------------------------------------------------------------------------------- /src/iphone/Japanese.lproj/help.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

"OTOduino"って何?

9 |

"OTOduino"はイヤホン端子に接続したArduino(TM)のIOポートをモニタ、制御できる、グラフィカルなモデム端末アプリです。 10 | とてもシンプルなインタフェース回路を使いイヤホン端子につなぐだけで、あなたのArduinoとiPhoneがつながります。 11 | 12 |

13 | 14 |

この"OTOduino"アプリ (ソースコード レポジトリ https://github.com/reinforce-lab/OTOduino) project 15 | と、このアプリが使用している "OTO-plug" (レポジトリ https://github.com/reinforce-lab/OTO-plug) 16 | プロジェクトは、いずれもThe MIT licenseで公開されているオープンソースプロジェクトです。 17 | この2つのプロジェクトはフリーランスiPhoneアプリ開発者、上原 昭宏 (屋号 REINFORCE Lab. http://www.reinforce-lab.com/)が運営しています。 18 |

19 | 20 |

Arduino インタフェース回路とスケッチ

21 | OTOduinoを手元のArduinoで使うには、インタフェース回路の作製とスケッチの書き込みが必要です。 22 |

インタフェース回路

23 |

3月までにインタフェース回路のキットを販売する予定ですが、とてもシンプルな回路なので自分で作ることもできます。回路図は以下のものです: 24 | 25 |
26 | 回路図のコンデンサC1およびC2には、どんな種類のものでも使えますが、積層セラミックコンデンサが安価で入手性がよいです。値は0.1uF以上のものを使ってください(値が0.1uF以上ならば、例えば1uFでも動作します)。 27 | イヤホンジャックの音声出力端子は、必ず左チャネルをArduinoに接続してください。アプリ OTOduino はデータ送信に左チャネルのみを使い、右チャネルは無音にします。 28 |

29 |

スケッチのアップロード

30 |

スケッチの書き込みには、まずライブラリの追加が必要です。Arduinoのライブラリフォルダに"SoftwareModem"というディレクトリ(Macならば ~/Document/Arduino/libraries/ に) 31 | を作成します。次に、SoftwareModem.cppとSoftwareModem.h ファイルをレポジトリ https://github.com/reinforce-lab/OTOduino/tree/master/OTO-plug/src/arduino/libraries/SoftwareModem/ 32 | からダウンロードします。 33 |

34 |

次にスケッチをダウンロードして書き込みます。"OTOduinoSImpleClient" というフォルダを作り、ファイル OTOduinoSimpleClient.pde と OTOduinoTypes.h をレポジトリ 35 | https://github.com/reinforce-lab/OTOduino/tree/master/src/arduino/OTOduinoSimpleClient 36 | からダウンロードします。このOTOduinoSimpleClientスケッチをArduino IDEで開き、Verify/uploadして書き込みます。

37 | 38 |

OTOduinoの使い方

39 |

iPhoneのイヤホン端子にジャックを挿入すると、アプリOTOduinoの画面左下にある接続状況アイコンが白色から赤色に変化して接続したことを知らせます。 40 | もしもアイコンが接続状態に変化しなければ、アイコンの右横に表示されているメッセージを確認して下さい。 41 | 接続ができないほとんどの原因は、ヘッドホンの出力音量を最大値にしていないことです。

42 |

OTOduinoを使うと、Arduinoのアナログ端子の電圧をモニターできます。 43 | 画面左に並んでいるアナログパネルをタッチすることで、電圧モニターを有効/無効にできます。 44 | Arduinoのデジタル端子をモニターするには、画面左にならぶデジタル端子それぞれの操作ボタンのうち、真ん中にある"IN"/"OUT"ボタンをタッチして”IN"にします。 45 | この状態で、デジタル端子のHIGH/LOW値が最も右にあるボタンに表示されます。 46 | Arduinoのデジタル端子から信号を出力するには、先程のアイコンをタッチして”OUT"にします。右のボタンをタッチすることで、出力値をHIGH/LOWに切り替えられます。 47 |

48 | 49 | 50 | -------------------------------------------------------------------------------- /src/iphone/Classes/HelpViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HelpViewController.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/22. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "HelpViewController.h" 10 | 11 | @interface HelpViewController(Private) 12 | -(void)loadHelpPage; 13 | @end 14 | 15 | @implementation HelpViewController 16 | 17 | // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. 18 | /* 19 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { 20 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 21 | if (self) { 22 | // Custom initialization. 23 | } 24 | return self; 25 | } 26 | */ 27 | 28 | 29 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | 33 | [self loadHelpPage]; 34 | } 35 | 36 | 37 | /* 38 | // Override to allow orientations other than the default portrait orientation. 39 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 40 | // Return YES for supported orientations. 41 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 42 | } 43 | */ 44 | 45 | - (void)didReceiveMemoryWarning { 46 | // Releases the view if it doesn't have a superview. 47 | [super didReceiveMemoryWarning]; 48 | 49 | // Release any cached data, images, etc. that aren't in use. 50 | } 51 | 52 | - (void)viewDidUnload { 53 | [super viewDidUnload]; 54 | // Release any retained subviews of the main view. 55 | // e.g. self.myOutlet = nil; 56 | } 57 | 58 | 59 | - (void)dealloc { 60 | [super dealloc]; 61 | } 62 | 63 | -(void)loadHelpPage 64 | { 65 | NSString *path = [[NSBundle mainBundle] pathForResource:@"help" ofType:@"html"]; 66 | NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path]; 67 | 68 | NSString *htmlString = [[NSString alloc] initWithData: 69 | [readHandle readDataToEndOfFile] encoding:NSUTF8StringEncoding]; 70 | 71 | webView_.backgroundColor = [UIColor whiteColor]; 72 | [webView_ loadHTMLString:htmlString baseURL:[NSURL fileURLWithPath:path]]; 73 | 74 | [htmlString release]; 75 | } 76 | /* http://iphone-dev.g.hatena.ne.jp/Miyakey/20091017/1255760274 77 | 78 | NSString *path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]; 79 | NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path]; 80 | 81 | NSString *htmlString = [[NSString alloc] initWithData: 82 | [readHandle readDataToEndOfFile] encoding:NSUTF8StringEncoding]; 83 | 84 | webView = [[UIWebView alloc] initWithFrame: CGRectMake(0.0f, 10.0f, 320.0f, 380.0f)]; 85 | webView.backgroundColor = [UIColor whiteColor]; 86 | [self.webView loadHTMLString:htmlString baseURL:[NSURL fileURLWithPath:path]]; 87 | 88 | [window addSubview:webView]; 89 | 90 | [htmlString release]; */ 91 | @end 92 | -------------------------------------------------------------------------------- /src/iphone/Classes/AnalogPinView.m: -------------------------------------------------------------------------------- 1 | // 2 | // AnalogPinView.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/21. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "AnalogPinView.h" 10 | 11 | @interface AnalogPinView (Private) 12 | @end 13 | 14 | #define kGrayOutAlpha 0.5 15 | 16 | @implementation AnalogPinView 17 | #pragma mark Properties 18 | 19 | #pragma mark Constructor 20 | -(void)awakeFromNib 21 | { 22 | } 23 | -(void)initialize:(int)pinNumber host:(OTOduinoHost *)host title:(NSString *)title unit:(NSString *)unit maxValue:(Float32)maxValue minValue:(Float32)minValue 24 | { 25 | // set values 26 | host_ = [host retain]; 27 | model_ = [host_.model.analogPinModels objectAtIndex:pinNumber]; 28 | 29 | // add observer 30 | [model_ addObserver:self forKeyPath:@"value" options:NSKeyValueObservingOptionNew context:nil]; 31 | [model_ addObserver:self forKeyPath:@"enabled" options:NSKeyValueObservingOptionNew context:nil]; 32 | 33 | // set default values 34 | titleLabel_.text = title; 35 | unitLabel_.text = unit; 36 | colorBarView_.maxValue = maxValue; 37 | colorBarView_.minValue = minValue; 38 | 39 | // diable view 40 | enabled_ = false; 41 | self.alpha = kGrayOutAlpha; 42 | valueLabel_.text = @"-"; 43 | colorBarView_.value = minValue; 44 | } 45 | -(void)dealloc 46 | { 47 | [model_ removeObserver:self forKeyPath:@"value"]; 48 | [model_ removeObserver:self forKeyPath:@"enabled"]; 49 | 50 | [host_ release]; 51 | } 52 | #pragma mark Event handler 53 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 54 | { 55 | [host_ setAnalogPinEnabled:model_.pinNumber enabled: !enabled_ ]; 56 | } 57 | #pragma mark KVO 58 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 59 | { 60 | // check value 61 | // NSLog(@"%s keypath:%@ ofObject:%@ change:%@ context:%@", __func__,keyPath, object, change, context ); 62 | // enabled? 63 | if(enabled_ != model_.enabled) { 64 | enabled_ = model_.enabled; 65 | self.alpha = enabled_ ? 1.0 : kGrayOutAlpha; 66 | // if disabled, update view 67 | if(! enabled_ ) { 68 | valueLabel_.text = @"-"; 69 | colorBarView_.value = colorBarView_.minValue; 70 | } 71 | } 72 | // update value 73 | if(enabled_) { 74 | float adc_value = (float)model_.value / 1023.0f; 75 | float voltage = (colorBarView_.maxValue - colorBarView_.minValue) * adc_value + colorBarView_.minValue; 76 | colorBarView_.value = voltage; 77 | valueLabel_.text = [NSString stringWithFormat:@"%1.2f", voltage]; 78 | //NSLog(@"%s adc_value:%f voltage:%f", __func__, adc_value, voltage); 79 | } 80 | } 81 | #pragma mark Public methods 82 | 83 | -(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event 84 | { 85 | // how terrible code this is ... 86 | if( point.x > 0 && 131 > point.x && point.y > 0 && 63 > point.y ) 87 | return self; 88 | else 89 | return nil; 90 | /* 91 | NSLog(@"%s (%f, %f) bounds(%f, %f, %f, %f) contains: %d", __func__, point.x, point.y, 92 | self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width, self.bounds.size.height, 93 | CGRectContainsPoint( self.bounds, point)); 94 | return [super hitTest:point withEvent:event];*/ 95 | } 96 | @end -------------------------------------------------------------------------------- /src/iphone/English.lproj/help.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

What is "OTOduino"?

9 |

"OTO" means "sound" in Japanese. 10 | "OTOduino" is a visualized sound modem terminal application for iPhone. 11 | You can monitor and control Arduino(TM) digital and analog ports status by connecting your Arduino to iPhone earphone jack as following: 12 | 13 |

14 | 15 |

Both "OTOduino" (repository https://github.com/reinforce-lab/OTOduino) project 16 | and a software modem project "OTO-plug" (repository https://github.com/reinforce-lab/OTO-plug) 17 | which "OTOduino" uses are open-source projects released under MIT license. 18 | These projects have been developed by an freelance engineer Akihiro UEHARA, REINFORCE Lab 19 | (http://www.reinforce-lab.com/, web site is written in Japanese) 20 | who also provides iPhone software design services.

21 | 22 |

Arduino interface circuit and a sketch

23 | To use OTOduino with your own Arduino, you need an interface circuit and to upload a sketch. 24 |

Interface citucit

25 |

You need an interface circuit to use OTOduino. 26 | However the interface circuit for Arduino is going to be released at the end of March, 27 | it is very simple that You can make your own one. 28 | Its circuit diagram is as following: 29 | 30 |
31 | Any kind of capacitores can be used for C1 and C2. 32 | Earphone jack left channel must be connected to the Arduino.OTOduino app only uses headset left channels to transmit data to Arduino. Right channel is mute. 33 |

34 |

How to upload a sketch

35 |

First SoftwareModem library should be added to your local disk. Make a "SoftwareModem" directory in your Arduino libraries directory (~/Document/Arduino/libraries/ on Mac OS), 36 | and then download source codes SoftwareModem.cpp and SoftwareModem.h from the repository https://github.com/reinforce-lab/OTOduino/tree/master/OTO-plug/src/arduino/libraries/SoftwareModem/. 37 |

38 |

Second download a sketch and upload it. Make a "OTOduinoSImpleClient" directory and download source codes OTOduinoSimpleClient.pde and OTOduinoTypes.h from the repository 39 | https://github.com/reinforce-lab/OTOduino/tree/master/src/arduino/OTOduinoSimpleClient. 40 | Now you can open the OTOduinoSimpleClient sketch and verify/upload it to your Arduino.

41 | 42 |

How to use OTOduino

43 |

When you plug an audio jack to iPhone, OTOduino connection icon (at the left lower of a screen) changes "Disconnected" to "Connected". 44 | If it does not changes to "Connected", check the warning message shown the right side of the icon. 45 | In the most cases, you should set the output volume at the maximum.

46 |

You can monitor voltage of Arduino analog ports. You can toggle enable/disable state of the analog panels (placed at the left of the screen) by touching them. 47 | To monitor digital ports, first touch a small icon of digital panels to change it to "in" icon. Then right button shows the current digital port value (high or low). 48 | To output signal from a digital port, touch a small icon and change it to "out" icon. Then you can toggle high/low status of the digital port by right button touch.

49 | -------------------------------------------------------------------------------- /src/iphone/Classes/IOViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // IOViewController.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/22. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "IOViewController.h" 10 | #import "OTOduinoAppDelegate.h" 11 | 12 | @interface IOViewController(Private) 13 | -(void)timerUpdated:(NSTimer *)aTimer; 14 | -(void)setInitialIOValue; 15 | @end 16 | 17 | @implementation IOViewController 18 | #pragma mark UIViewController override methods 19 | - (void)viewDidLoad 20 | { 21 | [super viewDidLoad]; 22 | 23 | // get host instance 24 | OTOduinoAppDelegate *dlg =(OTOduinoAppDelegate *)[UIApplication sharedApplication].delegate; 25 | host_ = [dlg.host retain]; 26 | 27 | [self setInitialIOValue]; 28 | // setup digital port views 29 | CGFloat ptx = 155; 30 | CGFloat pty = 16 + 20; 31 | CGFloat width = 154; 32 | CGFloat height = 31; 33 | CGFloat dy = 35; 34 | int pinNum = 11; 35 | UINib *digitalPinViewNib = [UINib nibWithNibName:@"DigitalPinView" bundle:[NSBundle mainBundle]]; 36 | for(int i=0; i < 4; i++) { 37 | DigitalPinView *port_view = [[digitalPinViewNib instantiateWithOwner:self options:nil] objectAtIndex:0]; 38 | // setup instance 39 | port_view.frame = CGRectMake(ptx, pty, width, height); 40 | [port_view initialize:pinNum host:host_]; 41 | // add instance 42 | [self.view addSubview:port_view]; 43 | // get next y point and port number 44 | pty += dy; 45 | pinNum--; 46 | } 47 | pty = 174 + 20 - 3; 48 | pinNum = 7; 49 | for(int i=0; i < 6; i++) { 50 | // instantiate 51 | DigitalPinView *port_view = [[digitalPinViewNib instantiateWithOwner:self options:nil] objectAtIndex:0]; 52 | // setup instance 53 | port_view.frame = CGRectMake(ptx, pty, width, height); 54 | [port_view initialize:pinNum host:host_]; 55 | // add instance 56 | [self.view addSubview:port_view]; 57 | // get next y point and port number 58 | pty += dy; 59 | pinNum--; 60 | } 61 | // setup analog port views 62 | ptx = 9; 63 | pty = 11; 64 | dy = 63 + 5; 65 | width = 131; 66 | height = 63; 67 | UINib *analogPinViewNib = [UINib nibWithNibName:@"AnalogPinView" bundle:[NSBundle mainBundle]]; 68 | for(int i=0; i < kNumOfAnalogPins; i++) { // analog pin0 is reserved for the software modem 69 | if([host_.model isReservedModemAnalogPin:i]) continue; 70 | // instantiate 71 | AnalogPinView *port_view = [[analogPinViewNib instantiateWithOwner:self options:nil] objectAtIndex: 0]; 72 | // setup instance 73 | port_view.frame = CGRectMake(ptx, pty, width, height); 74 | [port_view initialize:i host:host_ title:[NSString stringWithFormat:@"A%02d", i] unit:@"V" maxValue:5.0 minValue:0.0]; 75 | // add view 76 | [self.view addSubview:port_view]; 77 | // get next y point and port number 78 | pty += dy; 79 | } 80 | // connection status view 81 | connectStatusView_ = [[[NSBundle mainBundle] loadNibNamed:@"ConnectionStatusView" owner:self options:nil] objectAtIndex:0]; 82 | connectStatusView_.frame = CGRectMake(13, 353, 64, 54); 83 | connectStatusView_.host = host_; 84 | [self.view addSubview:connectStatusView_]; 85 | } 86 | - (void)viewDidUnload 87 | { 88 | [host_ removeObserver:self forKeyPath:@"connectionStat"]; 89 | 90 | [connectStatusView_ release]; 91 | [host_ release]; 92 | 93 | [super viewDidUnload]; 94 | } 95 | -(void)viewWillAppear:(BOOL)animated 96 | { 97 | host_.mute = false; 98 | 99 | [super viewWillAppear:animated]; 100 | } 101 | -(void)viewWillDisappear:(BOOL)animated 102 | { 103 | host_.mute = true; 104 | 105 | [super viewWillDisappear:animated]; 106 | } 107 | #pragma mark Private methods 108 | // set firmata host initial state 109 | -(void)setInitialIOValue 110 | { 111 | for(int i=0; i < kNumOfAnalogPins; i++) { 112 | [host_ setAnalogPinEnabled:i enabled:false]; 113 | } 114 | for(int i=0; i < kNumOfDigitalPins; i++) { 115 | [host_ setDigitalPinMode:i pinMode:(OTOduinoPinModeType)Input]; 116 | [host_ setDigitalPinValue:i value:0]; 117 | } 118 | } 119 | 120 | @end 121 | -------------------------------------------------------------------------------- /src/iphone/OTOduinoSocket.m: -------------------------------------------------------------------------------- 1 | // 2 | // OTOduinoPinModeTypeSocket.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/23. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "OTOduinoSocket.h" 10 | 11 | @interface OTOduinoSocket(Private) 12 | -(void)decodePacket:(Byte *)buf length:(int)length; 13 | -(void)decodeExPacket:(Byte *)buf length:(int)length; 14 | -(BOOL)readMessage:(Byte *)buf length:(int)length port:(Byte *)port value:(int *)value; 15 | -(BOOL)readVersion:(Byte *)buf length:(int)length version:(int *)version; 16 | @end 17 | 18 | @implementation OTOduinoSocket 19 | #pragma mark Properties 20 | @synthesize modem = modem_; 21 | @synthesize audioPHY = audioPHY_; 22 | 23 | #pragma mark Construcotr 24 | -(id)initWithDelegate:(NSObject *)delegate 25 | { 26 | self = [super init]; 27 | if(self) { 28 | modem_ = [[FSKModem alloc] initWithSocketWithoutPHY:self]; 29 | audioPHY_ = [[AudioPHY alloc] initWithSocket:modem_ audioBufferLength:kFSKAudioBufferLength]; 30 | delegate_ = [delegate retain]; 31 | // [modem_ start]; 32 | [audioPHY_ start]; 33 | } 34 | return self; 35 | } 36 | #pragma mark Construcotr 37 | -(void)dealloc 38 | { 39 | [modem_ release]; 40 | [audioPHY_ release]; 41 | [delegate_ release]; 42 | 43 | [super dealloc]; 44 | } 45 | #pragma mark SWMConnecting 46 | - (void)packetReceived:(Byte *)buf length:(int)length 47 | { 48 | /* 49 | NSMutableString *sb = [[NSMutableString alloc] initWithCapacity:10]; 50 | for(int i = 0; i < length ; i++) { 51 | [sb appendFormat:@"0x%02x,", buf[i]]; 52 | } 53 | NSLog(@"received packet: length:%d buf:%@", length, sb); 54 | [sb release]; 55 | */ 56 | if(length == 0) return; 57 | [self decodePacket:buf length:length]; 58 | } 59 | -(void)sendBufferEmptyNotify 60 | { 61 | [delegate_ sendBufferEmptyNotify]; 62 | } 63 | #pragma mark Private methods 64 | -(BOOL)readMessage:(Byte *)buf length:(int)length port:(Byte *)port value:(int *)value 65 | { 66 | if(length != 4) return false; 67 | 68 | *port = buf[1]; 69 | *value = buf[2] | (buf[3] << 8); 70 | 71 | return true; 72 | } 73 | -(BOOL)readVersion:(Byte *)buf length:(int)length version:(int *)version 74 | { 75 | // TODO 76 | return true; 77 | } 78 | -(void)decodePacket:(Byte *)buf length:(int)length 79 | { 80 | if(length < 1) return; 81 | 82 | Byte pin; 83 | int value; 84 | switch(buf[0]) { 85 | case (OTOduinoCommandType)analogIOMessage: 86 | // update analog pin value 87 | if( [self readMessage:buf length:length port:&pin value:&value] ) { 88 | [delegate_ receiveAnalogPinValue:pin value:value]; 89 | } 90 | break; 91 | case (OTOduinoCommandType)digitalIOMessage: 92 | // update digital pin value 93 | if( [self readMessage:buf length:length port:&pin value:&value] ) { 94 | [delegate_ receiveDigitalPortValue:pin value:value]; 95 | } 96 | break; 97 | case (OTOduinoCommandType)analogPinEnabledMessage: 98 | [delegate_ receiveAnalogPinEnabled:buf[1] enabled:buf[2]]; 99 | break; 100 | case (OTOduinoCommandType)digitalPinModeMessage: 101 | [delegate_ receiveDigitalPinMode:buf[1] pinMode:buf[2]]; 102 | break; 103 | case (OTOduinoCommandType)clientInitMessage: 104 | [delegate_ receiveClientInitializedMessage]; 105 | break; 106 | default: // TODO 107 | break; 108 | } 109 | } 110 | #pragma mark Public methods 111 | // configurate pin/port 112 | -(BOOL)enableAnalogPin:(Byte)pin enabled:(BOOL)enabled 113 | { 114 | // NSLog(@"sending packet: setAnalogPinEnabled pin:%d enabled:%d", pin, enabled); 115 | buf_[0] = (OTOduinoCommandType)setAnalogPinEnabled; 116 | buf_[1] = pin; 117 | buf_[2] = enabled ? 0x01 : 0x00; 118 | return ( [modem_ sendPacket:buf_ length:3] == 3); 119 | } 120 | -(BOOL)setDigitalPinMode:(Byte)pin pinMode:(OTOduinoPinModeType)pinMode 121 | { 122 | // NSLog(@"sending packet: setDigitalPinMode pin:%d pinMode:%d", pin, pinMode); 123 | buf_[0] = (OTOduinoCommandType)setDigitalPinMode; 124 | buf_[1] = pin; 125 | buf_[2] = pinMode; 126 | return [modem_ sendPacket:buf_ length:3] == 3; 127 | } 128 | // request pin/port value 129 | -(BOOL)setDigitalOutput:(Byte)port value:(int)value 130 | { 131 | // NSLog(@"sending packet: digitalIOMessage port:%d value:%d", port, value); 132 | buf_[0] = (OTOduinoCommandType)digitalIOMessage; 133 | buf_[1] = port; 134 | buf_[2] = (Byte)(value &0x00ff); 135 | buf_[3] = (Byte)(value >> 8); 136 | return ([modem_ sendPacket:buf_ length:4] == 4); 137 | } 138 | // pin status readback 139 | -(BOOL)requestAnalogPinEnabled:(Byte)pin 140 | { 141 | // NSLog(@"sending packet: requestAnalogPinEnabled pin:%d", pin); 142 | buf_[0] = (OTOduinoCommandType)requestAnalogPinEnabled; 143 | buf_[1] = pin; 144 | return [modem_ sendPacket:buf_ length:2] == 2; 145 | } 146 | -(BOOL)requestDigitalPinMode:(Byte)pin 147 | { 148 | // NSLog(@"sending packet: requestDigitalPinMode pin:%d", pin); 149 | buf_[0] = (OTOduinoCommandType)requestDigitalPinMode; 150 | buf_[1] = pin; 151 | return [modem_ sendPacket:buf_ length:2] == 2; 152 | } 153 | -(BOOL)confirmedClientInitialization 154 | { 155 | // NSLog(@"sending packet: clientInitConfirmedMessage"); 156 | buf_[0] = (OTOduinoCommandType)clientInitConfirmedMessage; 157 | return [modem_ sendPacket:buf_ length:1] == 1; 158 | } 159 | @end 160 | -------------------------------------------------------------------------------- /src/iphone/OTOduinoHost.m: -------------------------------------------------------------------------------- 1 | // 2 | // OTOduinoPinModeTypeHost.m 3 | // OTOduino 4 | // 5 | // Created by UEHARA AKIHIRO on 10/12/25. 6 | // Copyright 2010 REINFORCE Lab. All rights reserved. 7 | // 8 | 9 | #import "OTOduinoHost.h" 10 | 11 | @interface OTOduinoHost(Private) 12 | -(void)sendRequests; 13 | -(void)setCheckFlags; 14 | -(void)checkAudioSocketStat; 15 | -(void)updateMute; 16 | @end 17 | 18 | @implementation OTOduinoHost 19 | #pragma mark Properties 20 | @synthesize model = client_; 21 | @synthesize socket = socket_; 22 | @synthesize connectionStat = connectionStat_; 23 | @dynamic mute; 24 | -(BOOL)getMute 25 | { 26 | return mute_; 27 | } 28 | -(void)setMute:(BOOL)value 29 | { 30 | if(mute_ != value) { 31 | mute_ = value; 32 | [self updateMute]; 33 | } 34 | } 35 | #pragma mark Constructor 36 | -(id)init 37 | { 38 | self = [super init]; 39 | if(self) { 40 | socket_ =[[OTOduinoSocket alloc] initWithDelegate:self]; 41 | client_ = [[ArduinoModel alloc] init]; 42 | 43 | [self setCheckFlags]; 44 | [self checkAudioSocketStat]; 45 | // mute 46 | mute_ = true; 47 | socket_.modem.mute = true; 48 | // add kvo 49 | [socket_.audioPHY addObserver:self forKeyPath:@"outputVolume" options:NSKeyValueObservingOptionNew context:nil]; 50 | [socket_.audioPHY addObserver:self forKeyPath:@"isHeadsetInOut" options:NSKeyValueObservingOptionNew context:nil]; 51 | [socket_.modem addObserver:self forKeyPath:@"packetReceived" options:NSKeyValueObservingOptionNew context:nil]; 52 | } 53 | return self; 54 | } 55 | -(void)dealloc 56 | { 57 | // remove kvo 58 | [socket_.audioPHY removeObserver:self forKeyPath:@"outputVolume"]; 59 | [socket_.audioPHY removeObserver:self forKeyPath:@"isHeadsetInOut"]; 60 | [socket_.modem removeObserver:self forKeyPath:@"packetReceived"]; 61 | 62 | [socket_ release]; 63 | [client_ release]; 64 | 65 | [super dealloc]; 66 | } 67 | #pragma mark Private methods 68 | -(void)sendRequests 69 | { 70 | BOOL check = true; 71 | // check enabled/disabled value 72 | for(int i=0; i= kNumOfAnalogPins) return; 150 | // NSLog(@"%s receiveAnalogPinValue:%d value:%d",__func__, pin, value); 151 | AnalogPinModel *model = [client_.analogPinModels objectAtIndex:pin]; 152 | model.value = value; 153 | } 154 | - (void)receiveDigitalPortValue:(Byte)port value:(int)value 155 | { 156 | // NSLog(@"%s port:%d value:0x%x", __func__, port, value); 157 | int mask = 0x01; 158 | for(int i=0; i = kNumOfAnalogPins) return; 174 | 175 | shouldCheckAnalogEnabled_[pin] = false; 176 | AnalogPinModel *model = [client_.analogPinModels objectAtIndex:pin]; 177 | model.enabled = enabled; 178 | } 179 | -(void)receiveDigitalPinMode:(Byte)pin pinMode:(OTOduinoPinModeType)pinMode 180 | { 181 | if(pin >= kNumOfDigitalPins) return; 182 | // NSLog(@"%s receiveDigitalPinMode:%d pinMode:%d",__func__, pin, pinMode); 183 | shouldCheckPinMode_[pin] = false; 184 | DigitalPinModel *model = [client_.digitalPinModels objectAtIndex:pin]; 185 | model.pinMode = pinMode; 186 | } 187 | #pragma mark KVO 188 | - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 189 | { 190 | [self checkAudioSocketStat]; 191 | } 192 | #pragma mark Public methdos 193 | -(void)setAnalogPinEnabled:(Byte)pin enabled:(BOOL)enabled 194 | { 195 | if(pin <= 0 || pin >= kNumOfAnalogPins) return; 196 | 197 | shouldCheckAnalogEnabled_[pin] = true; 198 | [socket_ enableAnalogPin:pin enabled:enabled]; 199 | } 200 | -(void)setDigitalPinMode:(Byte)pin pinMode:(OTOduinoPinModeType)pinMode 201 | { 202 | shouldCheckPinMode_[pin] = true; 203 | [socket_ setDigitalPinMode:pin pinMode:pinMode]; 204 | } 205 | -(void)setDigitalPinValue:(Byte)pin value:(int)value 206 | { 207 | uint mask = (0x01 << pin); 208 | if(value == 0) { 209 | digitalValue_ &= ~mask; // false 210 | } else { 211 | digitalValue_ |= mask; //true 212 | } 213 | [socket_ setDigitalOutput:0 value:digitalValue_]; 214 | } 215 | -(void)receiveClientInitializedMessage 216 | { 217 | [self setCheckFlags]; 218 | [socket_ confirmedClientInitialization]; 219 | } 220 | @end 221 | -------------------------------------------------------------------------------- /src/arduino/OTOduinoSimpleClient/OTOduinoSimpleClient.pde: -------------------------------------------------------------------------------- 1 | /* 2 | * OTOduinoSimpleClient.pde - software modem simple client sketch for Arduino 3 | * Copyright (C) 2010-2011 REINFORCE Lab. All rights reserved. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the MIT license. 7 | * 8 | */ 9 | 10 | #include 11 | #include "OTOduinoTypes.h" 12 | 13 | // **** 14 | // Definitions 15 | // **** 16 | #define SERIAL_DEBUG 0 17 | #if SERIAL_DEBUG 18 | #endif 19 | 20 | // **** 21 | // Variables 22 | // **** 23 | #define NumOfAnalogPins 6 24 | #define NumOfDigitalPins 14 25 | 26 | uint8_t rcvBuf[MAX_PACKET_SIZE]; 27 | uint8_t rcvLength; 28 | uint8_t sendBuf[MAX_PACKET_SIZE]; 29 | bool analogPinEnabled[NumOfAnalogPins]; 30 | OTOduinoPinModeType digitalPinModes[NumOfDigitalPins]; 31 | uint16_t digitalPortValue; 32 | bool shouldReportAnalogValue; 33 | uint8_t reportingAnalogPin; 34 | bool shouldSendInitializedMessage; 35 | 36 | // **** 37 | // methods 38 | // **** 39 | 40 | // packet receiver method 41 | void packetReceivedCallback(const uint8_t *buf, uint8_t length) 42 | { 43 | #if SERIAL_DEBUG 44 | packetDump(rcvBuf, length); 45 | #endif 46 | 47 | if(length == 0 || rcvLength != 0) return; 48 | // copy buffer 49 | for(int i=0; i < length; i++) { 50 | rcvBuf[i] = buf[i]; 51 | } 52 | rcvLength = length; 53 | } 54 | 55 | // packet dump 56 | #if SERIAL_DEBUG 57 | void packetDump(const uint8_t *buf, uint8_t length) 58 | { 59 | Serial.print("Packet(len:"); 60 | Serial.print(length, DEC); 61 | Serial.print(")"); 62 | 63 | for(int i=0; i < length; i++) { 64 | Serial.print(", "); 65 | Serial.print(buf[i], HEX); 66 | } 67 | Serial.println(""); 68 | } 69 | #endif 70 | 71 | // read a packet and do somethins 72 | void processPacket() 73 | { 74 | if(rcvLength == 0) return; 75 | 76 | switch(rcvBuf[0] ) { 77 | case digitalIOMessage: 78 | pk_digitalIOMessage(); 79 | break; 80 | // analog pin command 81 | case setAnalogPinEnabled: 82 | pk_setAnalogPinEnabled(); 83 | break; 84 | case requestAnalogPinEnabled: 85 | pk_requestAnalogPinEnabled(); 86 | break; 87 | //Digital pin commands 88 | case setDigitalPinMode: 89 | pk_setDigitalPinMode(); 90 | break; 91 | case requestDigitalPinMode: 92 | pk_requestDigitalPinMode(); 93 | break; 94 | case clientInitConfirmedMessage: 95 | shouldSendInitializedMessage = false; 96 | break; 97 | default: break; 98 | } 99 | rcvLength = 0; 100 | } 101 | // set digital pin value 102 | void pk_digitalIOMessage() 103 | { 104 | if(rcvLength != 4 || rcvBuf[1] != 0) return; 105 | digitalPortValue = rcvBuf[2] | (rcvBuf[3] << 8); 106 | uint16_t mask = 0x04; 107 | for(int i=2; i < NumOfDigitalPins; i++) { 108 | if(i != MODEM_DOUT_PIN && digitalPinModes[i] == Output) { 109 | uint8_t pinval = ((digitalPortValue & mask) == 0) ? 0 : 1; 110 | digitalWrite(i, pinval); 111 | } 112 | mask <<= 1; 113 | } 114 | } 115 | void pk_setAnalogPinEnabled() 116 | { 117 | #if SERIAL_DEBUG 118 | Serial.print("pk_setAnalogPinEnabled() pinnum:"); 119 | Serial.print((int)rcvBuf[1]); 120 | Serial.print(", enabled:"); 121 | Serial.println((int)rcvBuf[2]); 122 | #endif 123 | // 124 | uint8_t pinnum = rcvBuf[1]; 125 | bool enabled = (rcvBuf[2] != 0); 126 | if(pinnum > 0 && pinnum < NumOfAnalogPins) { 127 | analogPinEnabled[pinnum] = enabled; 128 | } 129 | } 130 | void pk_requestAnalogPinEnabled() 131 | { 132 | #if SERIAL_DEBUG 133 | Serial.print("pk_requestAnalogPinEnabled() pinum:"); 134 | Serial.println((int)rcvBuf[1], DEC); 135 | #endif 136 | 137 | // 138 | uint8_t pinnum = rcvBuf[1]; 139 | if(pinnum >= NumOfAnalogPins) return; 140 | 141 | // 142 | sendBuf[0] = analogPinEnabledMessage; 143 | sendBuf[1] = pinnum; 144 | sendBuf[2] = analogPinEnabled[pinnum]; 145 | OTOplug1200.write(sendBuf, 3); 146 | } 147 | void pk_setDigitalPinMode() 148 | { 149 | #if SERIAL_DEBUG 150 | Serial.print("pk_setDigitalPinMode() pinum:"); 151 | Serial.print((int)rcvBuf[1], DEC); 152 | Serial.print(","); 153 | Serial.println((int)rcvBuf[2], HEX); 154 | #endif 155 | 156 | // 157 | uint8_t pinnum = rcvBuf[1]; 158 | if(pinnum > 1 && pinnum < NumOfDigitalPins && pinnum != MODEM_DOUT_PIN) { 159 | OTOduinoPinModeType pinModeType = (OTOduinoPinModeType)rcvBuf[2]; 160 | digitalPinModes[pinnum] = pinModeType; 161 | boolean isOutput = (pinModeType == Output); 162 | pinMode(pinnum, isOutput); 163 | } 164 | } 165 | void pk_requestDigitalPinMode() 166 | { 167 | #if SERIAL_DEBUG 168 | Serial.print("pk_requestDigitalPinEnabled() pinum:"); 169 | Serial.println((int)rcvBuf[1], DEC); 170 | #endif 171 | 172 | // 173 | uint8_t pinnum = rcvBuf[1]; 174 | // 175 | sendBuf[0] = digitalPinModeMessage; 176 | sendBuf[1] = pinnum; 177 | sendBuf[2] = digitalPinModes[pinnum]; 178 | OTOplug1200.write(sendBuf, 3); 179 | } 180 | void sendDigitalPortMessage(uint16_t value) 181 | { 182 | //, msb<15:8>> 183 | sendBuf[0] = digitalIOMessage; 184 | sendBuf[1] = 0; 185 | sendBuf[2] = 0x0ff & value; 186 | sendBuf[3] = (value >> 8); 187 | OTOplug1200.write(sendBuf, 4); 188 | } 189 | void sendAnalogIOMessage(uint8_t pinnum, uint16_t value) 190 | { 191 | //(analogIOMessage, pin#, lsb<7:0>, msb<15:8>) 192 | sendBuf[0] = analogIOMessage; 193 | sendBuf[1] = pinnum; 194 | sendBuf[2] = value; 195 | sendBuf[3] = value >> 8; 196 | OTOplug1200.write(sendBuf, 4); 197 | } 198 | 199 | void setup() 200 | { 201 | #if SERIAL_DEBUG 202 | Serial.begin(115200); 203 | #endif 204 | for(int i = 2; i < NumOfDigitalPins; i++) { 205 | digitalPinModes[i] = Input; 206 | pinMode(i, INPUT); 207 | digitalRead(i); 208 | } 209 | 210 | reportingAnalogPin = 1; 211 | shouldSendInitializedMessage = true; 212 | 213 | OTOplug1200.begin(); 214 | OTOplug1200.attach(packetReceivedCallback); 215 | } 216 | void loop() 217 | { 218 | // receive packet and reply to it 219 | if(!OTOplug1200.writeAvailable()) return; 220 | processPacket(); 221 | 222 | if(!OTOplug1200.writeAvailable()) return; 223 | if(shouldSendInitializedMessage) { 224 | // Serial.println("sending initialized message."); 225 | sendBuf[0] = clientInitMessage; 226 | OTOplug1200.write(sendBuf, 1); 227 | } 228 | 229 | // report digital/analog port value only when modem buffer is available. 230 | if(!OTOplug1200.writeAvailable()) return; 231 | if(shouldReportAnalogValue) { 232 | // read analog port 233 | if(analogPinEnabled[reportingAnalogPin]) { 234 | OTOplug1200.startADConversion(reportingAnalogPin); 235 | uint8_t pinnum; 236 | uint16_t value; 237 | if( OTOplug1200.readAnalogPin(&pinnum, &value)) { 238 | sendAnalogIOMessage(pinnum, value); 239 | reportingAnalogPin++; 240 | } 241 | } else { 242 | reportingAnalogPin++; 243 | } 244 | if(reportingAnalogPin >= NumOfAnalogPins) { 245 | reportingAnalogPin = 1; 246 | } 247 | } else { 248 | // read digital port 249 | uint16_t mask = 0x04; 250 | for(int i = 2; i < NumOfDigitalPins; i++) { 251 | if(digitalPinModes[i] == Input) { 252 | if(digitalRead(i)) { 253 | digitalPortValue |= mask; 254 | } else { 255 | digitalPortValue &= ~mask; 256 | } 257 | } 258 | mask <<= 1; 259 | } 260 | sendDigitalPortMessage(digitalPortValue); 261 | } 262 | shouldReportAnalogValue = ! shouldReportAnalogValue; 263 | } 264 | 265 | -------------------------------------------------------------------------------- /src/iphone/Classes/HelpViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 823 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 132 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | 44 | YES 45 | 46 | 47 | 274 48 | {{0, -14}, {320, 425}} 49 | 50 | 51 | 1 52 | MSAxIDEAA 53 | 54 | YES 55 | IBCocoaTouchFramework 56 | 1 57 | YES 58 | 59 | 60 | {320, 411} 61 | 62 | 63 | 3 64 | MQA 65 | 66 | 2 67 | 68 | 69 | 70 | 71 | IBCocoaTouchFramework 72 | 73 | 74 | 75 | 76 | YES 77 | 78 | 79 | view 80 | 81 | 82 | 83 | 3 84 | 85 | 86 | 87 | webView_ 88 | 89 | 90 | 91 | 5 92 | 93 | 94 | 95 | 96 | YES 97 | 98 | 0 99 | 100 | 101 | 102 | 103 | 104 | 1 105 | 106 | 107 | YES 108 | 109 | 110 | 111 | 112 | 113 | -1 114 | 115 | 116 | File's Owner 117 | 118 | 119 | -2 120 | 121 | 122 | 123 | 124 | 4 125 | 126 | 127 | 128 | 129 | 130 | 131 | YES 132 | 133 | YES 134 | -1.CustomClassName 135 | -2.CustomClassName 136 | 1.IBEditorWindowLastContentRect 137 | 1.IBPluginDependency 138 | 4.IBPluginDependency 139 | 140 | 141 | YES 142 | HelpViewController 143 | UIResponder 144 | {{119, 642}, {320, 480}} 145 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 146 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 147 | 148 | 149 | 150 | YES 151 | 152 | 153 | YES 154 | 155 | 156 | 157 | 158 | YES 159 | 160 | 161 | YES 162 | 163 | 164 | 165 | 5 166 | 167 | 168 | 169 | YES 170 | 171 | HelpViewController 172 | UIViewController 173 | 174 | webView_ 175 | UIWebView 176 | 177 | 178 | webView_ 179 | 180 | webView_ 181 | UIWebView 182 | 183 | 184 | 185 | IBProjectSource 186 | Classes/HelpViewController.h 187 | 188 | 189 | 190 | 191 | YES 192 | 193 | NSObject 194 | 195 | IBFrameworkSource 196 | Foundation.framework/Headers/NSError.h 197 | 198 | 199 | 200 | NSObject 201 | 202 | IBFrameworkSource 203 | Foundation.framework/Headers/NSFileManager.h 204 | 205 | 206 | 207 | NSObject 208 | 209 | IBFrameworkSource 210 | Foundation.framework/Headers/NSKeyValueCoding.h 211 | 212 | 213 | 214 | NSObject 215 | 216 | IBFrameworkSource 217 | Foundation.framework/Headers/NSKeyValueObserving.h 218 | 219 | 220 | 221 | NSObject 222 | 223 | IBFrameworkSource 224 | Foundation.framework/Headers/NSKeyedArchiver.h 225 | 226 | 227 | 228 | NSObject 229 | 230 | IBFrameworkSource 231 | Foundation.framework/Headers/NSObject.h 232 | 233 | 234 | 235 | NSObject 236 | 237 | IBFrameworkSource 238 | Foundation.framework/Headers/NSRunLoop.h 239 | 240 | 241 | 242 | NSObject 243 | 244 | IBFrameworkSource 245 | Foundation.framework/Headers/NSThread.h 246 | 247 | 248 | 249 | NSObject 250 | 251 | IBFrameworkSource 252 | Foundation.framework/Headers/NSURL.h 253 | 254 | 255 | 256 | NSObject 257 | 258 | IBFrameworkSource 259 | Foundation.framework/Headers/NSURLConnection.h 260 | 261 | 262 | 263 | NSObject 264 | 265 | IBFrameworkSource 266 | UIKit.framework/Headers/UIAccessibility.h 267 | 268 | 269 | 270 | NSObject 271 | 272 | IBFrameworkSource 273 | UIKit.framework/Headers/UINibLoading.h 274 | 275 | 276 | 277 | NSObject 278 | 279 | IBFrameworkSource 280 | UIKit.framework/Headers/UIResponder.h 281 | 282 | 283 | 284 | UIResponder 285 | NSObject 286 | 287 | 288 | 289 | UISearchBar 290 | UIView 291 | 292 | IBFrameworkSource 293 | UIKit.framework/Headers/UISearchBar.h 294 | 295 | 296 | 297 | UISearchDisplayController 298 | NSObject 299 | 300 | IBFrameworkSource 301 | UIKit.framework/Headers/UISearchDisplayController.h 302 | 303 | 304 | 305 | UIView 306 | 307 | IBFrameworkSource 308 | UIKit.framework/Headers/UIPrintFormatter.h 309 | 310 | 311 | 312 | UIView 313 | 314 | IBFrameworkSource 315 | UIKit.framework/Headers/UITextField.h 316 | 317 | 318 | 319 | UIView 320 | UIResponder 321 | 322 | IBFrameworkSource 323 | UIKit.framework/Headers/UIView.h 324 | 325 | 326 | 327 | UIViewController 328 | 329 | IBFrameworkSource 330 | UIKit.framework/Headers/UINavigationController.h 331 | 332 | 333 | 334 | UIViewController 335 | 336 | IBFrameworkSource 337 | UIKit.framework/Headers/UIPopoverController.h 338 | 339 | 340 | 341 | UIViewController 342 | 343 | IBFrameworkSource 344 | UIKit.framework/Headers/UISplitViewController.h 345 | 346 | 347 | 348 | UIViewController 349 | 350 | IBFrameworkSource 351 | UIKit.framework/Headers/UITabBarController.h 352 | 353 | 354 | 355 | UIViewController 356 | UIResponder 357 | 358 | IBFrameworkSource 359 | UIKit.framework/Headers/UIViewController.h 360 | 361 | 362 | 363 | UIWebView 364 | UIView 365 | 366 | IBFrameworkSource 367 | UIKit.framework/Headers/UIWebView.h 368 | 369 | 370 | 371 | 372 | 0 373 | IBCocoaTouchFramework 374 | 375 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 376 | 377 | 378 | 379 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 380 | 381 | 382 | YES 383 | ../OTOduino.xcodeproj 384 | 3 385 | 132 386 | 387 | 388 | -------------------------------------------------------------------------------- /src/iphone/Classes/IOViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 823 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 132 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | 44 | YES 45 | 46 | 47 | 274 48 | {320, 412} 49 | 50 | NO 51 | IBCocoaTouchFramework 52 | 53 | NSImage 54 | IOControllerBackgroundImage.png 55 | 56 | 57 | 58 | {320, 411} 59 | 60 | 61 | 3 62 | MQA 63 | 64 | 65 | 66 | IBCocoaTouchFramework 67 | 68 | 69 | 70 | 71 | YES 72 | 73 | 74 | view 75 | 76 | 77 | 78 | 3 79 | 80 | 81 | 82 | bakgroundImageView_ 83 | 84 | 85 | 86 | 6 87 | 88 | 89 | 90 | 91 | YES 92 | 93 | 0 94 | 95 | 96 | 97 | 98 | 99 | 1 100 | 101 | 102 | YES 103 | 104 | 105 | 106 | 107 | 108 | -1 109 | 110 | 111 | File's Owner 112 | 113 | 114 | -2 115 | 116 | 117 | 118 | 119 | 4 120 | 121 | 122 | 123 | 124 | 125 | 126 | YES 127 | 128 | YES 129 | -1.CustomClassName 130 | -2.CustomClassName 131 | 1.IBEditorWindowLastContentRect 132 | 1.IBPluginDependency 133 | 4.IBPluginDependency 134 | 135 | 136 | YES 137 | IOViewController 138 | UIResponder 139 | {{2331, 584}, {320, 480}} 140 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 141 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 142 | 143 | 144 | 145 | YES 146 | 147 | 148 | YES 149 | 150 | 151 | 152 | 153 | YES 154 | 155 | 156 | YES 157 | 158 | 159 | 160 | 7 161 | 162 | 163 | 164 | YES 165 | 166 | IOViewController 167 | UIViewController 168 | 169 | bakgroundImageView_ 170 | UIImageView 171 | 172 | 173 | bakgroundImageView_ 174 | 175 | bakgroundImageView_ 176 | UIImageView 177 | 178 | 179 | 180 | IBProjectSource 181 | Classes/IOViewController.h 182 | 183 | 184 | 185 | 186 | YES 187 | 188 | NSObject 189 | 190 | IBFrameworkSource 191 | Foundation.framework/Headers/NSError.h 192 | 193 | 194 | 195 | NSObject 196 | 197 | IBFrameworkSource 198 | Foundation.framework/Headers/NSFileManager.h 199 | 200 | 201 | 202 | NSObject 203 | 204 | IBFrameworkSource 205 | Foundation.framework/Headers/NSKeyValueCoding.h 206 | 207 | 208 | 209 | NSObject 210 | 211 | IBFrameworkSource 212 | Foundation.framework/Headers/NSKeyValueObserving.h 213 | 214 | 215 | 216 | NSObject 217 | 218 | IBFrameworkSource 219 | Foundation.framework/Headers/NSKeyedArchiver.h 220 | 221 | 222 | 223 | NSObject 224 | 225 | IBFrameworkSource 226 | Foundation.framework/Headers/NSObject.h 227 | 228 | 229 | 230 | NSObject 231 | 232 | IBFrameworkSource 233 | Foundation.framework/Headers/NSRunLoop.h 234 | 235 | 236 | 237 | NSObject 238 | 239 | IBFrameworkSource 240 | Foundation.framework/Headers/NSThread.h 241 | 242 | 243 | 244 | NSObject 245 | 246 | IBFrameworkSource 247 | Foundation.framework/Headers/NSURL.h 248 | 249 | 250 | 251 | NSObject 252 | 253 | IBFrameworkSource 254 | Foundation.framework/Headers/NSURLConnection.h 255 | 256 | 257 | 258 | NSObject 259 | 260 | IBFrameworkSource 261 | UIKit.framework/Headers/UIAccessibility.h 262 | 263 | 264 | 265 | NSObject 266 | 267 | IBFrameworkSource 268 | UIKit.framework/Headers/UINibLoading.h 269 | 270 | 271 | 272 | NSObject 273 | 274 | IBFrameworkSource 275 | UIKit.framework/Headers/UIResponder.h 276 | 277 | 278 | 279 | UIImageView 280 | UIView 281 | 282 | IBFrameworkSource 283 | UIKit.framework/Headers/UIImageView.h 284 | 285 | 286 | 287 | UIResponder 288 | NSObject 289 | 290 | 291 | 292 | UISearchBar 293 | UIView 294 | 295 | IBFrameworkSource 296 | UIKit.framework/Headers/UISearchBar.h 297 | 298 | 299 | 300 | UISearchDisplayController 301 | NSObject 302 | 303 | IBFrameworkSource 304 | UIKit.framework/Headers/UISearchDisplayController.h 305 | 306 | 307 | 308 | UIView 309 | 310 | IBFrameworkSource 311 | UIKit.framework/Headers/UIPrintFormatter.h 312 | 313 | 314 | 315 | UIView 316 | 317 | IBFrameworkSource 318 | UIKit.framework/Headers/UITextField.h 319 | 320 | 321 | 322 | UIView 323 | UIResponder 324 | 325 | IBFrameworkSource 326 | UIKit.framework/Headers/UIView.h 327 | 328 | 329 | 330 | UIViewController 331 | 332 | IBFrameworkSource 333 | UIKit.framework/Headers/UINavigationController.h 334 | 335 | 336 | 337 | UIViewController 338 | 339 | IBFrameworkSource 340 | UIKit.framework/Headers/UIPopoverController.h 341 | 342 | 343 | 344 | UIViewController 345 | 346 | IBFrameworkSource 347 | UIKit.framework/Headers/UISplitViewController.h 348 | 349 | 350 | 351 | UIViewController 352 | 353 | IBFrameworkSource 354 | UIKit.framework/Headers/UITabBarController.h 355 | 356 | 357 | 358 | UIViewController 359 | UIResponder 360 | 361 | IBFrameworkSource 362 | UIKit.framework/Headers/UIViewController.h 363 | 364 | 365 | 366 | 367 | 0 368 | IBCocoaTouchFramework 369 | 370 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 371 | 372 | 373 | 374 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 375 | 376 | 377 | YES 378 | ../OTOduino.xcodeproj 379 | 3 380 | 381 | IOControllerBackgroundImage.png 382 | {320, 416} 383 | 384 | 132 385 | 386 | 387 | -------------------------------------------------------------------------------- /src/iphone/ConnectionStatusView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 823 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 132 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | 44 | YES 45 | 46 | 47 | 292 48 | {64, 54} 49 | 50 | 51 | 3 52 | MCAwAA 53 | 54 | 4 55 | NO 56 | IBCocoaTouchFramework 57 | 58 | NSImage 59 | disconnected_icon.png 60 | 61 | 62 | NSImage 63 | connected_icon.png 64 | 65 | 66 | 67 | 68 | 292 69 | {{65, 10}, {64, 35}} 70 | 71 | NO 72 | YES 73 | 7 74 | NO 75 | IBCocoaTouchFramework 76 | Label 77 | 78 | Helvetica 79 | 12 80 | 16 81 | 82 | 83 | 1 84 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 85 | 86 | 87 | 3 88 | MQA 89 | 90 | 1 91 | 8 92 | 0 93 | 94 | 95 | {320, 460} 96 | 97 | 98 | 99 | IBCocoaTouchFramework 100 | 101 | 102 | 103 | 104 | YES 105 | 106 | 107 | iconImageView_ 108 | 109 | 110 | 111 | 5 112 | 113 | 114 | 115 | errorTextlabel_ 116 | 117 | 118 | 119 | 7 120 | 121 | 122 | 123 | 124 | YES 125 | 126 | 0 127 | 128 | 129 | 130 | 131 | 132 | 1 133 | 134 | 135 | YES 136 | 137 | 138 | 139 | 140 | 141 | 142 | -1 143 | 144 | 145 | File's Owner 146 | 147 | 148 | -2 149 | 150 | 151 | 152 | 153 | 4 154 | 155 | 156 | 157 | 158 | 6 159 | 160 | 161 | 162 | 163 | 164 | 165 | YES 166 | 167 | YES 168 | -2.CustomClassName 169 | 1.CustomClassName 170 | 1.IBEditorWindowLastContentRect 171 | 1.IBPluginDependency 172 | 4.IBPluginDependency 173 | 4.IBViewBoundsToFrameTransform 174 | 6.IBPluginDependency 175 | 176 | 177 | YES 178 | UIResponder 179 | ConnectionStatusView 180 | {{441, 328}, {320, 480}} 181 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 182 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 183 | 184 | P4AAAL+AAADCoAAAwrIAAA 185 | 186 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 187 | 188 | 189 | 190 | YES 191 | 192 | 193 | YES 194 | 195 | 196 | 197 | 198 | YES 199 | 200 | 201 | YES 202 | 203 | 204 | 205 | 7 206 | 207 | 208 | 209 | YES 210 | 211 | ConnectionStatusView 212 | UIView 213 | 214 | YES 215 | 216 | YES 217 | errorTextlabel_ 218 | iconImageView_ 219 | 220 | 221 | YES 222 | UILabel 223 | UIImageView 224 | 225 | 226 | 227 | YES 228 | 229 | YES 230 | errorTextlabel_ 231 | iconImageView_ 232 | 233 | 234 | YES 235 | 236 | errorTextlabel_ 237 | UILabel 238 | 239 | 240 | iconImageView_ 241 | UIImageView 242 | 243 | 244 | 245 | 246 | IBProjectSource 247 | Classes/ConnectionStatusView.h 248 | 249 | 250 | 251 | 252 | YES 253 | 254 | NSObject 255 | 256 | IBFrameworkSource 257 | Foundation.framework/Headers/NSError.h 258 | 259 | 260 | 261 | NSObject 262 | 263 | IBFrameworkSource 264 | Foundation.framework/Headers/NSFileManager.h 265 | 266 | 267 | 268 | NSObject 269 | 270 | IBFrameworkSource 271 | Foundation.framework/Headers/NSKeyValueCoding.h 272 | 273 | 274 | 275 | NSObject 276 | 277 | IBFrameworkSource 278 | Foundation.framework/Headers/NSKeyValueObserving.h 279 | 280 | 281 | 282 | NSObject 283 | 284 | IBFrameworkSource 285 | Foundation.framework/Headers/NSKeyedArchiver.h 286 | 287 | 288 | 289 | NSObject 290 | 291 | IBFrameworkSource 292 | Foundation.framework/Headers/NSObject.h 293 | 294 | 295 | 296 | NSObject 297 | 298 | IBFrameworkSource 299 | Foundation.framework/Headers/NSRunLoop.h 300 | 301 | 302 | 303 | NSObject 304 | 305 | IBFrameworkSource 306 | Foundation.framework/Headers/NSThread.h 307 | 308 | 309 | 310 | NSObject 311 | 312 | IBFrameworkSource 313 | Foundation.framework/Headers/NSURL.h 314 | 315 | 316 | 317 | NSObject 318 | 319 | IBFrameworkSource 320 | Foundation.framework/Headers/NSURLConnection.h 321 | 322 | 323 | 324 | NSObject 325 | 326 | IBFrameworkSource 327 | UIKit.framework/Headers/UIAccessibility.h 328 | 329 | 330 | 331 | NSObject 332 | 333 | IBFrameworkSource 334 | UIKit.framework/Headers/UINibLoading.h 335 | 336 | 337 | 338 | NSObject 339 | 340 | IBFrameworkSource 341 | UIKit.framework/Headers/UIResponder.h 342 | 343 | 344 | 345 | UIImageView 346 | UIView 347 | 348 | IBFrameworkSource 349 | UIKit.framework/Headers/UIImageView.h 350 | 351 | 352 | 353 | UILabel 354 | UIView 355 | 356 | IBFrameworkSource 357 | UIKit.framework/Headers/UILabel.h 358 | 359 | 360 | 361 | UIResponder 362 | NSObject 363 | 364 | 365 | 366 | UIView 367 | 368 | IBFrameworkSource 369 | UIKit.framework/Headers/UIPrintFormatter.h 370 | 371 | 372 | 373 | UIView 374 | 375 | IBFrameworkSource 376 | UIKit.framework/Headers/UITextField.h 377 | 378 | 379 | 380 | UIView 381 | UIResponder 382 | 383 | IBFrameworkSource 384 | UIKit.framework/Headers/UIView.h 385 | 386 | 387 | 388 | 389 | 0 390 | IBCocoaTouchFramework 391 | 392 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 393 | 394 | 395 | 396 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 397 | 398 | 399 | YES 400 | OTOduino.xcodeproj 401 | 3 402 | 403 | YES 404 | 405 | YES 406 | connected_icon.png 407 | disconnected_icon.png 408 | 409 | 410 | YES 411 | {64, 54} 412 | {64, 54} 413 | 414 | 415 | 132 416 | 417 | 418 | -------------------------------------------------------------------------------- /src/iphone/VoltageView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10H574 6 | 823 7 | 1038.35 8 | 461.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 132 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | 44 | YES 45 | 46 | 47 | 292 48 | {131, 63} 49 | 50 | NO 51 | IBCocoaTouchFramework 52 | 53 | NSImage 54 | DigitalPortViewBackgroundImage.png 55 | 56 | 57 | 58 | 59 | 292 60 | {{8, 34}, {109, 19}} 61 | 62 | 63 | 3 64 | MCAwAA 65 | 66 | IBCocoaTouchFramework 67 | 68 | 69 | 70 | 292 71 | {{12, 8}, {28, 22}} 72 | 73 | NO 74 | YES 75 | 7 76 | NO 77 | IBCocoaTouchFramework 78 | DC 79 | 80 | Helvetica-Bold 81 | 14 82 | 16 83 | 84 | 85 | 3 86 | MQA 87 | 88 | 89 | 1 90 | 10 91 | 92 | 93 | 94 | 292 95 | {{37, 2}, {84, 34}} 96 | 97 | NO 98 | YES 99 | 7 100 | NO 101 | IBCocoaTouchFramework 102 | 2.30-V 103 | 104 | Helvetica-Bold 105 | 28 106 | 16 107 | 108 | 109 | 1 110 | MC4wNjU3MTAwNjYzNCAwLjA1NTg0ODk4Njk3IDAuNDY0Mjg1NzE0MwA 111 | 112 | 113 | 10 114 | 2 115 | 116 | 117 | {320, 460} 118 | 119 | 120 | 3 121 | MQA 122 | 123 | 2 124 | 125 | 126 | 127 | IBCocoaTouchFramework 128 | 129 | 130 | 131 | 132 | YES 133 | 134 | 135 | colorBarView_ 136 | 137 | 138 | 139 | 9 140 | 141 | 142 | 143 | titleLabel_ 144 | 145 | 146 | 147 | 10 148 | 149 | 150 | 151 | valueLabel_ 152 | 153 | 154 | 155 | 11 156 | 157 | 158 | 159 | 160 | YES 161 | 162 | 0 163 | 164 | 165 | 166 | 167 | 168 | 1 169 | 170 | 171 | YES 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | -1 181 | 182 | 183 | File's Owner 184 | 185 | 186 | -2 187 | 188 | 189 | 190 | 191 | 4 192 | 193 | 194 | 195 | 196 | 5 197 | 198 | 199 | 200 | 201 | 7 202 | 203 | 204 | 205 | 206 | 12 207 | 208 | 209 | 210 | 211 | 212 | 213 | YES 214 | 215 | YES 216 | -2.CustomClassName 217 | 1.CustomClassName 218 | 1.IBEditorWindowLastContentRect 219 | 1.IBPluginDependency 220 | 12.IBPluginDependency 221 | 12.IBViewBoundsToFrameTransform 222 | 4.CustomClassName 223 | 4.IBPluginDependency 224 | 4.IBViewBoundsToFrameTransform 225 | 5.IBPluginDependency 226 | 5.IBViewBoundsToFrameTransform 227 | 7.IBPluginDependency 228 | 7.IBViewBoundsToFrameTransform 229 | 230 | 231 | YES 232 | UIResponder 233 | VoltageView 234 | {{735, 613}, {320, 480}} 235 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 236 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 237 | 238 | ColorBarView 239 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 240 | 241 | P4AAAL+AAADBcAAAwz0AAA 242 | 243 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 244 | 245 | AUEwAABAwAAAA 246 | 247 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 248 | 249 | P4AAAL+AAABB8AAAwqAAAA 250 | 251 | 252 | 253 | 254 | YES 255 | 256 | 257 | YES 258 | 259 | 260 | 261 | 262 | YES 263 | 264 | 265 | YES 266 | 267 | 268 | 269 | 12 270 | 271 | 272 | 273 | YES 274 | 275 | ColorBarView 276 | UIImageView 277 | 278 | IBProjectSource 279 | Classes/ColorBarView.h 280 | 281 | 282 | 283 | VoltageView 284 | UIView 285 | 286 | YES 287 | 288 | YES 289 | colorBarView_ 290 | titleLabel_ 291 | valueLabel_ 292 | 293 | 294 | YES 295 | ColorBarView 296 | UILabel 297 | UILabel 298 | 299 | 300 | 301 | YES 302 | 303 | YES 304 | colorBarView_ 305 | titleLabel_ 306 | valueLabel_ 307 | 308 | 309 | YES 310 | 311 | colorBarView_ 312 | ColorBarView 313 | 314 | 315 | titleLabel_ 316 | UILabel 317 | 318 | 319 | valueLabel_ 320 | UILabel 321 | 322 | 323 | 324 | 325 | IBProjectSource 326 | Classes/VoltageView.h 327 | 328 | 329 | 330 | 331 | YES 332 | 333 | NSObject 334 | 335 | IBFrameworkSource 336 | Foundation.framework/Headers/NSError.h 337 | 338 | 339 | 340 | NSObject 341 | 342 | IBFrameworkSource 343 | Foundation.framework/Headers/NSFileManager.h 344 | 345 | 346 | 347 | NSObject 348 | 349 | IBFrameworkSource 350 | Foundation.framework/Headers/NSKeyValueCoding.h 351 | 352 | 353 | 354 | NSObject 355 | 356 | IBFrameworkSource 357 | Foundation.framework/Headers/NSKeyValueObserving.h 358 | 359 | 360 | 361 | NSObject 362 | 363 | IBFrameworkSource 364 | Foundation.framework/Headers/NSKeyedArchiver.h 365 | 366 | 367 | 368 | NSObject 369 | 370 | IBFrameworkSource 371 | Foundation.framework/Headers/NSObject.h 372 | 373 | 374 | 375 | NSObject 376 | 377 | IBFrameworkSource 378 | Foundation.framework/Headers/NSRunLoop.h 379 | 380 | 381 | 382 | NSObject 383 | 384 | IBFrameworkSource 385 | Foundation.framework/Headers/NSThread.h 386 | 387 | 388 | 389 | NSObject 390 | 391 | IBFrameworkSource 392 | Foundation.framework/Headers/NSURL.h 393 | 394 | 395 | 396 | NSObject 397 | 398 | IBFrameworkSource 399 | Foundation.framework/Headers/NSURLConnection.h 400 | 401 | 402 | 403 | NSObject 404 | 405 | IBFrameworkSource 406 | UIKit.framework/Headers/UIAccessibility.h 407 | 408 | 409 | 410 | NSObject 411 | 412 | IBFrameworkSource 413 | UIKit.framework/Headers/UINibLoading.h 414 | 415 | 416 | 417 | NSObject 418 | 419 | IBFrameworkSource 420 | UIKit.framework/Headers/UIResponder.h 421 | 422 | 423 | 424 | UIImageView 425 | UIView 426 | 427 | IBFrameworkSource 428 | UIKit.framework/Headers/UIImageView.h 429 | 430 | 431 | 432 | UILabel 433 | UIView 434 | 435 | IBFrameworkSource 436 | UIKit.framework/Headers/UILabel.h 437 | 438 | 439 | 440 | UIResponder 441 | NSObject 442 | 443 | 444 | 445 | UIView 446 | 447 | IBFrameworkSource 448 | UIKit.framework/Headers/UIPrintFormatter.h 449 | 450 | 451 | 452 | UIView 453 | 454 | IBFrameworkSource 455 | UIKit.framework/Headers/UITextField.h 456 | 457 | 458 | 459 | UIView 460 | UIResponder 461 | 462 | IBFrameworkSource 463 | UIKit.framework/Headers/UIView.h 464 | 465 | 466 | 467 | 468 | 0 469 | IBCocoaTouchFramework 470 | 471 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 472 | 473 | 474 | 475 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 476 | 477 | 478 | YES 479 | OTOduino.xcodeproj 480 | 3 481 | 482 | DigitalPortViewBackgroundImage.png 483 | {131, 63} 484 | 485 | 132 486 | 487 | 488 | -------------------------------------------------------------------------------- /src/iphone/Classes/AnalogPinView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 823 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 132 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | 44 | YES 45 | 46 | 47 | 292 48 | {131, 63} 49 | 50 | 51 | 3 52 | MCAwAA 53 | 54 | NO 55 | NO 56 | IBCocoaTouchFramework 57 | 58 | NSImage 59 | DigitalPortViewBackgroundImage.png 60 | 61 | 62 | 63 | 64 | 292 65 | {{11, 36}, {109, 19}} 66 | 67 | 68 | NO 69 | NO 70 | IBCocoaTouchFramework 71 | 72 | 73 | 74 | 292 75 | {{14, 5}, {42, 21}} 76 | 77 | NO 78 | 7 79 | NO 80 | IBCocoaTouchFramework 81 | A01 82 | 83 | Helvetica-Bold 84 | 14 85 | 16 86 | 87 | 88 | 3 89 | MQA 90 | 91 | 92 | 1 93 | 10 94 | 95 | 96 | 97 | 292 98 | {{35, 4}, {72, 33}} 99 | 100 | NO 101 | 7 102 | NO 103 | IBCocoaTouchFramework 104 | 2.30 105 | 106 | Helvetica-Bold 107 | 28 108 | 16 109 | 110 | 111 | 1 112 | MC4wNjU3MTAwNjYzNCAwLjA1NTg0ODk4Njk3IDAuNDY0Mjg1NzE0MwA 113 | 114 | 115 | 10 116 | 2 117 | 118 | 119 | 120 | 292 121 | {{91, 9}, {31, 29}} 122 | 123 | NO 124 | 7 125 | NO 126 | IBCocoaTouchFramework 127 | V 128 | 129 | Helvetica-Bold 130 | 18 131 | 16 132 | 133 | 134 | 1 135 | MC4wNjU3MTAwNjYzNCAwLjA1NTg0ODk4Njk3IDAuNDY0Mjg1NzE0MwA 136 | 137 | 138 | 10 139 | 2 140 | 141 | 142 | {320, 460} 143 | 144 | 145 | 146 | IBCocoaTouchFramework 147 | 148 | 149 | 150 | 151 | YES 152 | 153 | 154 | colorBarView_ 155 | 156 | 157 | 158 | 7 159 | 160 | 161 | 162 | titleLabel_ 163 | 164 | 165 | 166 | 8 167 | 168 | 169 | 170 | valueLabel_ 171 | 172 | 173 | 174 | 9 175 | 176 | 177 | 178 | unitLabel_ 179 | 180 | 181 | 182 | 23 183 | 184 | 185 | 186 | 187 | YES 188 | 189 | 0 190 | 191 | 192 | 193 | 194 | 195 | 1 196 | 197 | 198 | YES 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | -1 209 | 210 | 211 | File's Owner 212 | 213 | 214 | -2 215 | 216 | 217 | 218 | 219 | 5 220 | 221 | 222 | 223 | 224 | 4 225 | 226 | 227 | 228 | 229 | 6 230 | 231 | 232 | 233 | 234 | 13 235 | 236 | 237 | 238 | 239 | 22 240 | 241 | 242 | 243 | 244 | 245 | 246 | YES 247 | 248 | YES 249 | -2.CustomClassName 250 | 1.CustomClassName 251 | 1.IBEditorWindowLastContentRect 252 | 1.IBPluginDependency 253 | 13.IBPluginDependency 254 | 13.IBViewBoundsToFrameTransform 255 | 22.IBPluginDependency 256 | 22.IBViewBoundsToFrameTransform 257 | 4.IBPluginDependency 258 | 4.IBViewBoundsToFrameTransform 259 | 5.CustomClassName 260 | 5.IBPluginDependency 261 | 5.IBViewBoundsToFrameTransform 262 | 6.IBPluginDependency 263 | 6.IBViewBoundsToFrameTransform 264 | 265 | 266 | YES 267 | UIResponder 268 | AnalogPinView 269 | {{313, 507}, {320, 480}} 270 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 271 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 272 | 273 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 274 | 275 | AUIgAABAgAAAA 276 | 277 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 278 | 279 | AUFgAABAAAAAA 280 | 281 | ColorBarView 282 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 283 | 284 | AUEwAABCEAAAA 285 | 286 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 287 | 288 | AUIgAABAgAAAA 289 | 290 | 291 | 292 | 293 | YES 294 | 295 | 296 | YES 297 | 298 | 299 | 300 | 301 | YES 302 | 303 | 304 | YES 305 | 306 | 307 | 308 | 24 309 | 310 | 311 | 312 | YES 313 | 314 | AnalogPinView 315 | UIView 316 | 317 | YES 318 | 319 | YES 320 | colorBarView_ 321 | titleLabel_ 322 | unitLabel_ 323 | valueLabel_ 324 | 325 | 326 | YES 327 | ColorBarView 328 | UILabel 329 | UILabel 330 | UILabel 331 | 332 | 333 | 334 | YES 335 | 336 | YES 337 | colorBarView_ 338 | titleLabel_ 339 | unitLabel_ 340 | valueLabel_ 341 | 342 | 343 | YES 344 | 345 | colorBarView_ 346 | ColorBarView 347 | 348 | 349 | titleLabel_ 350 | UILabel 351 | 352 | 353 | unitLabel_ 354 | UILabel 355 | 356 | 357 | valueLabel_ 358 | UILabel 359 | 360 | 361 | 362 | 363 | IBProjectSource 364 | Classes/AnalogPinView.h 365 | 366 | 367 | 368 | AnalogPinView 369 | UIView 370 | 371 | IBUserSource 372 | 373 | 374 | 375 | 376 | ColorBarView 377 | UIImageView 378 | 379 | IBProjectSource 380 | Classes/ColorBarView.h 381 | 382 | 383 | 384 | 385 | YES 386 | 387 | NSObject 388 | 389 | IBFrameworkSource 390 | Foundation.framework/Headers/NSError.h 391 | 392 | 393 | 394 | NSObject 395 | 396 | IBFrameworkSource 397 | Foundation.framework/Headers/NSFileManager.h 398 | 399 | 400 | 401 | NSObject 402 | 403 | IBFrameworkSource 404 | Foundation.framework/Headers/NSKeyValueCoding.h 405 | 406 | 407 | 408 | NSObject 409 | 410 | IBFrameworkSource 411 | Foundation.framework/Headers/NSKeyValueObserving.h 412 | 413 | 414 | 415 | NSObject 416 | 417 | IBFrameworkSource 418 | Foundation.framework/Headers/NSKeyedArchiver.h 419 | 420 | 421 | 422 | NSObject 423 | 424 | IBFrameworkSource 425 | Foundation.framework/Headers/NSObject.h 426 | 427 | 428 | 429 | NSObject 430 | 431 | IBFrameworkSource 432 | Foundation.framework/Headers/NSRunLoop.h 433 | 434 | 435 | 436 | NSObject 437 | 438 | IBFrameworkSource 439 | Foundation.framework/Headers/NSThread.h 440 | 441 | 442 | 443 | NSObject 444 | 445 | IBFrameworkSource 446 | Foundation.framework/Headers/NSURL.h 447 | 448 | 449 | 450 | NSObject 451 | 452 | IBFrameworkSource 453 | Foundation.framework/Headers/NSURLConnection.h 454 | 455 | 456 | 457 | NSObject 458 | 459 | IBFrameworkSource 460 | UIKit.framework/Headers/UIAccessibility.h 461 | 462 | 463 | 464 | NSObject 465 | 466 | IBFrameworkSource 467 | UIKit.framework/Headers/UINibLoading.h 468 | 469 | 470 | 471 | NSObject 472 | 473 | IBFrameworkSource 474 | UIKit.framework/Headers/UIResponder.h 475 | 476 | 477 | 478 | UIImageView 479 | UIView 480 | 481 | IBFrameworkSource 482 | UIKit.framework/Headers/UIImageView.h 483 | 484 | 485 | 486 | UILabel 487 | UIView 488 | 489 | IBFrameworkSource 490 | UIKit.framework/Headers/UILabel.h 491 | 492 | 493 | 494 | UIResponder 495 | NSObject 496 | 497 | 498 | 499 | UIView 500 | 501 | IBFrameworkSource 502 | UIKit.framework/Headers/UIPrintFormatter.h 503 | 504 | 505 | 506 | UIView 507 | 508 | IBFrameworkSource 509 | UIKit.framework/Headers/UITextField.h 510 | 511 | 512 | 513 | UIView 514 | UIResponder 515 | 516 | IBFrameworkSource 517 | UIKit.framework/Headers/UIView.h 518 | 519 | 520 | 521 | 522 | 0 523 | IBCocoaTouchFramework 524 | 525 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 526 | 527 | 528 | 529 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 530 | 531 | 532 | YES 533 | ../OTOduino.xcodeproj 534 | 3 535 | 536 | DigitalPortViewBackgroundImage.png 537 | {131, 63} 538 | 539 | 132 540 | 541 | 542 | -------------------------------------------------------------------------------- /src/iphone/Classes/DigitalPinView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 10J567 6 | 823 7 | 1038.35 8 | 462.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 132 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | 42 | 274 43 | 44 | YES 45 | 46 | 47 | 292 48 | {{4, 0}, {27, 29}} 49 | 50 | 51 | 3 52 | MCAwAA 53 | 54 | NO 55 | YES 56 | 7 57 | NO 58 | IBCocoaTouchFramework 59 | 12 60 | 61 | Helvetica-Bold 62 | 24 63 | 16 64 | 65 | 66 | 1 67 | MC4wNjU3MTAwNjYzNCAwLjA1NTg0ODk4Njk3IDAuNDY0Mjg1NzE0MwA 68 | 69 | 70 | 3 71 | MQA 72 | 73 | 1 74 | 6 75 | 1 76 | 77 | 78 | 79 | 292 80 | {{80, 0}, {73, 30}} 81 | 82 | NO 83 | IBCocoaTouchFramework 84 | 0 85 | 0 86 | 87 | Helvetica-Bold 88 | 15 89 | 16 90 | 91 | HIGH 92 | LOW 93 | 94 | 95 | 96 | 3 97 | MC41AA 98 | 99 | 100 | NSImage 101 | port_gray_button.png 102 | 103 | 104 | 105 | NSImage 106 | port_red_button.png 107 | 108 | 109 | 110 | 111 | 112 | 292 113 | {{37, -1}, {32, 32}} 114 | 115 | 116 | NO 117 | IBCocoaTouchFramework 118 | 0 119 | 0 120 | 121 | 122 | 123 | 1 124 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 125 | 126 | 127 | 128 | NSImage 129 | hiz_icon.png 130 | 131 | 132 | NSImage 133 | out_icon.png 134 | 135 | 136 | NSImage 137 | in_icon.png 138 | 139 | 140 | 141 | {320, 460} 142 | 143 | 144 | 145 | IBCocoaTouchFramework 146 | 147 | 148 | 149 | 150 | YES 151 | 152 | 153 | button_ 154 | 155 | 156 | 157 | 22 158 | 159 | 160 | 161 | titleLabel_ 162 | 163 | 164 | 165 | 25 166 | 167 | 168 | 169 | pinDirectionButton_ 170 | 171 | 172 | 173 | 28 174 | 175 | 176 | 177 | pinDirectionButtonTouched: 178 | 179 | 180 | 1 181 | 182 | 29 183 | 184 | 185 | 186 | buttonTouched: 187 | 188 | 189 | 1 190 | 191 | 30 192 | 193 | 194 | 195 | 196 | YES 197 | 198 | 0 199 | 200 | 201 | 202 | 203 | 204 | 1 205 | 206 | 207 | YES 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | -1 216 | 217 | 218 | File's Owner 219 | 220 | 221 | -2 222 | 223 | 224 | 225 | 226 | 6 227 | 228 | 229 | 230 | 231 | 20 232 | 233 | 234 | 235 | 236 | 27 237 | 238 | 239 | 240 | 241 | 242 | 243 | YES 244 | 245 | YES 246 | -2.CustomClassName 247 | 1.CustomClassName 248 | 1.IBEditorWindowLastContentRect 249 | 1.IBPluginDependency 250 | 20.IBPluginDependency 251 | 27.IBPluginDependency 252 | 6.IBPluginDependency 253 | 6.IBViewBoundsToFrameTransform 254 | 255 | 256 | YES 257 | UIResponder 258 | DigitalPinView 259 | {{1518, 640}, {320, 480}} 260 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 261 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 262 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 263 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 264 | 265 | AUIgAABAgAAAA 266 | 267 | 268 | 269 | 270 | YES 271 | 272 | 273 | YES 274 | 275 | 276 | 277 | 278 | YES 279 | 280 | 281 | YES 282 | 283 | 284 | 285 | 30 286 | 287 | 288 | 289 | YES 290 | 291 | DigitalPinView 292 | UIView 293 | 294 | YES 295 | 296 | YES 297 | buttonTouched: 298 | pinDirectionButtonTouched: 299 | 300 | 301 | YES 302 | id 303 | id 304 | 305 | 306 | 307 | YES 308 | 309 | YES 310 | buttonTouched: 311 | pinDirectionButtonTouched: 312 | 313 | 314 | YES 315 | 316 | buttonTouched: 317 | id 318 | 319 | 320 | pinDirectionButtonTouched: 321 | id 322 | 323 | 324 | 325 | 326 | YES 327 | 328 | YES 329 | button_ 330 | pinDirectionButton_ 331 | titleLabel_ 332 | 333 | 334 | YES 335 | UIButton 336 | UIButton 337 | UILabel 338 | 339 | 340 | 341 | YES 342 | 343 | YES 344 | button_ 345 | pinDirectionButton_ 346 | titleLabel_ 347 | 348 | 349 | YES 350 | 351 | button_ 352 | UIButton 353 | 354 | 355 | pinDirectionButton_ 356 | UIButton 357 | 358 | 359 | titleLabel_ 360 | UILabel 361 | 362 | 363 | 364 | 365 | IBProjectSource 366 | Classes/DigitalPinView.h 367 | 368 | 369 | 370 | DigitalPinView 371 | UIView 372 | 373 | IBUserSource 374 | 375 | 376 | 377 | 378 | 379 | YES 380 | 381 | NSObject 382 | 383 | IBFrameworkSource 384 | Foundation.framework/Headers/NSError.h 385 | 386 | 387 | 388 | NSObject 389 | 390 | IBFrameworkSource 391 | Foundation.framework/Headers/NSFileManager.h 392 | 393 | 394 | 395 | NSObject 396 | 397 | IBFrameworkSource 398 | Foundation.framework/Headers/NSKeyValueCoding.h 399 | 400 | 401 | 402 | NSObject 403 | 404 | IBFrameworkSource 405 | Foundation.framework/Headers/NSKeyValueObserving.h 406 | 407 | 408 | 409 | NSObject 410 | 411 | IBFrameworkSource 412 | Foundation.framework/Headers/NSKeyedArchiver.h 413 | 414 | 415 | 416 | NSObject 417 | 418 | IBFrameworkSource 419 | Foundation.framework/Headers/NSObject.h 420 | 421 | 422 | 423 | NSObject 424 | 425 | IBFrameworkSource 426 | Foundation.framework/Headers/NSRunLoop.h 427 | 428 | 429 | 430 | NSObject 431 | 432 | IBFrameworkSource 433 | Foundation.framework/Headers/NSThread.h 434 | 435 | 436 | 437 | NSObject 438 | 439 | IBFrameworkSource 440 | Foundation.framework/Headers/NSURL.h 441 | 442 | 443 | 444 | NSObject 445 | 446 | IBFrameworkSource 447 | Foundation.framework/Headers/NSURLConnection.h 448 | 449 | 450 | 451 | NSObject 452 | 453 | IBFrameworkSource 454 | UIKit.framework/Headers/UIAccessibility.h 455 | 456 | 457 | 458 | NSObject 459 | 460 | IBFrameworkSource 461 | UIKit.framework/Headers/UINibLoading.h 462 | 463 | 464 | 465 | NSObject 466 | 467 | IBFrameworkSource 468 | UIKit.framework/Headers/UIResponder.h 469 | 470 | 471 | 472 | UIButton 473 | UIControl 474 | 475 | IBFrameworkSource 476 | UIKit.framework/Headers/UIButton.h 477 | 478 | 479 | 480 | UIControl 481 | UIView 482 | 483 | IBFrameworkSource 484 | UIKit.framework/Headers/UIControl.h 485 | 486 | 487 | 488 | UILabel 489 | UIView 490 | 491 | IBFrameworkSource 492 | UIKit.framework/Headers/UILabel.h 493 | 494 | 495 | 496 | UIResponder 497 | NSObject 498 | 499 | 500 | 501 | UIView 502 | 503 | IBFrameworkSource 504 | UIKit.framework/Headers/UIPrintFormatter.h 505 | 506 | 507 | 508 | UIView 509 | 510 | IBFrameworkSource 511 | UIKit.framework/Headers/UITextField.h 512 | 513 | 514 | 515 | UIView 516 | UIResponder 517 | 518 | IBFrameworkSource 519 | UIKit.framework/Headers/UIView.h 520 | 521 | 522 | 523 | 524 | 0 525 | IBCocoaTouchFramework 526 | 527 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 528 | 529 | 530 | 531 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 532 | 533 | 534 | YES 535 | ../OTOduino.xcodeproj 536 | 3 537 | 538 | YES 539 | 540 | YES 541 | hiz_icon.png 542 | in_icon.png 543 | out_icon.png 544 | port_gray_button.png 545 | port_red_button.png 546 | 547 | 548 | YES 549 | {26, 26} 550 | {26, 26} 551 | {26, 26} 552 | {82, 30} 553 | {82, 30} 554 | 555 | 556 | 132 557 | 558 | 559 | --------------------------------------------------------------------------------