Swift
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8a1b41a Mar 4, 2017

README.md

Mindstorms NXT Playground Book for iOS

https://devpost.com/software/mindstorms-nxt-playground-book

Setup

brew tap ngs/formulae
brew cask install nxt-fantom-driver
brew install nexttool nbc

# Install firmware
wget http://bricxcc.sourceforge.net/lms_arm_nbcnxc.zip
unzip lms_arm_nbcnxc.zip
nexttool -firmware="lms_arm_nbcnxc/lms_arm_nbcnxc_132.rfw"

# Clone the repo
git clone git@github.com:ngs/mindstorms-nxt-playground-book.git

# Setup Xcode projects
cd mindstorms-nxt-playground-book/Server
swift package generate-xcodeproj

cd ../EasyNXC
swift package generate-xcodeproj

How to use

let nxt = NXT(name: "Hello NXT") // initialize robot

nxt.rotate(motor: .a, power: 100, angle: 145.0) // change angle of motor

// define sub routine
let sub = nxt.sub { nxt in
    nxt.forward(length: 100, turn: 0)
    nxt.wait(msec: 500)
    nxt.reverse(length: 100, turn: 0)
    nxt.wait(msec: 500)
}

// call sub routine
sub.call()