Burn bootloader for Arduino Duemilanove w/ Atmega328 using avrdude 5.10

This is using a new Arduino Duemilanove board with a regular Atmega328p, with no bootloader. I wanted to do the BitBang mode, since I didn’t want to get or make anything else, and the ArduinoISP, I didn’t have access to another Arduino. So I pieced together 3 different guides, I finally got it working.

This assumes you have a Duemilanove with Atmega328p. Running Ubuntu 9.10, though really any distro will work, though how you get the dependencies will vary. Also, you have the Arduino IDE installed to /usr/share/arduino, which if you install using the deb source method, it will be.

First, setup the Arduino as shown here. I used the first wiring guide, but either should work.

Next, setup avrdude on Ubuntu. I followed this guide, but used avrdude 5.10, instead of 5.8. The commands remain the same, except instead of downloading 5.8, you download 5.10.

Here’s what I ran:

wget http://download.savannah.gnu.org/releases-noredirect/avrdude/avrdude-5.10.tar.gz
tar xfvz avrdude-5.10.tar.gz 
cd avrdude-5.10/
for i in 8 7 6 5 4 3 2 1 0; do wget -O patch-$i.diff http://savannah.nongnu.org/patch/download.php?file_id=1851$i; done
for file in patch-*.diff; do patch -p0 < $file; done
wget http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.16.tar.gz
tar xzf libftd2xx*.tar.gz
cp libftd2xx*/static_lib/* .
cp libftd2xx*/*.h .
cp libftd2xx*/*.cfg .
./configure 
cp /usr/share/arduino/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex .

Then you edit the file, Makefile:
CFLAGS = -g -O2 -> CFLAGS = -g -O2 -DHAVE_LIBUSB -DSUPPORT_FT245R
LIBS = -lreadline -lncurses -ltermcap -> LIBS = -lreadline -lncurses -ltermcap ./libftd2xx.a.0.4.16 -lrt

Then just run make.

Third, run:

sudo ./avrdude -C avrdude.conf -c duemilanove -P ft0 -p m328p -t -B 4800

And in that:

erase
w efuse 0 0x05
w hfuse 0 0xda
w lfuse 0 0xff
q

This sets up the efuse, hfuse, and ifuse values. This has to be run at a lower baud rate.

Fourth, run:

sudo ./avrdude -C avrdude.conf -c duemilanove -P ft0 -p m328p -U flash:w:ATmegaBOOT_168_atmega328.hex

The bootloader has been flashed. Lock it by running:

sudo ./avrdude -C avrdude.conf -c duemilanove -P ft0 -p m328p -t

And enter:

w lock 0 0x0f
q

Now, your Atmega328 should be ready to use. You can try it by uploading the example Blink from the IDE.

WordPress YouTube Sidebar Video Plugin

This is a plugin based on the YouTube widget. It’ll display a YouTube video, most likely in your sidebar, by calling the youtube function which you can specify the url, width, height, and if it’ll autoplay. It’s not much, at all, but meh.

Download youtube-plugin.zip (youtube-plugin.tar.gz)

This plugin is one function called youtube that will display a YouTube video. It’s pretty much the same as copying the embed code from YouTube, but will allow you to change the width and height much easier.

I’m not going to go too much into this, so here’s the whole calling it premise. You would place this in your template in php tags.

youtube(uri[,width,height[,autoplay]])

Display a video with default width and height (250×165)
youtube("http://www.youtube.com/watch?v=AYxu_MQSTTY")

Display a video with custom width and height (500×330)
youtube("http://www.youtube.com/watch?v=AYxu_MQSTTY",500,330)

Display a video with default width and height (” will cause it to default), but autoplay
youtube("http://www.youtube.com/watch?v=AYxu_MQSTTY","","",TRUE)

Display a video with custom width and height and autoplay
youtube("http://www.youtube.com/watch?v=AYxu_MQSTTY",500,330,TRUE)

Download youtube-plugin.zip (youtube-plugin.tar.gz)

WordPress Reddit Widget

Number 8 in Widget-A-Day is a reddit widget.

It’ll display your latest liked items on reddit.com. You can edit the display, count, and username.

Not much of widget (can be kinda done via the RSS widget), but it’ll be the closer in Widget-A-Day. I might have one on Saturday, but there’s no guarantee. It’s been fun. Hopefully someone has found these useful. I’ll do it again sometime. If you have any problems, suggestions, or whatever, let me know

Download reddit.zip

SVN Checkout
svn co http://svn.wp-plugins.org/reddit-widget/trunk

Default display:
reddit1cropped.png

Admin panel:
reddit2cropped.png

Requirements

Installation

  1. Download reddit.zip
  2. Extract and upload reddit.php to the plugins/ directory
  3. Enable reddit Widget in the Plugin admin panel
  4. In widget admin panel, place reddit in the sidebar, and edit it to enter your username

Features

  • Displays your latest liked items (on reddit.com)
  • Completely customizable display
  • Caching for large traffic sites

Formatting

There are 3 parts needed to format the output.

The first part, called items start in the admin panel, is the first part of the widget after the title. For the default formatting, this is just <ul>.

The second part, called items end, is the ending of the widget. By default, this is:
</ul>
<a href="%profile%" style="float:right;">%username%</a>


The third part is what is called for each item. By default, this is:
<li style="list-style-type: none;"><a href="%link%">%title%</a> (<a href="%more%">more</a>)</li>

The premise of calling each value is this:

  1. start
  2. item
  3. item
  4. item
  5. end

The formatting for items is:

  • %title% – Title of the item
  • %link% – Link to the item
  • %desc% – Description of the item – Just [link] [more] links
  • %date% – Date the item was submitted (ISO)
  • %more% – More link – The link to the comments
  • %number% – The number of the current item

The formatting for start and end is:

  • %username% – Your username
  • %profile% – Link to your profile
  • %rss% – Link to your profile’s RSS feed
  • %count% – Number of items shown

Download reddit.zip

WordPress YouTube Widget

Number 7 in Widget-A-Day is a YouTube widget.

It’ll display a YouTube video in the sidebar. Just enter the URL of the video, and it’ll show in the sidebar. You can change the width and height, and make it autoplay or not.

Download youtube.zip

SVN Checkout
svn co http://svn.wp-plugins.org/youtube-widget/trunk

Default display:
youtbe1cropped.png

Admin panel:
youtube2cropped.png

Requirements

Installation

  1. Download youtube.zip
  2. Extract and upload youtube.php to the plugins/ directory
  3. Enable YouTube Widget in the Plugin admin panel
  4. In widget admin panel, place YouTube in the sidebar, and edit it to enter the YouTube URL, not the embed code

Download youtube.zip

WordPress Digg Widget

Sorry for the lateness. Went out, and it wasn’t working by the time I left.

Anyways, number 6 in Widget-A-Day is a Digg widget. It’ll display your latest dugg stories and the number of diggs the story has. It can be customized to include just about all the information the RSS feeds gives. Check out formatting for more information.

Update: If you downloaded this before 6 CST on May 31, the caching system wouldn’t work. Just redownload the file, and it’ll work or just remove AND FALSE on line 39.

Download digg.zip (digg.tar.gz)

Default display:
digg1cropped.png

Admin panel:
digg2cropped.png

Requirements

Installation

  1. Download digg.zip (gz)
  2. Extract and upload digg.php to the plugins/ directory
  3. Enable Digg Widget in the Plugin admin panel
  4. In widget admin panel, place digg in the sidebar, and edit it to enter your username

Features

  • Displays your latest dugg items from Digg
  • Completely customizable display
  • Caching for large traffic sites

Formatting

There are 3 parts needed to format the output.

The first part, called items start in the admin panel, is the first part of the widget after the title. For the default formatting, this is just <ul>.

The second part, called items end, is the ending of the widget. By default, this is:
</ul>
<a href="%profilelink%" style="float:right;">%username%</a>


The third part is what is called for each item. By default, this is:
<li style="list-style-type: none;"><a href="%link%">%title% (%diggs%)</a></li>

The premise of calling each value is this:

  1. start
  2. item
  3. item
  4. item
  5. end

The formatting for items is:

  • %title% – Title of the item
  • %link% – Link to the item
  • %desc% – Description of the item
  • %date% – Date the item was submitted (in GMT)
  • %category% – Category of the item
  • %diggs% – Number of diggs the item has
  • %comments% – Number of comments the item has
  • %user% – User name of the submitter
  • %userimage% – Link to the submitter’s icon
  • %number% – The number of the current item

The formatting for start and end is:

  • %username% – Your username
  • %profile% – Link to your profile
  • %rss% – Link to your profile’s RSS feed
  • %count% – Number of items shown

Download digg.zip (digg.tar.gz)

WordPress Weather Widget

Number 5 in Widget-A-Day is a Weather widget.

It isn’t too fanciful. It displays the current condition, temperature, and the feels like temperature. It uses weather.com‘s xoap api to retrieve the information. I’ll probably come back to this and make it better.

Download weather.zip

SVN Checkout
svn co http://svn.wp-plugins.org/weather-widget/trunk

Default display:
weather1cropped.png

Admin panel:
weather2cropped.png

Requirements

Installation

  1. Download weather.zip
  2. Extract and upload weather.php to the plugins/ directory
  3. Enable Weather Widget in the Plugin admin panel
  4. In widget admin panel, place Weather in the sidebar, and edit it to enter your location

Location

The location can either be a zip code for US users or the locid. To find the locid, you can do a search using http://xoap.weather.com/search/search?where=[search parameters].This will return an XML file with search results and their corresponding locid’s.

You can also find it out by the Weather.com website. After searching for and selecting you city, you will be sent to a url that will look something like, http://www.weather.com/outlook/driving/interstate/local/USTX0617?from=search_city, where USTX0617 is the locid.

Image Hosting

I’ve provided the images used and provided by weather.com here. If you want to host your own images, extract and upload the files, then, in the admin panel, edit the ‘Image Location’ field to point to your directory of images. Make sure to have the trailing slash.

If you don’t use your own images, you are free to use the ones that I’ve hosted, which are located at https://jamesdrakewilson.com/blog/weatherimages/

Editting display

You can edit ‘Widget Formatting’ to change how the info is displayed. To access the variables, use this formatting:

  • %loc% – Location
  • %temp% – Current temperature
  • %feels% – Feels like temperature
  • %icon% – The icon referring to the current weather. This is just a number
  • %iconhref% – The location of the image with your set image location at the front
  • %attribution% – The link supposedly required to be displayed. Weather data provided by weather.com®

The default formatting is:

<img src="%iconhref%" alt="%cond%" style="float:right;" />
%loc%<br />
<span style="font-size: 150%;">%temp% °F</span>
(%feels% °F)<br />
<span style="font-size: 65%; float: right;">%attribution%</a>

Download weather.zip

WordPress Countdown Widget

Today is my birthday. Woo! So that means, I’m not doing anything fancy, so without further ado

Number 4 in Widget-A-Day is a countdown widget.

It’ll display the amount of time until a certain event, or if it passed, how long ago it was. Lame? Yes. Do I care? Not really. Is there Javascript? No. Was there supposed to be? Yes. Why not? Because I’m lazy.

Update: By request, added a new version

Download countdown.zip (countdown.tar.gz)

Default display:
countdown1cropped.png

Admin panel:
countdown2cropped.png

Requirements

Installation

  1. Download countdown.zip (gz)
  2. Extract and upload countdown.php to the plugins/ directory
  3. Enable Countdown Widget in the Plugin admin panel
  4. In widget admin panel, place Countdown in the sidebar, and edit it to enter your the time and name

Download countdown.zip (countdown.tar.gz)

WordPress Google Reader Widget

Number 3 in Widget-A-Day is a Google Reader widget.

This widget will display your latest shared stories. You can change the amount of stories to display and how to display them.

Download googlereader.zip

Default display:
googreader1cropped.png

Admin panel:
googreader2cropped.png

Download googlereader.zip

SVN Checkout
svn co http://svn.wp-plugins.org/google-reader-widget/trunk

Requirements

Installation

  1. Download googlereader.zip
  2. Extract and upload googlereader.php to the plugins/ directory
  3. Enable Google Reader in the Plugin admin panel
  4. In widget admin panel, place Google Reader in the sidebar, and edit it to enter your user id

Features

  • Displays your latest shared items from Google Reader
  • Completely customizable display
  • Caching for large traffic sites

User ID

In order to get your shares, you need to know your user id according to Google Reader. This can be found by going to the ‘Shared Items’ link, and copying the 20 digit number at the end of your shared items link.

So something like:
http://www.google.com/reader/shared/02774557510273097991
Where 02774557510273097991 would be my user id.

Formatting

There are 3 parts needed to format the output.

The first part, called items start in the admin panel, is the first part of the widget after the title. For the default formatting, this is just <ul>.

The second part, called items end, is the ending of the widget. By default, this is:
</ul>
<a href="%googlereader%" style="float:right;">Shared Items</a>

The third part is what is called for each item. By default, this is:
<li style="list-style-type: none;"><a href="%link%">%title%</a></li>

The premise of calling each value is this:

  1. start
  2. item
  3. item
  4. item
  5. end

The formatting for items is:

  • %link% – Link to the item
  • %title% – Title of the item
  • %site% – The title of the site the item is from
  • %sitelink% – The link to the site the item is from
  • %number% – The number of the current item
  • %comment% – The comment (note) made when sharing an item

The formatting for start and end is:

  • %googlereader% – Link to your Google Reader shared page
  • %count% – Number of items shown

Download googlereader.zip

WordPress Last.fm Widget Widget

Number 2 in Widget-A-Day is a widget for the last.fm widgets.

It can show the chart of your recent tracks, top tracks, and top artists (weekly tracks and artists don’t work currently since the value varies throughout). You can also choose between red, blue, black, and green.

Download lastfm.zip (lastfm.tar.gz)

Here is the default view:
lastfm1cropped.png

Here is the admin panel:
lastfm2cropped.png

Requirements

Installation

  1. Download lastfm.zip (gz)
  2. Extract and upload lastfm.php to the plugins/ directory
  3. Enable Last.fm Widget – New Style in the Plugin admin panel
  4. In widget admin panel, place Last.fm in the sidebar, and edit it to enter your username

Download lastfm.zip (lastfm.tar.gz)

Compete WordPress Widget

Compete released it’s API today, so I decided to make a widget for WordPress using it.

Download compete.zip

SVN Checkout
svn co http://svn.wp-plugins.org/compete-widget/trunk

This adds a link, your current rank, the amount of visitors, and your rank image to the sidebar.

By default, it looks like:
wpcompetecropped1.png

In the widget admin panel, you can completely edit the title, your api key, your host (by default, it’s the current host), the amount of time before the cache expires, and the ability to completely edit the display (see below)

wpcompetewidcropped1.png

Requirements

Installation

  1. Download compete.zip
  2. Extract and upload compete.php to the plugins/ directory
  3. Enable Compete Rankings in the Plugin admin panel
  4. In widget admin panel, place Compete in the sidebar, and edit it to enter your API Key

Features

  • Displays data about your site or any site you choose
  • Edit nearly all aspects of it via widget admin
  • Caching for large traffic sites

Editting display

You can edit ‘Widget Formatting’ to change how the info is displayed. To access the variables, use this formatting:

  • %rank% – Rank of the site
  • %icon% – The icon relating to your traffic rank (large or small depending on options)
  • %count% – People count
  • %host% – Hostname used in lookup
  • %link% – Link to the compete page for the host
  • %compete% – The compete link – Compete.com

The default formatting is:

<span style="float:right;"><img src="%icon%" alt="%rank%" /></span>
<a href="%link%">%host%</a><br />

Ranking: %rank%<br />
People: %count%<br />
%compete%

Download compete.zip