Arduino Serial Ports UART0 is the default serial port which is used for serial programming. Some arduino’s have more than one serial port and these are called Serial1, Serial2, etc Setup Serial Port Sending ASCII Text Sending Variables As ASCII Others see here. Write Binary Data Receive Binary Data
All posts by
Variables – C
Using C Standard Variable Types This can be essential if using a 32bit Arduino and needing a 16bit varaible or for any code which needs to be sure what size and int variable is #include <stdint.h> bool boolean char -128 to 127 byte 0 to 255 short unsigned short int unsigned int long unsigned long long […]
Variables – Arduino Standard
Arduino Standard Variable Types char -128 to 127 (8-bit) byte 0 to 255 (8-bit) int ATMega based boards (e.g. Arduino Uno) -32,768 to 32,767 (16-bit) Arduino Due and other 32bit boards -2,147,483,648 to 2,147,483,647 (32-bit) unsigned int ATMega based boards (e.g. Arduino Uno) 0 to 65,535 (16-bit) Arduino Due and other 32bit boards 0 to […]
Comments
Commenting is the same as for C programming: /* A multi line comment */ //A single line comment
Delay
Delay 1 cycle A nop instruction, allowing you to waste one cycle (62.5ns on a 16MHz Arduino) is created using this inline assembly: Or can be made into a define using this: Delay mS Value is unsigned long, so up to 4,294,967,295 (32-bit) Delay uS Value is unsigned int. Delay nS Supported by some boards
General IO Pins
Setup Pin Mode Set Outputs Read Inputs Using a variable: Using directly: Analog Pins As General IO The analog pins can be used identically to the digital pins, using the aliases A0, A1, etc. Device Pin Numbers You should always use Arduino pin numbers (e.g. 1, 2, 3, A0, A1, A2) and not device port […]
Defines
Using Defines #define LED 13 You can also use constants if preferred const int ledPin = 13;
.Creating A New Project
Terminology Sketch A ‘sketch’ is a program in Arduino terminology. Creating The Project Open the ‘Arduino’ software. Create A New Sketch Menu > File > New Sketch Menu > Tools > Board Select the board you are using Menu > Tools > Serial Port Ensure the Arduino is connected to your computer and then select […]
.Setting Up
Download the Arduino IDE software from here.
Codebender
Codebender offer a remote programming via Ethernet option http://codebender.cc/