Monday, November 18, 2013

AVR REGISTER ANDROID APP


Instead of being a micro-controller freak I always was afraid of remembering the names of the registers used in the micro-controllers and remembering the bits in them was even more difficult for me. So I decided to come up with a handy android app which can help me with this problem and here is the link to AVR Register, an app on android platform. AVR Register is based on ATMEL's MEGA series of controllers. It's a very handy app to help you out when you need to remind which bit of which register is used to do what. Every bit has been explained in a very brief manner. Below are some of the screenshot for the app.







Monday, February 18, 2013

AVR Control Android App



If you want to learn AVR controller and you are an android user but you don't want to go through those hectic books available in market, then you can do it smartly................with your android device. The app discusses the functionality of AVR controller in an interactive manner and explains it using few basic codes in C language.



You just need to go to Google Play and download AVR Control app on your android device

Monday, February 11, 2013

Android ADT Bundle



The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android.

For rookies, who have not started working on Android yet and wants to try their hands at it, ADT bundle is a tool for quickly starting to develop android applications. With this you don't need to go through the hectic process of installing plugins for Eclipse separately.  The Android SDK includes the essential Android SDK components and a version of the Eclipse IDE with built-in ADT (Android Developer Tools) to streamline your Android app development.


With a single download, the ADT Bundle includes everything you need to begin developing apps:
  • Eclipse + ADT plugin
  • Android SDK Tools
  • Android Platform-tools
  • The latest Android platform
  • The latest Android system image for the emulator

Sunday, February 3, 2013

Switch and LEDs

In this tutorial I am going to show you, how to blink a LED whenever a switch is pressed using AVR micro controller. I am using ATmega128/ ATmega64 (both of the micro controller can be used interchangeably as they differ in the size of flash memory only). The LED is connected to pin 0 of PORTC (PC0) and the switch is connected to the pin 0 of PORTA (PA0) of the micro controller. I have assumed that the LED is connected in sinking logic i.e. whenever +5V is provided by the controller the LED will be OFF and whenever the 0V is supplied the LED will be ON and the switch is ACTIVE LOW i.e. it provides a 0V on being pressed.

The step to program are as follow-

1. Set the corresponding PORTs as input or output.
2. Enable pull-up resistors for the input pin.
3. Check for the input continously.
4. Whenever the switch is pressed, turn on the LED.

Here is the code:

//Include AVR Header file
#include"avr/io.h"

void main()
{ 
//Set pin 0 of PORTC as output
DDRC |= (1<<0);

//Set pin 0 of PORTA as input
DDRA &=~ (1<<0);

//Enable pull-up resistor so that false inputs can be ignored
PORTA |= (1<<0);

  //infinite loop
while(1)
{
//Check for any input if an input (0v) is detected, turn ON the LED
if( !(PINA & (1<<0)))
PORTC &=~ (1<<0);

else //turn OFF the LED
PORTC |= (1<<0);
}
}
In place of LED you can connect different output devices such as Buzzer, Relays etc.

Wednesday, December 19, 2012

AVRDUDE GUI

