Description
If you'd like to turn your iPhone into an unusual device such as a metal detector or barometer, this book is just for you.
From this book you'll learn how to write simple apps with techBASIC, an Apple-approved development environment. You will learn how to create a hygrometer or accelerometer using sensors built into iOS devices and Arduino platform. And with the use of Bluetooth Low Energy technology and a microcontroller you will be able to remotely control your car. Learn about these and other projects and use your iPhone in an original way.
With this book:
you will learn the language of techBasic
you can access the sensors built into your device
you build a gyroscope, barometer or hygrometer
take full advantage of your iPhone and iPad
Table of contents
Introduction (7)
1 Introduction to techBASIC and sensors built into iOS devices (13)
Own tricorder (13)
Short introduction to techBASIC (14)
TechBASIC Sampler application (15)
Launch of the first programme (15)
Programme development (17)
Accelerometer (20)
2. accessing other built-in sensors (33)
Gyroscope (34)
Magnetometer (41)
Getting a faster response from the sensor (47)
Course setting (51)
Location (52)
Your own tricorder (53)
3. we build a metal detector (55)
Magnetometer for iPhone and iPad (55)
Earth's magnetic field (56)
Using the iPhone or iPad as a metal detector (58)
Conversion of Magnetometer to metal detector application (60)
Use of metal detector (61)
What's next? (63)
4. HiJack (65)
What's HiJack? (65)
Sensor design (67)
External power supply for HiJack (71)
Hello HiJack Programme (73)
When things go wrong (75)
Better version of HiJack (75)
What's next? (80)
5. we build a moisture meter with a HiJack (81)
Addition of a moisture meter to the tricorder (81)
Construction of the moisture meter (82)
Calibration (83)
Collecting data for calibration (83)
Transferring data files to and from techBASIC (85)
Use of calibration data (86)
Better software version (89)
Full Moisture Meter source code (96)
Low Energy Bluetooth technology (99)
What is Low Energy Bluetooth technology? (99)
Texas Instruments' SensorTag (101)
Creating programs to support BLE devices (103)
Accelerometer (115)
What's an accelerometer? (115)
Accessing an accelerometer (116)
Use of an accelerometer (118)
Accelerometer reading program source code (120)
Barometer (123)
Accessing the barometer (124)
Source code of the barometer reading program (128)
Gyroscope (132)
Accessing the gyroscope (132)
Use of a gyroscope (134)
Source code of the gyroscope reading program (135)
Magnetometer (138)
Accessing the magnetometer (139)
Use of a magnetometer (141)
Source code of the magnetometer reading program (141)
Moisture meter (144)
Accessing the moisture meter (145)
Source code of the program reading values from the moisture meter (147)
Thermometer (150)
Accessing the thermometer (150)
Use of the thermometer (152)
Source code of the program reading the values from the thermometer (153)
What's next? (156)
7 Rocket model as an iPhone-controlled BLE (157)
A bit of information on rocket construction (158)
Lists of necessary elements (159)
ST-1 (159)
ST-2 (160)
Other components needed for both rockets under construction (161)
Why are we using SensorTag? (161)
Construction (162)
ST-2 rocket model carrying iPhone and SensorTag (163)
Model ST-1 rocket carrying only SensorTag (168)
Data collection programme (169)
SensorTag software operating in the +/-8G range (180)
Flight instructions (182)
Engines (182)
Parachutes (182)
Weather on flights (182)
Missile launch (183)
Data (183)
Data analysis (183)
Data analysis with Rocket Flight Analysis (185)
Speed and height (186)
Rotation and pressure (189)
What did we find out? (189)
Results for ST-1 rocket (189)
Results for ST-2 rocket (191)
8 Remote control of the car with a BLE and Arduino microcontroller (193)
Control of a car with a BLE (194)
Remote control car selection (196)
Modification of the car (200)
Bridge H (201)
Texas Instruments SN754410 (202)
Installation of the entire electronic system (204)
Arduino Uno microcontroller control (211)
Installation of Arduino software (211)
Firmata software download (213)
Software (216)
Pulse width modulation (216)
Back to the software (218)
Start the engines! (228)
9 BLE connection between iOS devices (231)
Subordinate mode in BLE (231)
BLE Chat Program (232)
Device configuration (232)
Use of services (234)
10 Paddles, or homage to the Pong game (245)
Classic Pong game (245)
Paddles game (246)
Pallet handling program (247)
Paddles console software (251)
11. Wi-Fi (263)
Communication with the world (263)
HTTP, FTP and TCP/IP protocols (264)
WiFly (265)
Electronic circuit (266)
Establishing a network connection (267)
Communication with TCP/IP (268)
Simple terminal program (269)
Wi-Fi and Arduino (271)
Loading software for Arduino microcontroller (271)
Electronic circuit (273)
Communication via terminal program (274)
12th Wi-Fi servos (275)
General information about servos (275)
Polyol Serial Servo Controller (276)
Electronic circuit (279)
Halloween masks (281)
Software (281)
Try the device you built (285)
Forward and backward movement of the servo (285)
Completion (288)
Scorch (289)