Showing posts with label ios. Show all posts
Showing posts with label ios. Show all posts

Thursday, August 25, 2016

Arduino Development for OSX and iOS

Arduino Development for OSX and iOS


Arduino Development for OSX and iOS

This is a special book for readers who want to learn Arduino development on OSX and iOS environments. The following is highlight topics on this book:
  • Preparing development environment 
  • Sketch programming 
  • Controlling Arduino from OSX 
  • Controlling Arduino from iOS 
  • Debugging Arduino Logic


Get

Read more »

Tuesday, August 23, 2016

Control Arduino Genuino 101 onboard LED from Android iOS via Bluetooth Low Energy BLE

Control Arduino Genuino 101 onboard LED from Android iOS via Bluetooth Low Energy BLE


From Arduino IDE with Arduino/Genuino 101 board installed, its a CallbackLED example to test Arduino/Genuino 101 Bluetooth Low Energy (BLE) capabilities to turn on and of the LED connected to Pin 13 from a Android or iOS.


In Arduino IDE, open and download the CallbackLED example:
- File > Examples > CurieBLE > CallbackLED

CallbackLED.ino
/*
Copyright (c) 2015 Intel Corporation. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-
1301 USA
*/


#include <CurieBLE.h>

const int ledPin = 13; // set ledPin to use on-board LED
BLEPeripheral blePeripheral; // create peripheral instance

BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // create service

// create switch characteristic and allow remote device to read and write
BLECharCharacteristic switchChar("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);

void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT); // use the LED on pin 13 as an output

// set the local name peripheral advertises
blePeripheral.setLocalName("LEDCB");
// set the UUID for the service this peripheral advertises
blePeripheral.setAdvertisedServiceUuid(ledService.uuid());

// add service and characteristic
blePeripheral.addAttribute(ledService);
blePeripheral.addAttribute(switchChar);

// assign event handlers for connected, disconnected to peripheral
blePeripheral.setEventHandler(BLEConnected, blePeripheralConnectHandler);
blePeripheral.setEventHandler(BLEDisconnected, blePeripheralDisconnectHandler);

// assign event handlers for characteristic
switchChar.setEventHandler(BLEWritten, switchCharacteristicWritten);
// set an initial value for the characteristic
switchChar.setValue(0);

// advertise the service
blePeripheral.begin();
Serial.println(("Bluetooth device active, waiting for connections..."));
}

void loop() {
// poll peripheral
blePeripheral.poll();
}

void blePeripheralConnectHandler(BLECentral& central) {
// central connected event handler
Serial.print("Connected event, central: ");
Serial.println(central.address());
}

void blePeripheralDisconnectHandler(BLECentral& central) {
// central disconnected event handler
Serial.print("Disconnected event, central: ");
Serial.println(central.address());
}

void switchCharacteristicWritten(BLECentral& central, BLECharacteristic& characteristic) {
// central wrote new value to characteristic, update LED
Serial.print("Characteristic event, written: ");

if (switchChar.value()) {
Serial.println("LED on");
digitalWrite(ledPin, HIGH);
} else {
Serial.println("LED off");
digitalWrite(ledPin, LOW);
}
}

On smartphone with BLE, download "nRF Master Control Panel (BLE)" app:
nRF Master Control Panel is a powerful generic tool that allows you to scan, advertise and explore your Bluetooth Smart (BLE) devices and communicate with them. nRF MCP supports number of Bluetooth SIG adopted profiles including Device Firmware Update profile (DFU) from Nordic Semiconductors.
- Android
- iOS


reference: http://www.arduino.cc/en/Tutorial/Genuino101CurieBLECallbackLED


Get

Read more »

Friday, July 29, 2016

Arduino iOS Blueprints

Arduino iOS Blueprints


Integrate the Arduino and iOS platforms to design amazing real-world projects to sense and control external devices

Arduino iOS Blueprints

About This Book
  • Cover the most widely used methods in the Internet of Things using Arduino and iOS integration through Wi-Fi Shield and the BLE Breakout board
  • Design five real-world projects including of electronics, Arduino code, and an iOS application that seamlessly work together
  • A detailed guide that covers various sensors and actuators through which Arduino interacts with the world including a light sensor, hall effect sensor, accelerometer, servo motor, DC motor, and TRIAC for power line loads
Who This Book Is For
This book is a technical guide for Arduino and iOS developers who have a basic knowledge of the two platforms but want to learn how to integrate them. The book includes a lot of external references to additional documentation and learning materials, so even if you are less experienced, you can improve your knowledge on the subjects covered.

What You Will Learn
  • Design circuits with Arduino using sensors and actuators
  • Write code to handle analog and digital sensors with the most used protocols including OneWire, I2C, and SPI)
  • Store data on SD Card and in EEPROM
  • Build iOS applications using the MCV pattern and the UIKit components
  • Allow your applications to control Arduino and its hooked-up devices
  • Manage TCP/IP, UDP, and Bluetooth BLE communication between Arduino and iOS devices
  • Make your iOS application take advantage of the sensors available in the iOS devices including accelerometer, gyroscope, and compass
  • Develop iOS applications that use iBeacons
In Detail
Arduino and iOS devices have reached wide popularity due to their simple way of use and flexibility. Hence, their integration opens up new opportunities, allowing everyone to build devices that are extremely useful in everyday life.

You will first learn how to control Arduino from an iPhone or iPad by writing the Arduino sketch, the iOS application, and integrating everything together via Wi-Fi or Bluetooth BLE. You will then learn about various components that interact with the Arduino such as digital and analog I/O, Wi-Fi shield, Bluetooth BLE, SD card, OneWire, I2C, and so on. You will also learn about iOS, which includes the development of an application from scratch, GUI design and MVC, UIKit, iOS sensors, TCP and Bluetooth BLE communication, and more.

All the projects are described in detail, providing you with a learning tool, not just some sketches or some iOS code to copy.

Style and approach
This is a project-based book with a step-by-step guide that covers everything that you need to build an Arduino-iOS project, right from defining the basic requirements to the coding and testing the entire project. Each chapter ends with ideas on how to improve the project and to constantly learn the topics covered.


Get

Read more »