Archive for the 'Software Development' Category

Published by drbrown on 13 Feb 2013

Hipster Dots

Playing with Processing and Processing.js with my CSIT1520 Intermediate Java class. This week we looked at simulating the physics of oscillation and discovered some of the magic of polar coordinates in computer graphics.

Hipster Dots consists of two spirals being plotted in opposing directions. with a constant angular velocity, but a radius that varies slightly by applying Perlin noise. Click here to watch it run. Click in the program at any time to clear the screen and watch the image evolve anew.

Published by drbrown on 10 Feb 2013

The Nature of Code

Over the Christmas Break, I came across a fabulous textbook called “The Nature of Code.” The author (Daniel Shiffman) provides an online copy of the text, with source code and interactive examples free of charge. Check out the text here.

You can get a paper copy of the text for around $30 or a full PDF copy of the text (with source code for all examples) for a recommended donation of $10 (although he lets you set your own price).

Anyway, this book is one of the best (if not the best) textbooks for teaching computer programming I’ve ever come across. The focus throughout is on simulating natural processes. Check out these topics:

  • Random Processes & Noise
  • Using Vectors for Modeling Physics
  • Physics Forces as Vectors
  • Simulating Oscillating Systems
  • Particle Systems
  • Physics Libraries
  • Autonomous Agents (modeling forces within)
  • Cellular Automata
  • Fractals
  • Genetic/Evolutionary Programming
  • Neural Networks

We are now in week 4 using this book and it seems that my feelings are vindicated. My students are loving the book and creating some wonderful simulations… which they are sharing on their blogs.

I am working through the class along with my students. Below is a link to what I’ve done so far. I call it “Dr. Brown’s Funky Forest.”

Dr. Brown's Funky Forest

Our class programs are written in Processing, which is actually Java, but with a cool class called PApplet that allows you to deliver “Processing” programs (called “Sketches”) in the same manner as applets. In addition, there is a JavaScript implementation of Processing called processing.js that makes it easy to embed Processing programs.

This is what I did for my “Funky Forest.” It is supposed to illustrate the use of Perlin noise to model natural looking randomness (in the insects movements), physics modeling of movement and acceleration, and it has two classes of insects that are attracted to different things. The smaller insects are interested in the flame. The larger insect is interested in the smaller ones.

The Sketch doesn’t look exactly like it does running it on my home computer. The flame is flickering above and beside the torch to which it belongs and my easter egg doesn’t work (clicking the torch flame should show movement trails of the insects).

Processing allows you to export your program to run on Android devices and this sketch looks great running on my Galaxy Tab 2 running 4.1.1 Jelly Bean.

Anyway, I’m pretty impressed with Processing and with Daniel Shiffman’s book “The Nature of Code.” Again, check out the work my class is doing throughout this semester. They are impressing me every week!

Published by drbrown on 08 Nov 2011

Physical Computing with the Arduino Microcontroller

Physical computing concerns computer systems that interact with the physical world. In a more limited sense, physical computing systems are cybernetic in nature, sensing and responding to the physical environment. It is through the skillful manipulation and translation of sensed inputs that physical computing systems can appear to exhibit intelligence in their physical responses.

The availability of inexpensive, easily programmable microcontrollers provide the perfect medium for exploring physical computation and are stepping stones toward ubiquitous computing.

At the 2011 Google I/O, Google announced their intention to work with Arduino to create an open-source development environment for creating Android peripherals. Arduino manufactures open-source microcontroller boards that can be easily attached to physical devices and programmed using an open-source programming language (also called Arduino).

In this post, I introduce the Arduino board family and show how quickly and easily they can be wired and programmed for physical computing. It should be noted that Arduino is simply one of many microcontroller boards currently available.

The Arduino family of boards come in various shapes, sizes and capabilities and currently includes the Uno, Duemilanove, Diecimila, Nuova Generazione, Extreme, USB, Serial, Mega, Mini, Nano, and the LilyPad (a round microcontroller made to be sewn into clothing). Some of these are shown below (click here for more information on a particular board):

This summer, I created a small mobile robot and chose the Arduino Uno as its “brains.” I chose the Uno because it had a built-in USB port (some Arduino boards require a “shield” that provides a temporary USB port for downloading) and had enough ports and power for the project as I envisioned it. The Arduino Uno is a 20MIP ATmega328 running at 20MHz. A datasheet for the Uno is available here.

Notice the rows of pin sockets at the top and bottom right edges of the board. The upper row has 13 sockets that can be used to connect digital input or output along with a common ground socket. The bottom rows of sockets can be used for analog input or output along with power and ground connections.

The board can be powered by a 9V power supply plugged into the power jack located at the lower left corner of the board, or through a USB connection to the port at the upper left corner. Software is downloaded to the board via a USB connection directly from within the Arduino development environment.

Here is a screen shot of the Arduino programming environment:

