Nov 22, 2010 2
Oct 7, 2010 1
Forrest Assignment 1
Flash visualizes N900 accelerometer data, floats target on gradient, sends color values to fade three Arduino LEDs. Source.
Apr 15, 2009 Comments Off on PWM by AVR-GCC
PWM by AVR-GCC
Arduino NG supports PWM with three pins – 9, 10 and 11. Those pins are assigned to Atmega8 PB1(OC1A), PB2(SS/OC1B) and PB3(MOSI/OC2) pings
PB1 (OC1A) – Arduino Pin 9
PB2(OC1B) – Arduion Pin 10
PB3(MOSI/OC2) – Arduion Pin 11
Apr 13, 2009 1
Control LED by pressing button (using interrupts function in AVR)
Interrupts are interruptions from the main program flow triggered by some event. Interrupts are not supported by BASIC Stamp but Arduino can support it by including a library. AVR MacPack (AVR-GCC) also can support it by including <avr/interrupt.h>. Interrupts is very useful function because you don’t have to listen to the external event all the time in your code. If you assign the external event as interrupts, AVR jumps to particular function when the event happens and returns to current location of the code.
Apr 13, 2009 Comments Off on Control LED by pressing button (digital input functions in AVR)
Control LED by pressing button (digital input functions in AVR)
This post describes how to program Atmega8 on Arduino board using AVR-GCC. The program enable user to control a LED by pressing a button.
Components
- Arduino x 1
- USB cable x 1
- LED x 1
- Button x 1
- Resistor (10KR) x 1
Apr 11, 2009 1
Bit operations with AVR-GCC
Bit operations are used when interfacing with digital out such as switching pins On/Off. Programming with bit operations enable following functions to control digital out.
- Switching pins on (for example, turning on LED)
- Switching pins off (for example, turning off LED)
- Toggling pins (for example, Turning of LED if it is on and vice versa)
Apr 11, 2009 Comments Off on Atmel Atmega8 (Arduino NG) Digital I/O pin register
Atmel Atmega8 (Arduino NG) Digital I/O pin register
Digital and analog pins are controlled by accessing bits. Arduino NG Diecimila has Atmel Atmega8 on board and Atmega8 has two digital ports and one analog (digital to analog converter) port. This post describes Pin assign between Arduion and Atmega8. It also describes location of bits assigned to specific ports.
Apr 9, 2009 Comments Off on Blinking LED on Arduino NG with AVR MacPack first time
Blinking LED on Arduino NG with AVR MacPack first time
As Arduino has Atmel chip on board, you can also program code with C on your Mac. Softwares for the developing environment are all free. Programming with C looks more complicated but still all logic are the same as Arduion IDE and you can even create more functions with C. Once you have managesd to run your C language code on Arduio, you can also flash the code to other smaller or more powerful Atmel chips. This post describes how I as Mac user managed to write a code to blink LED on Arduion board.