PDF Print E-mail
 

Lessons from BOB : PART ONE

 DRAWING THE FACE

 

avb_profile.png

Remember BOB from one of our projects? Well, it got so popular we had to make up tutorials on how we did it. It’s pretty easy with all the libraries we wrote to get it up. 

 

Items used in this tutorial:

  • FlamingICE80
  • GLCD + RTC Combo Module
  • FICE SD Card
  • Singular IO Adapter
  • FI Comm.Key
  • 6V Power Supply
  • A couple of pluggable female to female connectors
  • 3 Servo Motors
  • Avril Le Bob Robotic Base

 

HARDWARE CONFIGURATION

 

 AVRIL LE BOB_small.png

 click for enlarged image

 

THE GRAPHIC LCD (GLCD)

 Before using the GLCD, it must be initialised and we recommend making the whole screen white. The following code does just that.

 

CODE:

 

OS.GLCD.Init()

OS.GLCD.Fill(255)

 


 

Images can now be drawn onto the GLCD.  To simplify the process of getting the project up, we shall make use of the images that are already stored in the FICE SD card.  The images are as follows:

 

IMAGES STORED IN THE SD CARD

images_SD.png

 

TECHNICAL OVERVIEW

 GLCD_FACE.png

 

A library has also been written to draw these images. Locate and include the DRAW_LIB library into your project (Project > Add Module). The following are subroutines found in the DRAW_LIB library:

 

CODE:

 

 DRAW_EYE(ByVal X As Integer, ByVal Y As Integer, ByVal OPEN As Boolean)

 

 

DRAW_EYE takes 3 arguments. The X and Y determines the position of the eye to be drawn and OPEN determines if the eye should be drawn using image EYE_OPEN or EYE_CLOSE. Type ‘True’ to draw EYE_OPEN and ‘False’ to draw EYE_CLOSE.

Let’s add the following line of code to draw two eyes on the GLCD.

 

CODE:

 

DRAW_EYE(25, 70, True)

DRAW_EYE(75, 70, True)

 

 

 

COMPILE_DOWNLOAD.png

Press F5 to download the program or click on the compile and download icon. If there are no compilation or download errors, you should see two eyes on the GLCD.

To add a mouth, we simply use DRAW_MOUTH.  DRAW_MOUTH takes 3 arguments. Xand Y being the position of the mouth and POS determines which mouth to draw.  Valid values of POS are 1, 2, 3, 4 or 5.  Please refer to the ‘IMAGES STORED IN THE SD CARD’ section for images of the mouth.  The code for drawing a mouth is as follow.

 

CODE:

 

 DRAW_MOUTH(32, 30, 1)

 

 

We have now drawn a complete face on the GLCD.  In the next section, we will do some animation with the face.

 BOB_FACE.png

 

CODE:

 

Public Sub Main()

       OS.GLCD.Init()

       OS.GLCD.Fill(255)

 

       'DRAW RIGHT EYE

       DRAW_EYE(25, 70, True)

       'DRAW LEFT EYE

       DRAW_EYE(75, 70, True)

 

       'DRAW MOUTH

       DRAW_MOUTH(32, 30, 1)

End Sub

 

 


download_sourceCode.png

Continue to Part TWO >>>

 

 

 

 

 

 
Previous Next
Two New Tutorials
Learn how to control a Servo Motor with the FIDE, as well as adding a wireless peer-to-peer communication link using the EBlue Bluetooth Module.
Hoorah! We've Updated!
3 Cheers to a new tutorial, a FIDE patch, and a Language Reference Update!
New Sensor and Documentation Updates

 

We now carry the distance measuring sensor, SHARP GP2D12, WITH the compatible 3pin connector.

In other updates, we have uploaded the technical paper for our GLCD+RTC Combo complete with example configurations to our FlamingICE Boards. 

Our Hardware Reference now stands at version 1.5 with slight changes to the pin-outs on the FI28 Board. 

 

Christmas Updates

Download the latest FIDE v2.1 and get all the updated documentation that comes along with it!

Check out the new goodies that we have over at our updated Products Page!

Resource Page

Now that FIDE 2.0 is up, we published the Resource Page with 2 major tutorials to boot.

Start clicking and head over to check out those tutorials!

FIDE v2.0 RELEASED!

AIS Cube is proud to release the latest and most complete installment to date, FIDE v2.0. Delivering faster feature packed goodness, whats not to love?

Head over to the downloads tab and grab your copy!

FIDE v1.4.2 PATCH

IMPORTANT: Responding to a bug report, the FIDE v1.4.2 PATCH is a patch for a major bug fix in the FIDE SD Tool. Please ensure that you have FIDE v1.4.2 installed before proceeding with the Patch.

Patch is available over on the Downloads Tab.

FIDE v1.4 Released!
More features with the latest release of FIDE at version 1.4. Extended syntax highlighting range, greater support for FIDE system language instructions...
FIDE v1.3 Released!

FIDE v1.3 is now available for download over at the downloads tab. Featuring bug fixes and other features such as an expanded syntax highlighting coverage, it is highly recommended that you upgrade to the newest version.

AVRIL LE BOB

We have a new project named AVRIL LE BOB up over at the projects page (with videos!!). Check it out today!


Copyright © 2007-2008. AIS Cube. All Rights Reserved.
All trade and/or services marks mentioned are the property of their respective owners.
Joomla! is Free Software released under the GNU/GPL License.