background preloader

PortManipulation - Aurora

PortManipulation - Aurora
Reference Language | Libraries | Comparison | Changes Port registers allow for lower-level and faster manipulation of the i/o pins of the microcontroller on an Arduino board. The chips used on the Arduino board (the ATmega8 and ATmega168) have three ports: B (digital pin 8 to 13) C (analog input pins) D (digital pins 0 to 7) Each port is controlled by three registers, which are also defined variables in the arduino language. DDR and PORT registers may be both written to, and read. PORTD maps to Arduino digital pins 0 to 7 DDRD - The Port D Data Direction Register - read/write PORTD - The Port D Data Register - read/write PIND - The Port D Input Pins Register - read only PORTB maps to Arduino digital pins 8 to 13 The two high bits (6 & 7) map to the crystal pins and are not usable DDRB - The Port B Data Direction Register - read/write PORTB - The Port B Data Register - read/write PINB - The Port B Input Pins Register - read only PORTC maps to Arduino analog pins 0 to 5. Examples See

StepperBipolarCircuit - Aurora Reference Language | Libraries | Comparison | Changes Two Pins Four Pins Reference Home Arduino Ethernet Shield Tutorial The Ethernet Shield is based upon the W51000 chip, which has an internal 16K buffer. It has a connection speed of up to 10/100Mb. This is not the fastest connection around, but is also nothing to turn your nose up at. It relies on the Arduino Ethernet library, which comes bundled with the development environment. There is also an on-board micro SD slot which enables you to store a heck-of-a-lot of data, and serve up entire websites using just your Arduino. The board also has space for the addition of a Power over Ethernet (PoE) module, which allows you to power your Arduino over an Ethernet connection. For a full technical overview, see the official Ethernet Shield page.

Schematic for Arduino Sensor Shield v5.0 ? - Arduino Forum - Aurora It's very unfortunate that the term "Arduino" is used both for a specific company name and also for generic module compatibility from any manufacturer. Arduino is a trademark that many folk in various countries are only too happy to violate. Consider how easy it is to violate said trademark, BTW. Unlike Digilent and other companies products' you don't even need to reverse-engineer the schematics, code, etc. because it's all published for the world to use. My Mega2560 is marked "WWW.ARGUINO.CC" and "DESIGN IN ITALY". Well, reads like a knockoff whose intent was to skirt the trademarked name, much like "Rotex", "Prolex", and other variations of a well-known watch brand. My "Arduino Sensor Shield v5.0" has "SainSmart" stenciled on the reverse side, yet sells an apparently identical shield with an identically-colored PCB. Cheers and best of luck with your project. --- Edited to acknowledge that Digilent publishes its Eagle files ----

playground - RegulatedPositiveVoltageBooster Outputs 1/4 Watt, up to +60V DC Max Accepts any input voltage (1V minimum) Uses a simple, flexible circuit Warning: If you don't follow the instructions carefully, wiring this circuit wrong can damage your Arduino. Arduino Project and Schematic Download Schematic Pictures The Arduino 5V boosted to 40V, with a hand made inductor. The same circuit, with the Arduino regulating at 9V instead. Circuit Theory Inductors resist changes in current. There are many ways to explain the relationship between PWM (analog output) and output voltage. Don't worry about the gain of the transistor. The exact inductance of L1 doesn't matter. If you're trying to get more than one watt, then use a darlington pair. Software Summary The Arduino ATMega168 regulates the output voltage. The program was written for both the ATMega8 or ATMega168. Inductors that work Each inductor behaved a bit differently. The bottom row has two hand made inductors. The quarter is there to show the image's scale. Safety

RotaryEncoders - Aurora ALPS STEC12E07 Encoder A rotary or "shaft" encoder is an angular measuring device. It is used to precisely measure rotation of motors or to create wheel controllers (knobs) that can turn infinitely (with no end stop like a potentiometer has). I've written a little sketch to read a rotary controller and send its readout via RS232. It simply updates a counter (encoder0Pos) every time the encoder turns by one step, and sends it via serial to the PC. This works fine with an ALPS STEC12E08 encoder which has 24 steps per turn. I learned about how to read the encoder from the file encoder.h included in the Arduino distribution as part of the AVRLib. Example 1 Oh, a few notes: I'm not sure about the etiquette of this, but I'm just going to add onto this tutorial. Below is an image showing the waveforms of the A & B channels of an encoder. This might make it a little more clear how the code above works. Interrupt Example Below is some code that uses an interrupt. BY:dskv ***CAUTION!!! void setup() {

