Category Archives: Projects

Blogs Projects

Merry Christmas

Jingle Bells song by a StepMotor, a rs2ic board to control tone and a Arduino to control the sequence made to thank you all.

Blogs Product Projects

Tutorial Arduino – RSI2C Hello World – Blink a led on P1 at I2C address 0×10

This is the first tutorial on how to use a RSI2C board with an Arduino using the RSArduino library.

It will blink a led connected on P1, this is the equivalent of the usual helloworld programm for an embedded solution.

You’ll need:
An Arduino board;
The Arduino programming software version 1.0 or + installed on your computer;
The RSArduino library;
A RSI2C board using the default i2c address (0×10);
A 220 ohms resistor;
A led;

Here is the schematic:
Arduino - RSI2C  Hello World Schematic

Install the components on your breadboard, here is what it looks on the breadboard:
Arduino - RSI2C Hello World Breadboard

On your Arduino programming environnement, open the example programm blink_led_on_0x10:

The code should look like:

/****
Blink led on a Robotic Sequencing I2C board on address 0x10

Demonstrates use of the RS library
Blink a led via I2C on a RSi2cBoard at 0x10 address.

by Stephane Rousseau
Created 2012 January 28th

Copyright (C) 2012 Stephane Rousseau

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

****/

#include
#include

#define LEDP1 1
#define REMOTEADDR 0x10

RSDigitalPin ledPin = RSDigitalPin();

void setup()
{
ledPin.setMode(REMOTEADDR, LEDP1, OUTPUT);
}

void loop() // run over and over again
{
ledPin.write(REMOTEADDR, LEDP1, HIGH); // sets the LED on
delay(1000); // waits for a second
ledPin.write(REMOTEADDR, LEDP1, LOW); // sets the LED off
delay(500); // waits for a half second
}

Compile and upload the code on your Arduino and you should see the led blinking.

Good job :-)

See us on Google+
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.