FEZ Spider II Tinker Kit

I own this kit

https://www.ghielectronics.com/catalog/product/543

and start using first sample to understand how kit work.

i tried to use LedStrip module with default sample but i face one problem

how to connect modules in Tinker Kit -because i connected in the way was presented on picture
https://www.ghielectronics.com/catalog/product/543

code i used is



using System;
using Microsoft.SPOT;
using System.Threading;

namespace MyAPP
{
    public class Program
    {
        public static void Main()
        {
            Gadgeteer.Modules.GHIElectronics.LEDStrip ledStrip = new Gadgeteer.Modules.GHIElectronics.LEDStrip(0);


            for (var i = 0; i < ledStrip.LedCount; i++)
            {
                ledStrip.TurnLedOff(i);
                Thread.Sleep(200);
            }

            for (var i = 0; i < ledStrip.LedCount; i++)
            {
                ledStrip.TurnLedOff(i);
                Thread.Sleep(200);
            }

            ledStrip.TurnAllLedsOn();
            Thread.Sleep(500);

            ledStrip.TurnAllLedsOff();
            Thread.Sleep(500);
        }
    }
    }

after starting debugin and deploy

i get message

An unhandled exception of type ‘Gadgeteer.Socket.InvalidSocketException’ occurred in Gadgeteer.dll

Additional information: Module LEDStrip cannot be used with invalid socket number 11

1 Like

.LEDStrip(0); is it plugged in socket 0?

resolved problem

used

but now i created new project with Gadgeter not pure .NET

now Gadgeter showed me that socket was number 11

like picture https://www.ghielectronics.com/catalog/product/543

with code as below now it work

Program.cs


using System;
using System.Threading;

using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;

namespace GadgeteerApp2
{
    public partial class Program
    {
        void ProgramStarted()
        {
          
            while(true)
            { 
            for (var i = 0; i < this.ledStrip.LedCount; i++)
            {
                this.ledStrip.TurnLedOn(i);
                Thread.Sleep(200);
            }

            for (var i = 0; i < this.ledStrip.LedCount; i++)
            {
                this.ledStrip.TurnLedOff(i);
                Thread.Sleep(200);
            }

            this.ledStrip.TurnAllLedsOn();
            Thread.Sleep(500);

            this.ledStrip.TurnAllLedsOff();
            Thread.Sleep(500);
            }
        }
    }
}

1 Like

Another more less code with pure .NET not throught gadgeter project but throuht MicroFramework Project -> Console App :slight_smile:
using MS Visual Studio 2015 and last GHI tools 2016…


using System;
using System.Threading;
using Microsoft.SPOT;

using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;


namespace DirectMode
{
    public class Program
    {
        public static void Main()
        {
            // Debug.Print(Resources.GetString(Resources.StringResources.String1));
            GHIElectronics.Gadgeteer.FEZSpiderII fs2= new GHIElectronics.Gadgeteer.FEZSpiderII();
            LEDStrip ledStrip = new LEDStrip(11);

            while (true)
            {
                for (var i = 0; i < ledStrip.LedCount; i++)
                {
                    ledStrip.TurnLedOn(i);
                    Thread.Sleep(200);
                }

                for (var i = 0; i < ledStrip.LedCount; i++)
                {
                    ledStrip.TurnLedOff(i);
                    Thread.Sleep(200);
                }

                ledStrip.TurnAllLedsOn();
                Thread.Sleep(500);

                ledStrip.TurnAllLedsOff();
                Thread.Sleep(500);
            }

        }
    }
}

my first impression was

fast upload ,good and easy deployment

nice tools from GHI Peoples so now i could play in .NET
(becayse yesterday i burn Stm32F407VGT6 by just pluging OTG cable chip set fire)

@ valon.hoti@ gmail.com - you are becoming a master quickly :slight_smile:

1 Like

i have a strong background in .NET
(since alfa version and beta testing),and arduino - pic controllers too.

but i always wanted to use one Programming Language for all my works

example
Windows Programming
Web Programming
Additional Extension for WEB / Windows and MS SQL througt CLR

but on the electronics i missing .NET (so GHI now eliminate that gap to me)

so i started playing with FEZ Spider II Tinker Kit

thanks a lot for such great products

@ valon.hoti@ gmail.com - stick around here and you will learn a lot about electronics. Many of us have.

3 Likes

Welcome @ Valon

One tip for you…

[quote]void ProgramStarted()
{
while(true)[/quote]
Don’t use anything that blocks ProgramStarted from finishing, as the Gadgeteer framework still has things to finish setting up. Spawn a new thread and exit.
https://blogs.msdn.microsoft.com/net_gadgeteer/2011/12/19/why-not-whiletrue/

2 Likes

@ Brett -

while(true) i used because of similiar way to ATMEL/PIC

i don’t want to use gadgeter way
(because of no support in future)

but just drivers and console mode (pure .Net) maybe TinyClrOS is what i want.

But for now all what i want is to use arduino sensors too.

dht11,hc-sr04,pir,leds,i2c oled 128x64,i2c 1602 lcd,dust sensors,sim800e,mfrc522 rfid,rdm630 rfid etc

i have a little questions did exist those libraries and schema which pins are used on each socket on Fez Spider II to be able to use with those Arduino sensors.

thanks a lot again.

Gadgeteer framework as it stands is still fine, if you want to use it. But it’s not necessary if you are happy just to use standard netmf (and TinyCLR OS when it’s available). Just remember to let ProgramStarted() finish when you do :slight_smile:

Most of those devices will be no trouble. If you look on Codeshare (search box above, change the dropdown to codeshare) for each of them you’ll likely find many of them in code examples ready to use - you might just need to watch netmf version differences as many of them may not have been updated from when they were written.

As far as schematics go, head over to the Fez Spider II page and you’ll see the resources listed there. And for pin mapping / functions, you can see the Gadgeteer info in the section on the right of the support pagehttps://www.ghielectronics.com/support/netmf.

@ Brett - I did not know that. Thanks to you Brett. Smarter Everyday!

EDITED:

where to get this doc:

http://files.ghielectronics.com/downloads/Schematics/FEZ/FEZ%20Spider%20II%20Schematic.pdf

is missing from link ??

Here’s a link to it:

http://files.ghielectronics.com/downloads/Schematics/FEZ/FEZ%20Spider%20II%20Rev%201.0%20Schematic.pdf

Were changing how we host schematics – the links to schematics should be working in the near future.

2 Likes