Difference between revisions of "Microcontroller And Electronics"

From veeOp Wiki
Jump to: navigation, search
(Created page with "== Re-programming the on-board Arduino Compatible == The veeOP has an on-board arduino compatible, allowing you to customize it to the fullest extent. The tool included wit...")

Revision as of 11:34, 9 October 2013

Contents

Re-programming the on-board Arduino Compatible

The veeOP has an on-board arduino compatible, allowing you to customize it to the fullest extent.

The tool included with the downloadable distros here is the InoTool, a command-line Arduino tool. To get into the details, check out their installation guide, and their quick-start guide. But, we'll go over the details here, too.

In the distros provided here in the home directory for the "pi" user, you'll find a directory named 'arduino-vop' which already has an editable version of the code that's already on the microcontroller that you can use to get started!


Installing the necessary tools

If you're not using a veeOP customized distro, you might wish to install the tools from scratch. The examples given here are from PiDora (the Fedora distro for the pi), but, can be easily applied to most distros.

For example, where I say "yum install package_name" under a Debian-based distro you can use "apt-get install package_name".


Using Arduino Shields with your veeOP

The veeOP is designed to be able to extend it using Arduino Shields. There are shields for all kinds of applications

  • GPSr (global position system recievers)
  • GSM (cell phone service)
  • LCD Displays
  • Wireless (like the ZigBee / XBee)
  • And much, much more.

Are you new to Arduino?

Don't sweat it! The Arduino is intended to be an approachable technology, and one that gives a new user a lot of power. And, you'll feel great interacting directly with microcontrollers. The best part is, you can use your veeOP to help you learn.

You can log onto the veeOP connected to your raspberry pi, but, you might want to download the Arduino IDE (integrated development environment) and get started on your workstation (your laptop or desktop computer). You can compile the veeOP code right there to do some initial testing and exploration.

Some resources you might be interested in:

The I²C API

The I²C API on the microcontroller is a rather simple little set of commands that rides on I²C. For more information about I²C we direct you to Wikipedia.

The veeOP uses the Raspberry Pi as the I²C master, with the arduino-compatible being the slave, at address 4 (0x04) by default (this is configurable in the library.)

How Commands are sent

Commands are sent to the veeOP arduino-compatible with a 4-byte tuple. It looks like so:

(C,P_1,P_2,E)

Where each element is a single byte, representing:


    \begin{align}
      C & = \text{Command}                       \\
      P_1 & = \text{First Parameter}             \\
      P_2 & = \text{Second Parameter}            \\
      E & = \text{End of Command (0x0A)} \\
    \end{align}

How responses are recieved

Advanced Resources

Other resources that were valuable as the interface between the veeOP board and Raspberry Pi for programming the onboard arduino-compatible: