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. DueMotorShieldDC - Aurora. 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. Most of the wares sold for less than $20 that claim to be Arduinos are in fact knockoffs whose sellers are predominantly based in the far east.
That's not to say that they don't produce quality wares, etc. but with those prices it's unlikely that they're contributing to the Arduino open source efforts the way that the official Arduino suppliers/resellers do. My Mega2560 is marked "WWW.ARGUINO.CC" and "DESIGN IN ITALY". Cheers and best of luck with your project. --- Edited to acknowledge that Digilent publishes its Eagle files ---- DueMotorShieldDC - Aurora. 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). Some of them are also equipped with a pushbutton when you press on the axis (like the ones used for navigation on many music controllers).
They come in all kinds of resolutions, from maybe 16 to at least 1024 steps per revolution, and cost from 2 to maybe 200 EUR. 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: Interrupt Example Below is some code that uses an interrupt. Stepper motor, doesn't turn counter clockwise, wrong steps number indication - Arduino Forum - Aurora.