Posts

Showing posts from March, 2013

Android code sending command to Arduino Due to turn LED On/Off

Image
It's the coding in Android side to send command to Arduino Due to control LED On/Off. Modify AndroidManifest.xml to add <uses-feature> of "android.hardware.usb.accessory", <intent-filter> of "android.hardware.usb.action.USB_ACCESSORY_ATTACHED", and <meta-data> of resource="@xml/myfilter". <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.androidadkled" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="12" android:targetSdkVersion="17" /> <uses-feature android:name="android.hardware.usb.accessory"/> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name"

Atmel Software Framework (ASF)

Image
The Atmel® Software Framework (ASF) is a MCU software library providing a large collection of embedded software for Atmel flash MCUs: megaAVR, AVR XMEGA, AVR UC3 and SAM devices, include the SAM3X used on Arduino Due . It simplifies the usage of microcontrollers, providing an abstraction to the hardware and high-value middlewares ASF is designed to be used for evaluation, prototyping, design and production phases ASF is integrated in the Atmel Studio IDE with a graphical user interface or available as standalone for GCC, IAR compilers ASF can be downloaded for free Link: Atmel Software Framework ASF documentation Get Started

Read analog input of Arduino Due board

Image
The Arduino Due Board has 12 analog inputs (pins from A0 to A11), each of which can provide 12 bits of resolution (i.e. 4096 different values). By default, the resolution of the readings is set at 10 bits, for compatibility with other Arduino boards. It is possible to change the resolution of the ADC with analogReadResolution(). The Due’s analog inputs pins measure from ground to a maximum value of 3.3V. Applying more then 3.3V on the Due’s pins will damage the SAM3X chip. The analogReference() function is ignored on the Due. Analog input pins on Arduino Due Board Example to read from Analog Input: int analogInputA0 = A0; int varA0; void setup() { Serial.begin(9600); analogReadResolution(12); //set ADC resolution to 12 bits } void loop() { varA0 = analogRead(analogInputA0); //read ADC input Serial.println(varA0, HEX); //print as HEX delay(1000); } Read Analog Input on Arduino Due If the code compiled with error: 'analogReadResolution' was not declared in t

Firmata: a generic communicating protocol between microcontrollers and host computer

Image
Firmata is a generic protocol for communicating with microcontrollers from software on a host computer. It is intended to work with any host computer software package. Right now there is a matching object in a number of languages. It is easy to add objects for other software to use this protocol. Basically, this firmware establishes a protocol for talking to the Arduino from the host software. The aim is to allow people to completely control the Arduino from software on the host computer. Firmata Remark: Currently Firmata library not included in Arduino IDE 1.5.1 yet ... Link: firmata.org Arduino Playground for Firmate

Control Arduino LED using Python with GUI

Image
This example demonstrate how to control Arduino LED using Python with GUI, using tkinter library. #tkinter for Python 3.x #Tkinter for Python 2.x import serial import time import tkinter def quit(): global tkTop tkTop.destroy() def setCheckButtonText(): if varCheckButton.get(): varLabel.set("LED ON") ser.write(bytes('H', 'UTF-8')) else: varLabel.set("LED OFF") ser.write(bytes('L', 'UTF-8')) ser = serial.Serial('/dev/ttyACM1', 9600) print("Reset Arduino") time.sleep(3) ser.write(bytes('L', 'UTF-8')) tkTop = tkinter.Tk() tkTop.geometry('300x200') varLabel = tkinter.StringVar() tkLabel = tkinter.Label(textvariable=varLabel) tkLabel.pack() varCheckButton = tkinter.IntVar() tkCheckButton = tkinter.Checkbutton( tkTop, text="Control Arduino LED", variable=varCheckButton, command=setCheckButtonText) tkCheckButton.pack(anchor=tki

Communicate with Arduino in Python programmatically

Image
The previous post demonstrate " Talk with Arduino Due in Python Shell ". It will be implement programmatically in module. note: After open the port, the Arduino will reset. So I insert delay for 3 seconds after serial.Serial('/dev/ttyACM1', 9600). In my board, 115200 seem not too stable. I modify the baud rate to 9600. Python code: import serial import time # assign your port and speed ser = serial.Serial('/dev/ttyACM1', 9600) print("Reset Arduino") time.sleep(3) ser.write(bytes('L', 'UTF-8')) print('Enter 1 to Turn Arduino LED ON') print('Enter 0 to Turn Arduino LED OFF') print('Enter Q/q to quit:') char_in = '' print(char_in) while char_in not in ['Q', 'q']: char_in = input() if char_in == '0': print("LED OFF") ser.write(bytes('L', 'UTF-8')) if char_in == '1': print("LED ON") ser.write(bytes

serial.serialutil.SerialException: could not open port /dev/ttyACM0

Image
If you try the steps in the post " Talk with Arduino Due in Python Shell " in Linux (Ubuntu in my setup). May be you will be complained with the error of: serial.serialutil.SerialException: could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0' Because your user account have no right to access the /dev/ttyACM0 port. You have to add your user account to the dialout group. Enter the command in Terminal: $ sudo usermod -a -G dialout <username> After you plug in the usb cable, run the command (it need to be run every time plug-in): $ sudo chmod a+rw /dev/ttyACM0 serial.serialutil.SerialException

How to Back-up Your Template, Restore and Upload New Templates using the New Blogger Interface

Image
          If you want to edit your blogger/blogspot template than first make sure to download your blogger template.  Why backup required? If you edited your blogger template and any problem occurs and if your edit not suit on your blog and now you want to revert your template back. In this condition you can restore it by simply uploading your template. In this post I'll explain how to back-up your template, restore and upload new templates using the new Blogger interface. How? I explain below. In Blogger to make backup and restore a template very easy. You see in this article how easy it is! How to Backup your Blogger Template: Login in to your blogger account. Now go to your blogger dashboard. Now click on �Template� tab  shown in left menu bar of your blogger dashboard. Now you are on template menu here you can customize your blog via html or manually click on the �Backup/Restore� button shown at the top right corner. Now a popup window open and you have two options Download ful

Learn Raspberry Pi with Linux (Learn Apress)

Image
Learn Raspberry Pi with Linux (Learn Apress) Learn Raspberry Pi with Linux  will tell you everything you need to know about the Raspberry Pi's GUI and command line so you can get started doing amazing things. You'll learn how to set up your new Raspberry Pi with a monitor, keyboard and mouse, and you'll discover that what may look unfamiliar in Linux is really very familiar. You'll find out how to connect to the internet, change your desktop settings, and you'll get a tour of installed applications. Next, you'll take your first steps toward being a Raspberry Pi expert by learning how to get around at the Linux command line. You'll learn about different shells, including the bash shell, and commands that will make you a true power user. Finally, you'll learn how to create your first Raspberry Pi projects: Making a Pi web server: run LAMP on your own network  Making your Pi wireless: remove all the cables and retain all the functionality   Making a Raspber

Arduino Adventures: Escape from Gemini Station

Image
Arduino Adventures: Escape from Gemini Station Arduino Adventures: Escape from Gemini Station  provides a fun introduction to the Arduino microcontroller by putting you (the reader) into the action of a science fiction adventure story.  You'll find yourself following along as Cade and Elle explore Gemini Station—an orbiting museum dedicated to preserving and sharing technology throughout the centuries. Trouble ensues. The station is evacuated, including Cade and Elle's class that was visiting the station on a field trip. Cade and Elle don’t make it aboard their shuttle and are trapped on the station along with a friendly artificial intelligence named Andrew who wants to help them get off the damaged station. Using some old hardware, a laptop, and some toolboxes full of electronics parts, you will follow along and build eight gizmos with Cade and Elle that will help them escape from Gemini Station. The hardware is Arduino. Each new challenge opens a new area of Arduino and basic

Talk with Arduino Due in Python Shell

Image
With pySerial installed, it's easy to communicate with Arduino board in Python Shell. Connect Arduino Due with sketch of former post downloaded. For Python 2.x, enter the commands in Python Shell to turn ON/OFF LED on Arduino Due Board >>> import serial >>> ser = serial.Serial('/dev/ttyACM0', 115200) >>> ser.write('H') >>> ser.write('L') For Python 3.x, the String in write() have to be casted to bytes. >>> import serial >>> ser = serial.Serial('/dev/ttyACM0', 115200) >>> ser.write(bytes('H', 'UTF-8')) >>> ser.write(bytes('L', 'UTF-8')) Related: serial.serialutil.SerialException: could not open port /dev/ttyACM0 Communicate with Arduino in Python programmatically

Install pySerial on Ubuntu

Image
To check if pySerial installed, open Python Shell, type the command: >>> import serial if error message returned, means pySerial not installed. pySerial not installed with error - To install pySerial on Ubuntu, download and unpack  pyserial , open Terminal and change to the unpacked folder. - To install for Python 2.x, type the command: $ sudo python setup.py install - To install for Python 3.x, type the command: $ sudo python3 setup.py install (To install the module for all users on the system, administrator rights (root) is required, run with sudo.) import serial with pySerial installed

Read byte from Serial port and set pin

Image
This code run on Arduino Due, read byte from Serial port, and set LED pin HIGH/LOW according. int led = 13; int incomingByte = 0; void setup() { pinMode(led, OUTPUT); //Setup Serial Port with baud rate of 115200 Serial.begin(115200); Serial.println("Press H to turn LED ON"); Serial.println("Press L to turn LED OFF"); } void loop() { if (Serial.available() > 0) { // read the incoming byte: incomingByte = Serial.read(); if(incomingByte == 'H'){ digitalWrite(led, HIGH); Serial.println("LED ON"); }else if(incomingByte == 'L'){ digitalWrite(led, LOW); Serial.println("LED OFF"); }else{ Serial.println("invalid!"); } } }

How to Submit Your Blog or Website to Alexa Step by Step with Pictures

Image
You must submit your blog or website to alexa. Alexa give ranks to new domain itself but for more improvement into your Alexa rank, you can submit your website and claim your ownership at alexa for more advantage. Here I describe how you can submit your website to alexa. Why Submit a Blog or Website to Alexa? Alexa is best website ranking service. It�s the parameter for website the how it popular. So it�s always beneficial for your blog to submit on Alexa. And one more thing all the advertisers use Alexa Rank and find contact details. So today I write a guide post for beginners that how to submit you your blog /website to Alexa. Check your rank at- http://www.alexa.com/siteinfo HOW TO SUBMIT YOUR BLOG OR WEBSITE TO ALEXA? Step 1. Create account on Alexa If you are looking to add your Blog to Alexa than first you need an account on Alexa. To add your Blog on  Alexa, first you require  to certify your Blog on Alexa. 1.First Visit Alexa.com and create an account. You can create a account

What is A Meta Tag and How to add Meta tags in Blogger

Image
          You read the word Meta tag many times on web and also try it to Google but you don�t found any satisfied answer. Today I write on Meta tags and how the Meta tag works, and also how you add Meta tags in your blogger blog. I am sure that you will find your answer in it. By adding Meta tags on your site you can get more traffic. If anyone visits your site they don�t shown. Meta tags are shown only on Search engines. Meta tags especially the Meta description is the most important that will help in SEO. Here I am going to discuss about some Meta Tags we use. There are many Meta tags are used in html like description meta tag, title meta tag, keyword meta tag, author meta tag, robots meta tag. But we mostly use three important Meta tag. Keyword, description, author. Keywords- Meta Tag Keyword Meta tag is most powerful Meta tag, it will also help in SEO. It provides the main keywords of your blog to Search engines. This is the most useful Meta Tag for SEO. Meta Tag is like this: <

What is Static Page and How to Create Static Pages in Blogger?

Image
          Static Pages are the pages on there you create some special pages like About Me, Contact page, Privacy Policy etc. on static pages not post shows from your regular posts. Major difference between a static page or a post page is that your statics pages don�t shown on your home pages like post pages or A Static page do not have any level. Else other things are same as post page. How to Create A Static Page in Blogger? Step 1. Log in to your blogger account. Step 2. Now go to your blog dashboard. Step 3.  You are on your blog dashboard. Now Click on Pages which are shown in left. Step 4.  Now two options appear. Choose Blank Page to create static page. Note:  you can also link a label, post or another web address for page but these not work as static page.  Step 5.  Now type the title for your static page and write the page's content. Note:   you can also edit in html simply click on html button to edit it in html. You can also choose the comment option for allowing reader c

Start With Blogger And Create A Blog on New Blogger Interface in 6 Steps With Pictures

Image
          So you choose start blogging with blogger. You know Blogger is a Google product and Google host it free. Blogger provide you do a free domain name. If you are our new visitor then you must know why blogger is better than Wordpress.  Recommended read - Blogger vs. Wordpress. Why blogger is better and recommended for you?           Now a day�s blogging is becomes so easy. Thousands of people use blogs everyday for updating about their life, giving own advice, discussing own views, or relating experience in a topic of interest. But mostly people are fail. Why? Because did not give more importance to setup the platform carefully.           Becoming a professional blogger is not so easy and it not happens over a night. But, if has started well and focus on your blog than it�s not so hard. You will easily draw your successful blogging career. You need only work hard on it. So you are you ready to start blogging with blogger? To start with blogger first you need your platform for wo

Arduino GSM Shield

Image
Arduino GSM Shield - Trailer The Arduino GSM Shield allows an Arduino board to connect to the internet, make/receive voice calls and send/receive SMS messages. Continue on: http://arduino.cc/blog/2013/03/11/dive-into-the-new-arduino-gsm-shield/

FREE download: Raspberry Pi Educational Manual

Image
A Creative Commons licensed teaching manual for the Raspberry Pi, made by a team of UK teachers from Computing at School (CAS), with recognition and encouragement from the Raspberry Pi Foundation is now available at the Pi Store (which you’ll find on your Raspberry Pi’s desktop). If you’re not a Pi owner, you can download here . Raspberry Pi Educational Manual Details: http://www.raspberrypi.org/archives/2965

Blogger vs. Wordpress. Why blogger is better and recommended for you?

Image
                  There are many platforms are available to create a blog. But at here we consider here only top two popular platforms Blogger and Wordpress. If you are new in blogging field and want to choose one from them. You are confused that which blogging service is better? We always recommended for Blogger. Why? I answered it below?           Running a blog is so enjoyable, but if you are new in this field and want to start blogging to determine certain things for yourself from a professional perspective. If you are at just start, it is always suggested to use Blogger. If you know all the functions of Wordpress than you can choose Wordpress. To get a better choice for you, consider a constructive view of blogger or Wordpress each. First, what Blogger offers and all about its features. About Blogger           Blogger is Google�s free tool for creating weblog or blog. You can create your blog  via blogger at  http://www.blogger.com . Blogger is owned and operated by Google, is eas

How to Send Free SMS From Gmail Chat Daily 50 free message

Image
                     Almost after a year the service was introduced in the USA and many other  european  countries, the service has now also available for Asian users.            Free SMS service from Gmail is a very useful service. If you are using a prepaid mobile connection, and no balance in your account. You can send texts message to your friends for free. And in case of some amount in account also, because you are Gmail user  so use this service, you can use it just log in to your Gmail account, and easily type and send a message to any of your friend and in condition of your friend it not listed in your contact you can easily add them. I use this service because of  I hate to type a long text via mobile keypad.           You can send a text message to most mobile operators across the country from your computer pc, laptop, table etc. Send SMS text messages right from Gmail. The free SMS service right from your Gmail chat window. You chat from your computer and reach your friends