AVR Studio – Blink Led code example (Pro mini)

This is example for Advanced users to use AVR Studio for Programming Arduino Pro mini Board

// By Roee Bloch
//All right Reserved
// Copyright (c) 2015 All Right Reserved, http://www.electronics-freak.com
//
// This source is subject to the Roee Bloch License.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Roee Bloch</author>
// <email>roeebloch@walla.co.il</email>
// <date>June 2015</date>
#ifndef F_CPU
#define F_CPU 16000000UL // 16 MHz clock speed
#endif
#include <avr/io.h>
#include <util/delay.h>

 

int main(void)
{
	char x=0;
	DDRB = 0xFF; //Makes PORTC as Output
	while(1)
	{		
	
	for (int i=0;i<5;i++)
	{
		PORTB = 0xFF; //All port B output it 1
				if (x==0)
				{
				 _delay_ms(1000); //1 second delay
				}
				else
				{		
					_delay_ms(100); //0.1 second delay
				}
		
		PORTB= 0x00; //All port B output it 0
				if (x==0)
				{
					_delay_ms(1000); //1 second delay
				}
				else
				{
					
				_delay_ms(100); //0.1 second delay	
				}
	}
	
 x=~x; // changing value from 0 to 255 and vice versa

	
} // of while
}

 

[adsenseyu6]

link to Pro Mini Board