Thursday, July 9, 2015

Beginning C for Arduino, Second Edition: Learn C Programming for the Arduino

Beginning C for Arduino, Second Edition: Learn C Programming for the Arduino

Beginning C for Arduino, Second Edition is written for those who have no prior experience with microcontrollers or programming but would like to experiment and learn both. Updated with new projects and new boards, this book introduces you to the C programming language, reinforcing each programming structure with a simple demonstration of how you can use C to control the Arduino family of microcontrollers. Author Jack Purdum uses an engaging style to teach good programming techniques using examples that have been honed during his 25 years of university teaching.

Beginning C for Arduino, Second Edition will teach you:
  • The C programming language
  • How to use C to control a microcontroller and related hardware
  • How to extend C by creating your own libraries, including an introduction to object-oriented programming
During the course of the book, you will learn the basics of programming, such as working with data types, making decisions, and writing control loops. You'll then progress onto some of the trickier aspects of C programming, such as using pointers effectively, working with the C preprocessor, and tackling file I/O. Each chapter ends with a series of exercises and review questions to test your knowledge and reinforce what you have learned.

What you’ll learn
  • The syntax of the C programming language as defined for the Arduino
  • Tried and true coding practices (applicable to any programming language)
  • How to design, code, and debug programs that drive Arduino microcontrollers
  • How to extend the functionality of C
  • How to integrate low cost, off-the-shelf, hardware shields into your own projects
Who this book is for
The book is aimed at a complete novice with no programming background. It assumes no prior programming or hardware design experience and is written for creative and curious people who would like to blend a software and hardware learning experience into a single, enjoyable endeavor.

Table of Contents
  • Introduction to Arduino Microcontrollers
  • Arduino C
  • Data Types
  • Decision Making in C
  • Program Loops
  • Functions in C
  • Storage Classes and Scope
  • Introduction to Pointers
  • Using Pointers Effectively
  • I/O Operations
  • The C Preprocessor
  • A Gentle Introduction to Object-Oriented Programming
  • Arduino Libraries
  • Arduino I/O
  • Appendix A - Suppliers
  • Appendix B - Hardware Components

Monday, July 6, 2015

NEW Arduino Yun Mini

The new Arduino Yun Mini offers an Atmel ATmega32U4 chip running Arduino code, and ships with a 16MHz crystal oscillator, 64MB of DDR2 RAM, and 16MB of flash. The Yun Mini is considerably smaller than its counterpart and weighs just 16 grams.

Sunday, July 5, 2015

Connect Arduino Due with HC-06 (Bluetooth Module)

Last post (direct to Arduino-er: Test HC-06 Bluetooth Module with Android BluetoothChat) show how to use Android Bluetooth Chat test app to talk with standalone HC-06. This post show how to connect Arduino Due to HC-06 via Serial 3, to receive data from Android and echo back to Android, and also send to Serial port for monitoring.


Connection between Arduino Due and HC-06:
Serial (Tx/Rx) communicate to PC via USB
Serial3 (Tx3/Rx3) connect to HC-06
HC-06 Rx - Due Tx3
HC-06 Tx - Due Rx3
HC-06 GND - Due GND
HC-06 VCC - Due 3.3V

DueHC06_AT.ino
/*
Arduino Due + HC-06 (Bluetooth) -echo bluetooth data

Serial (Tx/Rx) communicate to PC via USB
Serial3 (Tx3/Rx3) connect to HC-06
HC-06 Rx - Due Tx3
HC-06 Tx - Due Rx3
HC-06 GND - Due GND
HC-06 VCC - Due 3.3V

*/
#define HC06 Serial3

void setup()
{
  delay(1000);
  Serial.begin(9600);
  HC06.begin(9600);
  
  Serial.write("\nTest Start\n");
}

void loop()
{
  while(HC06.available())
  {
    char data = HC06.read();
    Serial.write(data);
    HC06.write(data);
  }
}

Related:
Android BluetoothChat connect to Arduino Uno + HC-05