Posts Tagged ‘how-to’

How to drag an off-screen window back to the desktop (in Windows)

Monday, January 28th, 2008

This is a problem I just had (in Windows XP): My graphics card was set to force a TV display, even though I did not in fact have anything hooked up to my TV-out connection. Unfortunately my system chose to use the (non-existing) TV display as the primary display, so when I right-clicked on the desktop to access the display settings (so I could turn the TV output off), the display settings were displayed… on the TV screen. Which I couldn’t see. A nice little catch-22 there. Not to worry, there’s a solution.

Solution one: using the taskbar. If your off-screen application shows up in the taskbar, just right-click the application there, and select “move” from the pop-up menu. Then, without moving the mouse, click, then drag. Your window pointer should have been moved to the application window, so now you should holding the window, and should be able to drag it back to the screen you are seeing.

Solution two: for applications that do not show up in the taskbar. The desktop settings window does not show up in the taskbar, so you can’t do it as described above. Here’s what to do.

  1. Right-click the desktop and select “properties”. The “Display Properties” window open, but you can’t see it because it’s on a secondary, invisible screen.
  2. Press alt-space. This will open the window menu, like when you right-click on a window title bar.
  3. Press ‘m‘ on your keyboard. This will select “move” from the window menu. (This may not work if you are using Windows in another language… try it on a window yuo can see and figure out what key to use)
  4. Without moving the mouse, click, and then drag until you can see your window. Alternatively, you may use the arrow keys to nudge the window back to your desktop. (You can also use the arrow keys to move a window off-screen, although I’m not sure why you would ever want to do that.)

How to get started using mobile processing

Wednesday, December 12th, 2007

Processing is a free, open-source programming environment based on Java and the weapon of choice for most people doing artistic productions that require a bit of coding. Get it at processing.org

Mobile Processing is a cousin of Processing, but aimed at mobile phones and other smaller devices.

The problem

I want to be able to write simple programs on my computer and run them on my mobile phone. My computer is a Windows XP laptop with bluetooth, my phone is a java-enabled phone, also with bluetooth.

The solution

I did it by installing mobile processing, exporting to MIDlet and then transferring the jar file to my phone using Windows XP’s Bluetooth File Transfer Wizard. All of this is absolutely free, btw.

Setup

  1. Download and install a Java JDK. See how to set up java development.
  2. Download and install Sun Java Wireless Toolkit for CLDC (WTK)
    http://java.sun.com/products/sjwtoolkit/
  3. Download and install mobile processing.Since you’ve installed Java yourself, get the expert version. To install, just to unzip the archive where you want to have it, e.g. c:\sdk\mobile
    http://mobile.processing.org
  4. Restarting your computer at this point is probably a good idea.
  5. Start mobile processing by running the start-expert.bat in the mobile processing

How to use a piezo element as an arduino sensor

Friday, November 2nd, 2007

Piezo sensor

A bare piezo element makes a really cheap force sensor .

This example uses two piezo elements, back to back, with an o-ring in between.

Solder wires to the piezo element, one to the center piece and one to the rim (or one on each side - the rim and the back are the same).

Connect the center to an analog input on your arduino - pin 0, say. Connect the rim to ground. To get better readings, you should connect a fairly large resistor in parallel, from the analog input to ground. This acts as a pull-down resistor and stops some noise. If you’re just going to use the piezo element as a “knock sensor”, a resistor of about 1 kOhm is ok - for a wider range of reading, you will need a bigger resistor. (Perhaps this varies with the exact make of your piezo element as well)

We put two piezo sensors back to back with a rubber ring in the middle, and then put the whole thing inside a large shrink tube. This gave us a nice force-sensitive push sensor the size of a coin and a few millimeters thick.

We ended up using a 820 kOhm resistor. This gave us full range input when we pushed on the two sides of the cylinder.

Piezo sensor diagram

To read the values in the Arduino, just use analogRead.

Examples of components similar to those we used:

  • bare piezo element: Murata 7BB-12-9, Farnell #1192550
  • elastic o-ring with a diameter a little smaller than the piezo element. From your hardware store. In Sweden: Clas Ohlson #31-1704
  • Arduino board or other microcontroller with analog input