The Arduino language is a modified version of the Processing language. The program shown above is one of the example programs provided with the Arduino software. It simply blinks an LED connected to the digital I/O pin 13. This program demonstrates the ease with which physical devices can be connected to the Arduino board. To wire the LED to the board you could simply stick the long lead (positive) of the LED into digital pin 13 and the short lead (negative) to ground.

After a program is downloaded to the board, it runs the setup() method once and then continues running the loop() method until the power is removed from the board or another program is downloaded. As stated previously, the board can be powered either through a battery pack or through the USB connection.

The robot I created this summer with the Arduino Uno board had the following connected to it:

  • Two servos to handle the left and right wheels.
  • Two servos to handle the pan/tilt functions of the robot’s neck.
  • Two infrared motion detectors mounted as ears on the robot’s head.
  • An ultrasonic distance sensor for eyes.
  • A miniature speaker for the mouth.

In addition to creating robots, microcontroller boards like the Arduino can be used to create mobile phone peripherals, sensor networks and other physical computing devices.

Mobile phone peripherals are in their infancy and represent a relatively untapped new market and turn smartphones into powerful handheld tools. One example is Square, a device/app combination that allows the iPhone or iPad to read credit cards. All manner of field test equipment could be connected to smartphones via microcontroller-based hardware (such as Arduino).

Arduino board capabilities can be enhanced through the use of shields. Shields either clip or are soldered onto an Arduino board to provide additional capabilities such as wired or wireless ethernet, cellular functionality, data logging, motor control, video display control, touch pad capabilities, audio capabilities, etc.

Sensor networks can be constructed by creating Arduino modules with sensors that communicate either wired or wirelessly with a central microcontroller or host computer. In effect, sensor networks are like a distributed robot whose body/senses are spread across a large area.

Inexpensive, easy to use microcontrollers represent a significant step toward spreading intelligence throughout the physical world. Considering Moore’s Law, the price and size of microcontrollers can be expected to halve every 18-24 months. How long before we can feasibly imbue almost everything we touch with intelligence?

Books:

Published by drbrown on 16 Mar 2011

I Built a New Computer

I built the computer that I described in my previous blog post. I now have a six-core AMD processor running at 3.2Ghz with 8GB of RAM, a 120GB solid state drive and a 2TB external hard disk. I hooked the system to a 40″ 1080p LCD display on an a full-motion articulating wall mount.

The initial computer build took about two hours. The process was very easy and thoroughly described in the documentation accompanying my Asus motherboard. The only mistake I made was that my case has a display showing internal case and CPU temperature and I should have mounted a sensor between the heat sink and the CPU. I think I may try to attach it later with some thermal tape. Right now it is just loose in the box.

I initially installed Ubuntu 10.10 (Maverick Meerkat) on the machine, but discovered that if I wanted to also dual boot Windows 7, I needed to install Windows first, so I trashed the system and started over. The Windows 7 install went smoothly, though I couldn’t get it to recognize the wireless adapter on my motherboard. After installing Ubuntu again, it also wouldn’t recognize the wireless adapter, so after a few days of installing drivers, I gave up and ordered a 300Mbs high-gain wireless N USB adapter (you can see its “horns” standing on top of my computer).

Getting Ubuntu to play nicely with my existing devices took a little work. I connected my 2 TB Western Digital external drive, a micro USB Bluetooth adapter, a Podcast Studio M-Audio microphone, and a cheap headset/microphone combo with no problems. My Apple Keyboard works well except for the function keys and multimedia keys. My Magic Trackpad works, but with limited gestural recognition. I was able to connect my Wacom Intuos3 6×8 tablet , but so far I haven’t gotten pressure sensitivity functioning. I ended up buying a new camera (Logitech 1080p Webcam Pro C910) since the one I had wouldn’t work and as I said before, I bought a wireless adapter as well.

On the software side, the Ubuntu Software Center application allows you to easily install or update a wide range of supported open source software. A System Update utility manages drivers and keeps installed software up-to-date. Open Office has worked well for me so far in opening, modifying and saving files in Microsoft Office formats. Chromium is a great open-source version of Google Chrome. WINE (Wine Is Not an Emulator) is great for running Windows .exe files, although it wouldn’t run Warcraft for me (hence my Windows 7 dual boot setup). I can honestly say that I am extremely happy with the open source applications.

Ubuntu has been interesting to work with. It has been a while since I’ve looked at open source OS’s and things have really changed for the better. An Ubuntu system still isn’t as easy to maintain as Windows or OS X and it does still require some computer savvy to even get a system going (or at least mine did) but it is getting closer to the ease of use of proprietary systems. Perhaps some day soon, the “best” OS will be free.

I had planned to replace my iMac with the new computer that I built, but I enjoyed Ubuntu so much that I decided to also get rid of my MacBook. I bought the ASUS Eee PC Seashell 1215N 12.1-Inch Netbook which came installed with a 32-bit version of Windows 7 (although the dual-core AMD processor is a 64-bit CPU). I installed the 64-bit version of Ubuntu and made it a dual-boot system and am loving it.

At one time, I would have labeled myself an “Apple Fanboy,” but no more. I still appreciate Apple’s emphasis on aesthetics and ease of use, but their somewhat draconian policies concerning software development tools, restrictions on developers and their sometimes iron-fisted control over the iTunes Store has soured me on them somewhat.

The wild frontier of open source software is calling to me and in it I see not only hope for the future of computing, but perhaps, as metaphorical of a societal move away from pure competition and toward more cooperative endeavors. In this respect, the open source movement may represent the best hope for a positive step in the evolution of human society.

Check out “The Open Source Society” for an introduction to the idea of open-source as a new paradigm for economics, politics, science, education, and culture. (OSE – Open Source Everything)

Published by drbrown on 04 Feb 2011

I’m Building a Computer

In the third week of my CSIT1110 “Introduction to Information Technology” class, I ask my students to try to make a workable plan for building their own computer. They end up posting blog entries containing detailed plans for cheap computers, incredibly fast gaming computers, quirky computers with case modifications and sometimes even supercomputers.

This semester (Spring 2011), while explaining the process and trying to make it as interesting as possible to my students, I went too far and got myself excited about building a computer. I’ve built two computers before, the last being about 10 years ago. I had great fun building them and learned many things about computers in the process.

I intend to run the open-source operating system Ubuntu on the system. Here are the components:

I already have a 40-inch TCL 1080p HDMI TV/Monitor mounted on a dual-arm articulating wall mount along with a Logitech gaming keyboard and Apple’s Magic Trackpad (although I’ll need to add a bluetooth adapter to my system to make the trackpad work). The total system cost is $804.94 (plus tax and shipping).

The following are detailed descriptions of the components along with my reasons for purchasing each item:

APEVIA Black Aluminum MicroATX Computer Case with 420W Power Supply ($79.99)I recently purchased a Mac Mini as my home entertainment system controller and have gotten accustomed to the small desktop footprint. I decided to try to build a small but extremely powerful computer.

I started by selecting this MicroATX case which has a sleek look in stylish black. The reviews say that the case looks and performs well, but is somewhat flimsy. I think that it will work for my purposes.

I already know that the built-in 420W power supply only has one SATA connector, but my assumption is that I can just use an adapter on my internal Blue-ray player.

AMD Phenom II X6 1090T Black Edition Thuban 3.2GHz Six-Core Processor($199.99)I chose the AMD just because I’ve never had a computer with an AMD processor and wanted to try this one out. This was the fastest processor in my price range. Six cores running at 3.2GHz should give me plenty of power to render video files (or just to play WoW).
ASUS M4A88TD-M/USB3 HDMI Micro ATX AMD Motherboard($104.99)I’ve used ASUS motherboards in the past with varying success, but I liked the look of this board and it seems to be one of the best (for my purposes) in the Micro ATX form factor. It supports a maximum of 16GB of dual-channel DDR3 RAM running at up to 1333Mhz (up to 2000Mhz with overclocking). It has an onboard ATI Radeon HD 4250 video chipset which I’m not sure will be enough graphics power, but I’ll give it a shot before purchasing a separate video card.  The board was advertised as “Six-Core Ready,” has 2 USB3 ports, 4 USB2 ports and supports up to 6 SATA devices at 6Gb/s.

This motherboard is different from the one I originally planned to purchase. After looking over my build plans, a  student in my Blount County CSIT1110 class suggested I get a mother board that supports USB3.

G.SKILL Ripjaws Series 8GB (2 x 4GB) 240-Pin DDR3 1333 SDRAM($109.99)8GB of superfast 1333Mhz dual-channel DDR3 RAM with a CAS (column address strobe) latency of only 7 clock cycles! I actually ordered slower set of RAM and plan to send it back. When I changed my mind about the motherboard, I didn’t notice that the new board I ordered supported faster memory, so I ordered this set, too. NewEgg said they would let me send the other set back unopened for a full refund.
Crucial RealSSD C300 2.5″ 128GB SATA III MLC Internal Solid State Drive($239.99)This is my first solid state drive and is one of the components that I am most excited to check out. I plan to put the OS (Ubuntu) and applications on the SSD and connect traditional external drives for additional storage and backups.
SAMSUNG Black Blu-ray Drive SATA ($69.99)This is also my first Blu-ray player. I don’t yet own any Blu-ray disks, but I suppose that once I get this drive installed, I’ll have to buy some. As I mentioned before, I’ll need an adapter to get power to this unit since the power supply that comes with the case only has one SATA power connector and I need that for the SSD.

I should have all of this equipment in some time next week and plan to post entries on the build. I am very excited to see just how fast this machine is going to be!

Published by drbrown on 06 Feb 2010

AL – The Assembly Language Simulator

I created a new version of an Assembly Language Simulator (using MIT’s Scratch visual programming language) for my CSIT1110 Introduction to Information Technology class. The following is an outline of how to use it. Complete details are available in the “Project Notes” at the link above.