Setting up an Arduino on a breadboard Overview This tutorial shows you how to build an Arduino compatible breadboard with an Atmel Atmega8/168/328 AVR microcontroller and FTDI FT232 breakout board from SparkFun. You could also use the Arduino USB Mini. Originally created David A. Parts To do this, you'll need: The Supplies Basic Parts for wiring up Arduino A breadboard 22 AWG wire 7805 Voltage regulator 2 LEDs2 220 Ohm resistors 1 10k Ohm resistor 2 10 uF capacitors 16 MHz clock crystal 2 22 pF capacitors small momentary normally open ("off") button, i.e. USB to Serial Communication Board You will need a FT232 USB Breakout board from SparkFun. FT232RL USB to Serial Breakout Board, SKU BOB-0071Arduino Serial USB Board, SKU DEV-08165 If you plan to use the top option and have not yet soldered headers to the breakout board, now would be a good time. Bootloading your Atmega Chips There are several options for bootloading your Atmega chips, a few of which are covered in this tutorial. Adding circuitry for a power supply Top Power lines

ArduinoToBreadboard This tutorial explains how to migrate from an Arduino board to a standalone microcontroller on a breadboard. It's similar to this tutorial, but uses an Arduino board to program the ATmega on the breadboard. Unless you choose to use the minimal configuration described at the end of this tutorial, you'll need four components (besides the Arduino, ATmega328, and breadboard): a 16 MHz crystal, a 10k resistor, and two 18 to 22 picofarad (ceramic) capacitors. Uploading Using an Arduino Board Once your ATmega328p has the Arduino bootloader on it, you can upload programs to it using the USB-to-serial convertor (FTDI chip) on an Arduino board. Uploading sketches to an ATmega on a breadboard. Minimal Circuit (Eliminating the External Clock) If you don't have the extra 16 MHz crystal and 18-22 picofarad capacitors used in the above examples, you can configure the ATmega328 to use its internal 8 MHz RC oscillator as a clock source instead. Attention This procedure works on Arduino 1.0.x software.

ArduinoISP Learning Examples | Foundations | Hacking | Links This tutorial explains how to use an Arduino board as an AVR ISP (in-system programmer). This allows you to use the board to burn the bootloader onto an AVR (e.g. the ATmega168 or ATmega328 used in Arduino). The code in this example is based on the mega-isp firmware by Randall Bohn. Instructions To use your Arduino board to burn a bootloader onto an AVR, you need to follow a few simple steps. Open the ArduinoISP firmware (in Examples) to your Arduino board. Circuit (targeting Arduino Uno, Duemilanove, or Diecimila) An Arduino board serving as an ISP to program the ATmega on another Arduino board. Circuit (targeting Arduino NG or older) On NG or older boards, connect the reset wire to pin 1 of the Atmega chip on the board, as shown above. Circuit (targeting an AVR on a breadboard) See the Arduino to Breadboard tutorial for details.

playground - Gyro This is just a basic code snippet for the time being, but please feel free to contribute more information Gyroscopes measure the rate of change of a particular axis at the current moment in time. This means that to keep track of our angle, we need to sum all of the rates of change over a given period of time. We're essentially looking for the integral of our gyro data. First off, you'll want to set the voltage of your gyro (typically 3.3v or 5v) for the gyroVoltage variable. Next you'll need to know the zero voltage of your gyro. The other value you'll need from the datasheet is the sensitivity. The Arduino has 10 bit ADC which can represent a voltage (0-5V) in values from 0 to 1023. /* Keep track of gyro angle over time * Connect Gyro to Analog Pin 0 * * Sketch by eric barch / * v. 0.1 - simple serial output * */ float currentAngle = 0; //Keep track of our current angle void setup() { Serial.begin (9600);} //DEBUG Serial.println(currentAngle); delay(10);}

HomePage Arduino Button Tutorial - 3 The Button This is a momentary switch, with one stable position (open) when no force is exerted, and conducting (closed) when pressed. It is one of the simplest electro-mechanical sensing device. Connect the button like illustrated in the photo of this step. (Don't be impressed by the size of my breadboard. A small one will be actually handier.) The I/O Pin The AVR (aka ATmega, i.e. the Atmel chip powering the Arduino board) has several I/O pins. Pin 2 will be a good choice for our example. Pull-up Resistor The pin has to be connected to somewhere via the button. A first idea would be to go to VCC. So the solution is to use a so-called pull-up or pull-down resistor. Fortunately, the AVR chip has, internally, a 20 kOhm pull-up resistor that can be connected to the pin (internally). With this pull-up, we'll connect the pin to GND through the button, and have these situations when the button is released, respectively pressed: Input is now directly connected to GND. Consumption Polarity Programming