3 degrees of freedom: gyroscope to PC

Gyroscopes can measure rotations. It would be great to make such measures easily accessible to response latency experiments. I now managed to connect a gyroscope to my PC via an Arduino. I used components from Seeedstudio: a Xadow Arduino main board, a Xadow 6DOF unit that has an accelerometer and a gyroscope, an additional breakout board to connect an additional pin, and software from ic2devlibs.

Below are some photos showing how the “head” on the screen responds to rotation of the sensor (which is placed on the small white board in my hand). Next to the head, the rotation angle (up vs. down pointing of the nose) is displayed. This can easily be saved along with timestamps. There is also a video displaying the connection.

2014-02-13 15.01.55 2014-02-13 15.01.51 2014-02-13 15.00.58 2014-02-13 15.02.28 2014-02-13 15.02.25

Short guide to using Word for writing APA style manuscripts

Most people I know use Microsoft Word to write their manuscripts. But often they don’t use some of the useful functions of Word, and as a result end up with a lot of formatting and editing work in the end. Below is a guide on how Word functions can help writing clean and manageable documents in APA style.

There are three main issues:

  • Use styles for formatting,
  • use bibliography functions for adding references, and
  • do proper footnotes with the functions built into Word.

Start from a template that has already the right formatting styles

Use a document that has proper formatting styles already defined to start. For instance, the apa.docx. (It is based on a APA 6 template from Microsoft, which I found useful but not ideal). Just open the file, save it with a new name, and delete what you do not need.

Use styles for most formatting

When you add headings, don’t format them by hand (ie., with the formatting buttons in the Home ribbon). Instead, format them with the predefined styles.

To do that, mark the paragraph you want to format, or just put the cursor in it, and use the Styles accessible from the Home ribbon. In the screenshot, the paragraph that has the cursor in it is formatted as Heading 1.


The advantages of styles are:

  • The headings are always correctly formatted.
  • You see the heading structure when you switch the Navigation Pane on
  • When you are done and export your document to PDF, it will have the document structure as well.

The apa.docx has the following helpful styles

  • Normal – for your regular text
  • No indent – for text where the first line should not be indented, such as text in tables, and figure captions, table titles, table notes
  • Section Title – use for the headings “Abstract”, the repeated title on the third page, “References”, “Footnotes”, “Tables”, “Figures”
  • Heading 1 … Heading 5 for the actual headings in your text
  • Bibliography – use for the references

These styles will do most of the formatting you need to do. In addition, you should only need to use the Italics button.

When you paste text that you copied from other documents or from the web, it is often already formated. Use Home – Paste – Paste Special and paste as Unformatted Text, or format with the Normal style after pasting to get rid of the wrong formatting.

The Styles for Section Title and Heading 1 already introduce a page break before them. So you don’t need to manually add a page break there.

To take advantage of the document structure you create by properly formatting the headings, turn the navigation pane on:



Depending on how many references you have to add, you can use more or less sophisticated means:

If you have only a few, you could simply use cut and paste. When you search a paper in Google Scholar, you have several options below the link – cited by XXX; related articles; all the X versions; and cite. If you click in the last one “cite”, you get the reference already in APA style, You just have to copy-paste it to Word then.

If you have more references, you can use the Bibliography function that is built into Word. If you have a lot of references, I recommend Mendeley (http://www.mendeley.com) or Endnote (http://endnote.com/) instead.

Either way, format them with the Bibliography style. Every line except the first one should be indented.


If you use the built in Bibliography function:

To add new citations, go to Reference ribbon – Citations & Bibliography group – Manage sources

Then Reference ribbon – Citations & Bibliography group – Insert Citation for in-text citations

Then Reference ribbon – Citations & Bibliography group – Bibliography – Works cited to add the bibliography.

If you have more than 10 references, I recommend Mendeley or Endnote.

Use track changes and comments when working collaborating with others

If you are collaborating with others, and revise or change others’ drafts, turn on Track Changes in the Review ribbon, and add comments with New comment. If a colleague forgot to do that, you can still recover some of that functionality if you use the Compare function on the Review ribbon, which lets Word search for changes and mark them.

Do proper footnotes

Adding footnotes is one of the tricky tasks in APA formatted word Documents. The reason for the difficulties are that APA used to ask for Footnotes to be on a separate page title Footnotes, located after the References, but before other pages like Author Notes, Tables, and Figures. The only way to do that is to add notes as Endnotes, to specify that Ednotes get displayed after a Section break, and to place the section break where the Endnotes should appear. The guide below shows in detail how to do that.

However, APA 6 now also allows to place footnotes in the manuscript directly as footnotes, so you can do that if you prefer that.

Never create footnotes by putting the numbers in by hand and formatting them as Superscript). That only creates huge headaches when you want to add or remove footnotes, and then have to renumber everything.

