Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

ngs-archives/mindstorms-nxt-playground-book

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()