Tilt Snake Game using MSP430FG4619LCD

October 17, 2008 at 9:23 pm | Posted in MSP430, My Projects | 3 Comments
Tags: ,

Utilize the accelerometer to control the snake.

Sorry, the apple might be too small on the video.

Advertisements

Photo Slideshow using MSP430FG4619LCD

July 25, 2008 at 8:22 pm | Posted in MSP430, My Projects | 3 Comments
Tags: ,

Photos are stored in SD card and displayed on the Nokia LCD periodically.

Hardware Gmail Notifier – C# code

July 11, 2008 at 8:20 pm | Posted in MSP430, My Projects | 1 Comment
Tags: ,

Here is the code that I used to get the number of email from Gmail in C#.

/// <summary>
/// Get the Number of Email
/// </summary>
/// <param name=”userName”></param>
/// <param name=”passWord”></param>
/// <returns></returns>
private int GetNumberOfMail(string userName, string passWord)
{
XmlDocument xmldoc = GetGmailFeed(userName, passWord);
XmlNodeList count = xmldoc.GetElementsByTagName(“fullcount”);
return int.Parse(count[0].InnerText);
}
/// <summary>
/// Get the Gmail Atom Feed
/// Adapted from Kevin Daly
/// http://www.dotnetjunkies.com/WebLog/kevdaly/archive/2004/12/24/38612.aspx
/// </summary>
/// <param name=”userName”></param>
/// <param name=”password”></param>
/// <returns></returns>
private static XmlDocument GetGmailFeed(string userName, string password)
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(“https://mail.google.com/mail/feed/atom/&#8221;);
req.Method = “GET”;
req.Credentials = new NetworkCredential(userName, password);
XmlDocument response = new XmlDocument();
HttpWebResponse resp;
try
{
resp = (HttpWebResponse)req.GetResponse();
if (resp.StatusCode == HttpStatusCode.OK)
{
XmlTextReader reader = new XmlTextReader(resp.GetResponseStream());
response.Load(reader);
reader.Close();
}
resp.Close();
}
catch Console.WriteLine(“Error… HttpWebResponse”);
return response;
}

Note: I do not guarantee this code will always work. Use it at your own risk.

Hardware GMail Notifier

June 22, 2008 at 8:03 pm | Posted in MSP430, My Projects | 5 Comments
Tags:

The work by Jamie Matthews inspired me to create the similar GMail Notifier.

This project consists of two parts: hardware and software.

The Hardware

The hardware prototype

The schematics

The hardware is powered from the USB port. It uses the XBEE USB to serial module to communicate to the computer and MAX882 3.3V regulator. The microprocessor used is MSP430F2131 from Texas Instruments.

Five LEDs are used in this project:

  • LED1: Green LED
  • LED2: Green LED
  • LED3: Yellow LED
  • LED4: Red LED
  • LED5: POWER Red LED

The microprocessor read from the UART port how many new emails sent from the software.
If there is no new email, LED1 to LED4 will turn off.
If there is one new email, LED1 will turn on.
If there is 2 new emails, LED1 and LED2 will turn on.
If there is 3 or 4 new emails, LED1 to LED3 will turn on.
If there is 5 or more new emails, all LEDs will turn on.

The Software

The software is written in C#. Using the GetGmailFeed( ) function written by Kevin Daly, we can get the atom feed from Gmail which is in XML format.

<?xml version="1.0" encoding="UTF-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<title>Gmail - Inbox for xxxxx@gmail.com</title>
<tagline>New messages in your Gmail Inbox</tagline>
<fullcount>2</fullcount>
...
</feed>

All we need to do next is to parse the XML docs and get the fullcount tag (which is the number of new emails) and pass it to the hardware through the virtual COM port.

Simple Response Time Game

April 25, 2008 at 4:15 pm | Posted in MSP430, My Projects, ScreenKeys | 1 Comment
Tags: , ,

Sorry, I haven’t been writing this blog. Our first baby girl just arrived few months ago.

Anyway, here is my recent home project.
It’s a simple response time game.

The game rule is:
When the display changes from “Ready” to “Hit”, press the button as quickly as you can.
If you are too slow, you lose!

The microprocessor is MSP430F2013 from Texas Instruments, where you can get directly from TI or from Digikey.

The button LCD is the RGB24 ScreenKeys, which can be obtained from Sparkfun.

Below is the schematics:

Below is the demonstration video.

Note: it is not easy to play this game while  holding the camera. 🙂

« Previous PageNext Page »

Create a free website or blog at WordPress.com.
Entries and comments feeds.