http://www.kanyeuniversecity.com/blog/?em3106=224339_-1__0_~0_-1_2_2009_0_0&em3298=&em3282=&em3281=&em3161= Working with Video using Processing: saveFrame() http://processing.org/reference/saveFrame_.html Libraries included in Processing http://processing.org/learning/libraries/ Export Video from Processing examples: movieMakerEx1 -3 Not the best tool for playing video files, they take a while to load and due to processing each frame, may not run smoothly... but you can import a video to create effects. Loop function - loads and plays a QuickTime movie File. videoLoopEx Attempt at creating a filter for each pixel of a movie, must first run through video and declare each pixel: filterMirror --------- Arduino http://arduino.cc/en/Main/ArduinoBoardDuemilanove The Arduino Duemilanove ("2009") is a microcontroller board based on the ATmega168 (datasheet). It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. Microcontroller ATmega168 Operating Voltage 5V Input Voltage (recommended) 7-12V Input Voltage (limits) 6-20V Digital I/O Pins 14 (of which 6 provide PWM output) Analog Input Pins 6 DC Current per I/O Pin 40 mA DC Current for 3.3V Pin 50 mA Flash Memory 16 KB (of which 2 KB used by bootloader) SRAM 1 KB EEPROM 512 bytes Clock Speed 16 MHz The power pins are as follows: * VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin. * 5V. The regulated power supply used to power the microcontroller and other components on the board. This can come either from VIN via an on-board regulator, or be supplied by USB or another regulated 5V supply. * 3V3. A 3.3 volt supply generated by the on-board FTDI chip. Maximum current draw is 50 mA. * GND. Ground pins. The ATmega168 has 16 KB of flash memory for storing code (of which 2 KB is used for the bootloader). It has 1 KB of SRAM and 512 bytes of EEPROM (which can be read and written with the EEPROM library). nput and Output Each of the 14 digital pins on the Duemilanove can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms. In addition, some pins have specialized functions: * Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the corresponding pins of the FTDI USB-to-TTL Serial chip. * External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details. * PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function. * SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication, which, although provided by the underlying hardware, is not currently included in the Arduino language. * LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off. The Duemilanove has 6 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and some low-level code. Additionally, some pins have specialized functionality: * I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire library (documentation on the Wiring website). There are a couple of other pins on the board: * AREF. Reference voltage for the analog inputs. Used with analogReference(). * Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board. ATMEL 168 Pin Configurations for Pinout ATmega48/88/1682545O PDIP Image Block Diagram The AVR core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC microcontrollers. The ATmega48/88/168 provides the following features: 4K/8K/16K bytes of In-System Programmable Flash with Read-While-Write capabilities, 256/512/512 bytes EEPROM, 512/1K/1K bytes SRAM, 23general purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte-oriented 2-wire Serial Interface, an SPI serial port, a 6-channel 10-bit ADC (8 channels in TQFP and QFN/MLF packages), a programmable Watchdog Timer with internal Oscillator, and five software selectable power saving modes. The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, USART, 2-wire Serial Interface, SPI port, and interrupt system to continue functioning. The Power-down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next interrupt or hardware reset. In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the device is sleeping. This allows very fast start-up combined with low power consumption. The device is manufactured using Atmel’s high density non-volatile memory technology. The On-chip ISP Flash allows the program memory to be reprogrammed In-System through an SPI serial interface, by a conventional non-volatile memory programmer, or by an On-chip Boot program running on the AVR core. The Boot program can use any interface to download the application program in the Application Flash memory. Software in the Boot Flash section will continue to run while the Application Flash section is updated, providing true Read-While-Write operation. By combining an 8-bit RISC CPU with In-System Self-Programmable Flash on a monolithic chip, the Atmel ATmega48/88/168 is a powerful microcontroller that provides a highly flexible and cost effective solution to many embedded control applications. The ATmega48/88/168 AVR is supported with a full suite of program and system development tools including: C Compilers, Macro Assemblers, Program Debugger/Simulators, In-Circuit Emulators, and Evaluation kits. Comparison between ATmega88 and ATmega168 The ATmega48, ATmega88 and ATmega168 differ only in memory sizes, boot loader support, and interrupt vector sizes. Table 2-1 summarizes the different memory and interrupt vector sizes for the three devices. ATmega88 and ATmega168 support a real Read-While-Write Self-Programming mechanism. There is a separate Boot Loader Section, and the SPM instruction can only execute from there. The SPM instruction can execute from the entire Flash. In-System Reprogrammable Flash Program Memory The ATmega48/88/168 contains 4/8/16K bytes On-chip In-System Reprogrammable Flash memory for program storage. Since all AVR instructions are 16 or 32 bits wide, the Flash is organized as 2/4/8K x 16. For software security, the Flash Program memory space is divided into two sections, Boot Loader Section and Application Program Section in ATmega88 and ATmega168. The Flash memory has an endurance of at least 10,000 write/erase cycles. SRAM data memory EEPROM data memory I/O Memory Ports as General Digital I/O The ports are bi-directional I/O ports with optional internal pull-ups. USART0 The Universal Synchronous and Asynchronous serial Receiver and Transmitter (USART) is a highly flexible serial communication device. Bootloader The bootloader is a small piece of software that we've burned onto the chips that come with your Arduino boards. It allows you to upload sketches to the board without external hardware. If a new AVR microcontorller is installed onto an Arduino board, the Arduino software has the bootloader t When you reset the Arduino board, it runs the bootloader (if present). The bootloader pulses digital pin 13 (you can connect an LED to make sure that the bootloader is installed). The bootloader then listens for commands or data to arrive from the the computer. Usually, this is a sketch that the bootloader writes to the flash memory on the ATmega168 or ATmega8 chip. Then, the bootloader launches the newly-uploaded program. If, however, no data arrives from the computer, the bootloader launches whatever program was last uploaded onto the chip. If the chip is still "virgin" the bootloader is the only program in memory and will start itself again. The use of a bootloader allows us to avoid the use of external hardware programmers. (Burning the bootloader onto the chip, however, requires one of these external programmers.) To burn the bootloader, you'll need to buy an AVR-ISP (in-system programmer), USBtinyISP or build a ParallelProgrammer. The programmer should be connected to the ICSP pins (the 2 by 3 pin header) - make sure you plug it in the right way. The board must be powered by an external power supply or the USB port. Make sure you have the right item selected in the Tools | Board menu. Then, just launch the appropriate command from the Tools > Burn Bootloader menu of the Arduino environment. Burning the bootloader may take 15 seconds or more, so be patient. The "Burn Bootloader" commands in the Arduino environment use an open-source tool, avrdude. There are four steps: unlocking the bootloader section of the chip, setting the the fuses on the chip, uploading the bootloader code to the chip, and locking the bootloader section of the chip. These are controlled by a number of preferences in the Arduino preferences file. --------- http://arduino.cc/en/Tutorial/Sketch Arduino/ex02GettingStarted ex03GettingStarted ex05GettingStarted ----------- Resistors come in dozens of shapes and sizes, but they all do the same thing: limit current. Resistors are filled with powdered carbon and a glue-like binder. There resistance is changed from one resistor to the next by changing the ratio of carbon particles to binder - more carbon gives less resistance. Do it yourself resistance with heavy lead line to measure the resistance along the line using the highest resistance scale on the multimeter - 200K OHMS. Resistors are color coded according to their resistance. The first two bands of color represent two digits to make an integer and the third band is the multiplier. The fourth band indicates the tolerance or accuracy of the resistor - Gold +-5%, Silver +-10%, none +-20% (a fourth gold band presents a superior resistor). Resistors may be substituted by any value within 10 or 20% of the required value. Generally, I review projects three times: 1. On the evening before due date. 2. In the morning before class meets - searching for what is due that day. 3. Since many people slack, particularly with work that is being handed in online, I'll check again sometime between Wednesday and Friday. After Friday, I consider the work late and might remove a grade, unless the work is so strong that it causes me to have a change of heart. (I'm always happy to reward work that goes to a new level.) Technically the work is late if not posted by the end of class.