avrdude-gui is a simple GUI for avrdude (http://savannah.nongnu.org/projects/avrdude) which is a command line tool running on several OS to program the Atmel AVR Microcontrollers.

Click here to download it

Friday, April 27, 2012

How to edit System Path Variables

PATH is an environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located. In general, each executing process or user session has its own PATH setting.

Many programs do not appear in the path as they are not designed to be executed from a command window, but rather from a Graphical User Interface.

Set the PATH environment variable if you want to be able to conveniently run the executable from any directory without having to type the full path of the command. If you do not set the PATH variable, you need to specify the full path to the executable every time you run it. So if you want to change the system path for your applications follow the steps.

NOTE: The PATH environment variable is a series of directories separated by semicolons (;)

How to edit System PATH Variables: 

Windows 7:
  1. From the desktop, right click the Computer icon.
  2. Choose Properties from the context menu.
  3. Click the Advanced system settings link in the upper-left corner.
  4. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit.
  5. In the Edit System Variable window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK. 

Windows XP:
  1. Select Start, select Control Panel. double click System, and select the Advanced tab.
  2. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit
  3. In the Edit System Variable window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
Windows Vista:
  1. From the desktop, right click the My Computer icon.
  2. Choose Properties from the context menu.
  3. Click the Advanced tab (Advanced system settings link in Vista).
  4. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit.
  5. In the Edit System Variable window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
IMPORTANT: Never forget to put a semicolon at the end, whenever you are changing the value of PATH varibles.

How to configure Code::Blocks for OpenCV 2.3

So many of us always face problems in configuring OpenCV with Code::Blocks, I am also not an exception. I faced a lot of problems in configuring Code::Blocks for OpenCV 2.3. So here is the way how I sorted out this problem.






Requirements:
  1. Code::Blocks with Mingw compiler.
Download the latest release of the Code::Blocks from it's official website.
or
Click the link below to download Code::Block (version 10.05) with MingW compiler from
     
     2. OpenCV (I am using OpenCV 2.3.0), if you don't have it you can get it by clicking the link below
or 
you can select the latest version of the OpenCV on the  
     3. CMake file for creating the binaries for OpenCV, which can be downloaded here


Steps to configure Code::Blocks for OpenCV 2.3.0: 

1. Install the Code::Blocks with Mingw compiler. It will install the required C compiler, C++ compiler and mingw32-make in "C:\Program Files\CodeBlocks\Mingw\bin".

2. Add "C:\Program Files\CodeBlocks\Mingw\bin"in the system path. Check this LINK to see how to edit system path.

3. Install Cmake 2.8. It may ask to add the Cmake to system path variable. If so, select "Do not add to system path variable".

4. Extract "OpenCV-2.3.0-win-src" to "C:\". This will create a new folder "C:\OpenCV-2.3.0".

5. Run Cmake (cmake-gui).

6. Set the Source Code to "C:\OpenCV-2.3.0".

7. Set where to built the binaries. For eg: "C:\OpenCV".

 

8. Press Configure.

9. Let Cmake create the new folder.

10. Specify the Generator: MinGW Makefiles.

11. Select "Specify native compiler"  and click Next.

12. For C set: "C:/Program Files/CodeBlocks/MinGW/bin/gcc.exe".

13. For C++ set: "C:/Program Files/CodeBlocks/MinGW/bin/g++.exe".

14. Click Finish. There should not be any errors and the screen should look like this



15. In the configuration screen type in "RELEASE" (or "DEBUG" if you want to build a debug version) for "CMAKE_BUILD_TYPE". Select BUILD_EXAMPLES if you want.

16. Click Configure again then click Generate cnd close Cmake.

17. Go to the command prompt and inside the folder "C:\OpenCV" type "mingw32-make" and hit enter (takes about 5 to 10 minutes).

18. Then type "mingw32-make install" and hit Enter.

19. After the installation is completed close the command prompt and copy the include  folder from "C:\OpenCV\install"  directory into "C:\OpenCV" folder and let it replace the previously existing include folder in the directory.

20. Open Code::Blocks and now click on the Settings menu on the menu bar and goto "Compiler and Debugger" settings.

21. Click on the "Linker" tab and "Add" all the files from the folder "C:\OpenCV\lib".

 

22. Click on the "Search Directory" tab and under "compiler" tab "Add" the path "C:\OpenCV\include" and "C:\OpenCV\include\opencv"

 

23. Now click on the "linker" and "Add" the path "C:\OpenCV\lib" and hit "OK".



24. Create a new Project. Check "How to create a new project in Code::Blocks".

25. Try to run the following code. This code will load an image of the name "Paris.jpg" onto the screen. You can change the name "Paris.jpg" with your own image name. (Don't forget to putthat image into your project folder).
////////////////////////////////////////////////////////////////////////

#include "stdlib.h"
#include "stdio.h"
#include "math.h"
#include "cv.h"
#include "highgui.h"


int main(int argc, char *argv[])
{
// declare a new IplImage pointer
IplImage* myimage;

// load an image
myimage = cvLoadImage("Paris.jpg",1); //change the file name with your own image

//create a new window & display the image
cvNamedWindow("Smile", CV_WINDOW_AUTOSIZE);
//cvMoveWindow("Smile", 100, 100);
cvShowImage("Smile", myimage);

//wait for key to close the window
cvWaitKey(0);
cvDestroyWindow( "Smile" );
cvReleaseImage( &myimage );
return 0;
}

////////////////////////////////////////////////////////////////////////////

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews