FEZ Domino and Phidgets boards

I’ve already downloaded these :wink: This has been really very helpful, but some subtelties plus the fact that I’m far from being a C guru make things hard…
I thought I had already mentionned that fact. For example, that’s how I saw that the 8 analog outputs values were sent in 2 packets of 4 :stuck_out_tongue:

Also, guys at Phidgets were very helpful too, explaining why this or how that.

For my particular “problem”, Phidgets told me that I should poll until I get no errors :wink: I believe them, but not fully : their drivers fire an attached event when the board is usable, so there should be a mean to detect this condition.
But, as I said just before, I think the simple polling seems enough.

Right now, the Attached event is also fired and I’m adding code to get some properties of the boards like Serial number or Name, which are also sent via USB.

At the moment, I’m wondering if it wouldn’t be better to take the same structure than theirs and try be as similar as possible to their Windows counterpart…

I thought I had already mentioned that fact.

Oops, I did not see where you were talking about the sources. Sometimes it is hard trying to figure out what someone was trying to accomplish when they wrote a piece of code. Even when you come back to something you have not worked on for months it can take a while to figure things out again.

Most code has very poor documentation as well. I have played around with the Cypress PSoC chips a lot and have always been super impressed with how well they documented their assembly code. It was easy to see from the summary at the head of each function what they intended for it to do, what registers were used and/or effected etc.

I too can’t find where I wrote that I’ve used their C sources on this forum :frowning: I apologize for not having said that before. It was so obvious to begin with the original source code…

In fact, after some searchs, I found that I’ve written this info in a thread on the Phidgets board… That’s why you didn’t find it here :confused:

About code documentation, you’re right. But in cases like this one, where most of the time is try/fail/search, documentation is not the primary goal. That may explain that after the code is working it is left “as is”, without comments just because it now works.

I’ve just updated the 1018 driver (on the project page) with the following :
[list]
[li]new properties added : Name, Serial and Sensitivity[/li]
[li]new event added : Attached[/li]
[li]no more exceptions when the 1018 board attaches to the Domino[/li]
[/list]

Name and Serial are taken directly from the board.
Sensitivity permits to reduce the number of events fired for the analog inputs.
The Attached event is now fired when the board is really ready. Users should use this event to avoid exceptions at startup. [color=red]The board is not ready for use until this event has been fired.[/color];

Screenshot showing that no exceptions were thrown after startup including first “real” event (button pressed, here) :

Next revision will probably include support for the 1019, which is roughly the same board but with a USB hub on board. [url]I/O Boards Products at Phidgets

Project file has been updated :
[list]
[li]Complete support of the Phidget1023 RFID board : [url]http://www.phidgets.com/products.php?category=14&product_id=1023[/url] [/li]
[li]The project file now contains all the VS2008 solution, with separate assemblies : FEZPhidgets and FEZPhidgets.Events. It’s more clear and gives a quick start to users.[/li]
[li]Renamed the Attached event to Attach so I can include the new “Attached” property[/li]
[li]Renamed many properties in 1018,1052 & 1023 classes to be more consistent with the original Phidgets namings.[/li]
[/list]

Now, many (if not all) of the properties can be used via polling, though I think that an event driven program is better. Btw, the test/sample program in the project is event driven only :

static Phidget1018 IF1018 = new Phidget1018();
        static Phidget1052 Encoder1052 = new Phidget1052();
        static PhidgetRFID MyRFID = new PhidgetRFID();

public static void Main()
        {
            IF1018.InputChange += Phidget1018_InputChange;
            IF1018.SensorChange += Phidget1018_SensorChange;
            IF1018.Attach += IF1018_Attached;

            Encoder1052.PositionChange += Phidget1052_PositionChange;
            Encoder1052.InputChange += Phidget1052_InputChange;

            MyRFID.Attach += MyRFID_Attached;
            MyRFID.Tag += MyRFID_Tag;
            MyRFID.TagLost += MyRFID_TagLost;

            Thread.Sleep(Timeout.Infinite);
        }

Next step will be to rewrite the project page as it looks a litlle bit messy, right now :confused:
The only thing that I wanted to know before doing so is : does anyone (apart from me) use this project ? If I’m the only one, then I don’t need a good project page :wink:

Next step : using the Phidget 1062 Stepper controler. It’s a 4 unipolar controler.

Here’s a video of my first attempt : [url]http://www.lsp-fr.com/FEZ/FEZPhidget1062.mpeg[/url]

Code will of course be very simple, like the one that runs on the video :

static void Bouton_OnInterrupt(uint data1, uint data2, System.DateTime time)
        {
            if (data2 == 0)
            {
                Stepper.TargetPosition = 1000;
                Stepper.Engaged = true;
            }
        }

I have to admit that this board is a tough one ! :confused: But I think that the (personnal) reward will be enough to forget the hard work :wink:

This is sweet :smiley:

You need a youtube account for your cool videos :wink:

Very nice. I’ve been watching your progress very carefully. I used a couple of Phidgets 1063 bipolar drivers for a custom control I built for a company a few months ago. It is kind of interesting to think of what all could be done with a FEX and Phidgets combo.

[url]FEZPhidget1062.mpeg - YouTube :wink:

Terrific :slight_smile: