Posted by Igor Moochnick on 06/20/2008
Wow! This is the best user experience I’ve ever had.
The documentation is clean, crisp and to the point. The installation went smooth and, after the installation, I was asked if I’d like to run some demo application. Without leaving the installation program (post-install) I was able to run pre-built samples that demonstrated the beauty of the product and made me feel safe and sound that the installed product is operational.
Good job, guys! I wish other product would’ve followed your track with the user experience.
Terracotta project home – http://www.terracotta.org/
Terracotta tutorials – http://www.terracotta.org/confluence/display/explore/Home
Posted in Java, Thoughts, Tutorials | Leave a Comment »
Posted by Igor Moochnick on 06/20/2008
After a very very very long wait, followed the Boarduino USB kit order, I’ve finally received the package. And, without loosing any more time, decided to give it a test spin.
The assembling experience was a breeze. Within 15 minutes I was running my very first Arduino “Hello, World!” program. And you can too …
This is how you can do it (I guess that you know how to solder):
- Don’t forget to order a kit. There are a couple of different Arduino kit distributors as well as a bunch of Arduino clones. I’ve ordered a Boarduino USB kit from Adafruit Industries.
- Wait patiently for the kit to arrive.
- Prepare some essential tools:
- Solder iron, solder and (optionally) flux
- Angle cutters
- Small pliers
- It’ll help you if you’ll have a 3-rd hand.
- Unpack everything carefully – there are a lot of small parts.
- Verify that all the parts in the kit are present.
- Start with putting the capacitors C1 and C3
- Green LED (D1). Make sure that you use a correct polarity (long leg is a ‘+’, the short leg and a shaved side is a ‘-‘)
- Resistors R2 (1K), R3 (1K). To make the resistors fit nicely in the holes – use small pliers to bend the leads.
- Solder everything and clip the extra legs
- Use angle cutters to cut a 2-pin header of the long header strip. Be careful not to burn your fingers holding it in place while soldering it. You can use a drop of a glue to hold it in place or hold it with a tweezers while soldering.
- Add the electrolytic capacitor C2. Make sure that you using a correct polarity – align the ‘+’ sign on the cap with the ‘+’ sign on the board.
- Now you can plug in the Boarduino using a plain USB A-B cable.
- Check that the green LED is turned ON – this tells you that your board is now powered up by the USB
- Tap yourself on the back, smile and get back to work …
- Add a Red LED (D2)
- 16 MHz Resonator
- Capacitor C2
- Resistors R1 (10K) and R4 (1K)
- Don’t forget to clip all the extra legs after the soldering is done
- Now we’re going to add some extra hardware
- Add a reset button
- Add a 3-pair header
- Add a chip socket. To ease the pain putting it through the hole – use a solid table surface to bend the pins inward. Make sure to follow the diagram on the board to correctly orient the notch on the socket.
Step 8 – breathtaking
- Now hold your breath and insert the chip. Match the notch on the chip with the notch on the socket. To make the insertion easy – use a solid table surface to bend the chip’s legs.
- Go to FTDI site and download the latest drivers. More detailed you can find in Arduino Tutorial Lesson 0.
- Plug in the USB cable and:
- See that the Green LED is turned on
- Note that the Red LED begins blinking. This tells you that the bootloader on the chip does it’s job
- On your computer go to Device Manager:
- Start –> Control Panel –> System
- Select Hardware tab
- Press “Device Manager” button and you’ll see the following window:
- Under the Ports section look for extra “USB Serial Port” item – this is your Boarduino.
- Note the COM port number – you’ll need it later
- If everything is OK – hold your breath for the next step where we’re going to have a real fun.
Step 9 – awestricken
- Go to the official Arduino site and download the development software.
- Install it and run the development environment
- Configure the Boarduino:
- Tools –> Board leave the setting as “Arduino Decimila”
- Tools –> Serial port select the port that you’ve noted in the Device Manager in the previous step.
- Open a Blink sketch:
- From the File menu select: “Sketch Book” –> Examples –> Digital –> Blink
- Note that you have a piece of code in the editor
- Compile the code: Sketch –> Verify/Compile (there should not be any errors)
- Upload the code to the board: File –> “Upload to I/O Board” (if everything is OK – there should not be any problems either)
- If you’ve followed all the steps to the point – you should see the Red LED blinking after a very short period of time.
- Breathe in and breathe out – go grab a cold beer! You’ve earned it.
Step 10 – optional
- If you want to use your Boarduino on bread boards you need to solder the rest of the headers.
- Use your angle cutters to cut the header pieces to the required length
- Use your breadboard to align them in the correct configuration:
- Place Boarduino on the headers.
- Solder them one by one. Make sure you don’t heat the leads too much – it may melt the breadboard. Try to solder the headers randomly and one on each side – it will minimize the chance of melting your breadboard.
- Now you’re really DONE. Be very careful when you’ll be pulling the Boarduino from the breadboard – you can bend the legs. Try to pull it out by slightly rocking and preserving it parallel position to the breadboards as close as possible.
- Official Arduino site and Arduino Development software – http://www.arduino.cc/en/Main/Software
- Boarduino site and USB Boarduino Schematics – http://ladyada.net/make/boarduino/download.html
- Arduino tutorial – http://www.ladyada.net/learn/arduino/index.html
- Getting started with Arduino – http://www.arduino.cc/en/Guide/HomePage
- FTDI Chip drivers – http://www.ftdichip.com/FTDrivers.htm
Posted in DIY, Electronics, Hardware, Robotics, Tutorials | 2 Comments »
Posted by Igor Moochnick on 06/19/2008
Here are a couple of very simple steps to follow to make your WPF application skin-friendly.
- Create an empty WPF Windows Application (or use or old one)
- Create a Skins folder and a subfolder for each separate skin (you’ll need it later if your skins become more complex)
- Add a Resource dictionary (Add –> New Item –> Resource Dictionary) into each skin folder.
- In this example we’ll create a Black skin with BlackResources.xaml and
- Green skin with GreenResources.xaml
- In the App.xaml add the following code in the <Application.Resources> section:
<!-- Use the Black skin by default -->
- Let’s start (for simplicity) with skinning of the main window background only.
- In each skin resource dictionary create a Brush resource:
<!-- The Background Brush is used as the background for the Main Window -->
<LinearGradientBrush x:Key="MainBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF2C952C" Offset="0"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
- In the window’s XAML bind the window’s background brush to the skin dynamic resource by it’s name (note that we have to use DynamicResource, since we’re planning to change it while the application is still running to let the customers to change the skin):
Title="Window1" Height="300" Width="300"
<Button Width="100" Height="100" Content="Toggle Skin" />
- Let’s wire the “Toggle Skin” button with the functionality that will toggle between these two (Black and Green) skins:
1: private void ToggleSkin_Click(object sender, RoutedEventArgs e)
3: var rd = new ResourceDictionary();
5: string uriSkin;
6: if (_bIsBlackSkin)
8: uriSkin = @"Skins\Green\GreenResources.xaml";
12: uriSkin = @"Skins\Black\BlackResources.xaml";
14: _bIsBlackSkin = !_bIsBlackSkin;
16: rd.MergedDictionaries.Add(Application.LoadComponent(new Uri(uriSkin, UriKind.Relative)) as ResourceDictionary);
17: Application.Current.Resources = rd;
- Note: try to avoid hardcoding the resource dictionary path in the code. You can replace it either with a configuration file or with a simple file discovery.
- You have to make sure that the resource files will be located in the output folder. To do so you need:
- On the resource file properties set Build Action to Content
- Set the “Copy to Output directory” to “Copy if newer”
- Start the application.
You can take the sample source code here:
If you’ll toggle the button you’ll see the window background colors are changing.
Posted in C#, Tutorials, WPF | 7 Comments »