Giter Club home page Giter Club logo

matatino's Introduction

Matatino is a Cocoa framework for Mac that provides a straight-forward way to communicate with your Arduino through its serial connection.

Matatino was developed by RobotGrrl. Matatino uses AMSerialPort (with modifications from xcode-arduino-serial-communication). Matatino was based off of xcode-arduino-serial-communication.

##Usage

###Variables id delegate Delegate for receiving the callbacks. See below for the callback methods.

BOOL debug

Triggers NSLog() statements inside the code. Set to NO by default.

###Init - (id)initWithDelegate:(id )aDelegate Initializes the Matatino object with a specific delegate. We recommend using this instead of -init and manually setting the delegate.

###Connect/disconnect - (BOOL) connect:(NSString *)deviceName withBaud:(long)baud Connects the Arduino with a certain baud rate.

The deviceName is the AMSerialPort bsdPath. You can access an array of all the bsdPath's by using -deviceNames (below).

The baud rate long that is passed must be one of the standard speeds as defined in termios.h. You can see them listed out on the website.

- (void) disconnect

Safely disconnects the connected device.

- (BOOL) isConnected

Checks if the Arduino is connected. If the Arduino is connected, returns YES. Otherwise, NO.

###Send data - (BOOL) send:(NSString *)tx Sends a NSString to the connected device. A \r is appended the end of the NSString.

The NSString is written using NSUTF8StringEncoding encoding.

Returns NO if the port was not open, or if there was an error sending the data. Otherwise, returns YES.

###Serial related - (NSArray *) deviceNames Returns a NSArray of NSStrings. The strings are all the AMSerialPort's bsdPath.

- (AMSerialPort *) port

Returns the current AMSerialPort. You will probably never need to use this.

- (void) setPort:(AMSerialPort *)newPort

Sets current AMSerialPort to a new AMSerialPort. You probably never need to use this.

###MatatinoDelegate Callbacks

- (void) receivedString:(NSString *)rx

Called when the Arduino sends data to the Mac. The NSString uses NSASCIIStringEncoding encoding.

- (void) portClosed

Called whenever a port is closed. When you stop the communication to the Arduino, this is called.

- (void) portAdded:(NSArray *)ports

Called when a port is added. This is useful to update a pulldown menu of all the ports, for example. Has a NSArray of NSString- they are AMSerialPort bsdPath's.

- (void) portRemoved:(NSArray *)ports

Called when a port is removed. This is useful to update a pulldown menu of all the ports, for example. Has a NSArray of NSString- they are AMSerialPort bsdPath's.

##Contribute

Matatino is released under the BSD 3-Clause license. This means that you can contribute fixes, improvements, and changes. All contributions that will be included in the main branch will receive credit in the Matatino and Meters for Arduino credits.rtf.

You can also make your own applications with Matatino! Although the BSD 3-Clause license is not a "copyleft" license that requires you to redistribute the source code, we highly encourage that you do so. The Arduino community is what it celebrates, an open sharing of all knowledge used to make a project!

Making Matatino more friendly for other devices would be cool. In AMSerialPort, there are ways to change the flow control and other details. Maybe making easier accessors for those in Matatino.h would be good.

##License

Matatino is released under the BSD 3-Clause license. You can view our other legal information in legal.markdown or on the website.

matatino's People

Contributors

robotgrrl avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.