If you want the Footnotes on one page after the References

Here is how to enter Footnotes that appear as Endnotes on a page after the References:

Insert your notes as Endnotes: References Ribbon, Insert Endnote button.


If you use the apa.docx, that should be it, and the footnotes should appear in the proper place.

If not, or if you work with a previous doc of your own, you need to fix it with the following steps.

Troubleshooting Step 1 – get rid of the annoying line before the footnotes (only if you don’t use apa.docx)

This step you do not have to do if you use the apa.docx I have prepared. This first step removes the annoying line that shows up before the footnotes.

After you entered an endnote, search for it at the end of the document. It will look something like this, with the unnecessary line above it. It’s difficult to remove.


Open the extra Footnotes menu: In the References ribbon, click on the small “Dialog box launcher” at the lower right corner of the Footnotes group.


In the dialog box that opens, select “End of section” as the location of your Ednotes, and choose Number format 1, 2, 3. Click Apply.


Turn on the paragraph marks to see what is going on in hidden formatting:


Change to Draft view


Click Show Notes in References ribbon.


An extra box opens. In this box, you can select the Endnote Separater. The line appears.


Delete it


Also delete the Endnote Continuation Notice

Change back to Print Layout



Tell Word to place Endnotes in the right place (only if not using apa.docx)

The following step is also already done in the document, but if your footnotes suddenly appear at the end of the document, you might have accidentally deleted it. Here is how to restore it:

Place your cursor after the Footnotes section title (you might want to turn on paragraph marks to see it)


Then, in Page Layout ribbon, go to Breaks, and add a Section Break with Continuous text flow.


It will look like this: Your endnotes are now appearing after the section break.


Format them as Normal

small bug in scriptingrt

it’s only a small bug, but it still cost me a while to track this down: when you set up a testpart, scriptingrt apparently gets mightily confused if you assign the same keys to both positive and negative response. E.g., positive=”keyboard.space.release” negative=”keyboard.I.release”. In my case, this prevented the following TestPart to be presented. Weird and surprising. So don’t do this.

embedding scriptingrt in qualtrics in chrome

In earlier posts and the manual we described how to embed scriptingrt files in qualtrics.

There is now a problem with this. Qualtrics serves its pages using secure http, or https. However, when you put your own flash files and the swfobject javascript library on your server, these servers will usually be regular http. Until recently, that was not a problem, but as of recently, Chrome bulks at this combination: When it displays a http website, it will not include anymore “unsafe”, regular http content. You recognize this when the small silver shield appears in the address bar. Or you can open the developer console, where you see the error message.

As a result, your flash file is not shown in Chrome. At the moment, Firefox and IE will still show it, but that might go away soon as well.

The solution is to serve your content from a secure http server as well.

Unfortunately, it is not cheap. My service provider charges over 70 € per year for a registered SSL certificate, and nothing else will do. However, there is a workaround: You can put your files in a your dropbox. Both links in the “public” dropbox folder and “share links” seem to come from https by default.

I quickly tested this last week, it seems to work. Also, it seems to work that these dropbox-served flash files then send their data to a php script on a regular (non https) server.

If that doesn’t work for you, please comment below.

In principle, though, dropbox-served files will probably load more slowly. So it might be a good idea to either get access to your institution’s https server, or to upgrade your own.

UPDATE 11/10/2013: it seems that is not a problem anymore? At least in a first test today, it was possible again to include non-https-served flash files in qualtrics.

problem with setting some attributes by scripts in ScriptingRT

When we write ScriptingRT experiments with between participant manipulations, we want to put as much as possible in scripts, so that we don’t have to create separate versions.

This works well with some attributes. For instance, you can change the contents of a text of a <Text/> at runtime:

After defining the item,

<Item id="p1" type="-"> 
    <mx:Text id="p1upt" verticalCenter="+150" horizontalCenter="0" text="?"/> 
  private function initVars():void {
    p1upt.text = "kite";

This also works for attributes like instruction of an <Instruction/>

However, it does not work when I try to change the attributes positive and negative of a <Testpart/>. I am not sure why this doesn’t work, presumably because this is used to build the item data structure before the item is evaluated at runtime.