Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Gobus with Netduino 3

gobus rgb led buzzer potentiometer netduino 3

  • Please log in to reply
17 replies to this topic

#1 tridy

tridy

    Advanced Member

  • Members
  • PipPipPip
  • 68 posts
  • LocationStockholm, Sweden

Posted 07 May 2015 - 09:17 PM

Hello.

 

I have got:

 

RGB Led

Buzzer

Potentiometer

 

gobus modules together with Netduino 3.

 

Are there any examples on how to communicate with them from Netduino 3?

 

Thanks!



#2 HSven1611

HSven1611

    Member

  • Members
  • PipPip
  • 14 posts

Posted 08 May 2015 - 05:50 AM

As far as I understood, the GoBus Libraries are still for NETMF4.2 but the ND3 Wifi needs NETMF4.3. 

It seems, we'll have to wait for the new SDK to be released...



#3 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 08 May 2015 - 10:10 AM

I'd have thought that the Netduino GO! code would be a good starting point.  Have a look at Pete Brown's write up on the GO!

 

Hope this helps,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#4 cr0w5t3r

cr0w5t3r

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationUK

Posted 08 May 2015 - 07:23 PM

I'm also trying to find examples on how to use the Netduino GO! modules from N3. However my current problem is I'm unsure how to add a reference to the right assemblies as it seems to error when I add a reference to SecretLabs.NETMF.Hardware.NetduinoGo.dll (V4.2.2.0).

 

Anyone have any ideas?

 

I'm currently using V4.3.2.1 and VS2K13.

 

Thanks in advance,

Nick



#5 tridy

tridy

    Advanced Member

  • Members
  • PipPipPip
  • 68 posts
  • LocationStockholm, Sweden

Posted 08 May 2015 - 11:19 PM

I'd have thought that the Netduino GO! code would be a good starting point.  Have a look at Pete Brown's write up on the GO!

 

Hope this helps,

Mark

 

Thanks for the link. Pete Brown writes about Netduino GO there, and it runs on 4.2 SDK. Netduino 3, on the other hand, runs on 4.3 SDK and RgbLed class was in 4.2 for NetduinoGO:

 

Attached File  42_43.png   412.79KB   0 downloads

 

I was hoping to get a (what I hope to be a failry simple) code example on how to communicate with RgbLed connected to GO Port 1 on Netduino 3. I have found Matt Isenhower's post GoBus: An Alternate Approach which I think shows how to do it, and I tried to extract the code that has to deal specifically with Netduino 3 and RgbLed but did not succeed for now. I will experiment more, but there are some steps there for preparation, like a hub and a port that need to be created first with some parameters. I will try some more later.

 

For now I just wanted to verify if the three modules really work, just in case if I need to return them for replacement.



#6 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 09 May 2015 - 04:26 AM

Hi tridy.net,

You can download the latest Netduino SDK here:
http://cdn.netduino....netduinosdk.exe

That version (currently 4.3.2) includes the new Universal Netduino Application template which works with all gen2 and gen3 boards including Netduino Go. It includes 4.3 drivers for all Netduino Go modules as well.

You should be able to use existing Netduino Go code as-is.

We have a lot to cover on the new SDK (which will probably require quite a few posts)... In the meantime, let me know if you run into any troubles.

Chris

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 09 May 2015 - 04:27 AM

Hi Nick,

I'm also trying to find examples on how to use the Netduino GO! modules from N3. However my current problem is I'm unsure how to add a reference to the right assemblies as it seems to error when I add a reference to SecretLabs.NETMF.Hardware.NetduinoGo.dll (V4.2.2.0).

The SecretLabs.NETMF.Hardware.NetduinoGo.dll assembly is a legacy assembly at this point. Just create an app using the new Universal Netduino Application template and add in the driver DLLs for the Netduino Go modules you want to use.

Does that get you on the right path?

Welcome to the Netduino community,

Chris

#8 tridy

tridy

    Advanced Member

  • Members
  • PipPipPip
  • 68 posts
  • LocationStockholm, Sweden

Posted 09 May 2015 - 08:54 AM

Hi tridy.net,

You can download the latest Netduino SDK here:
http://cdn.netduino....netduinosdk.exe

That version (currently 4.3.2) includes the new Universal Netduino Application template which works with all gen2 and gen3 boards including Netduino Go. It includes 4.3 drivers for all Netduino Go modules as well.

You should be able to use existing Netduino Go code as-is.

We have a lot to cover on the new SDK (which will probably require quite a few posts)... In the meantime, let me know if you run into any troubles.

Chris

 

Great! It seems to work, with adding reference to NetduinoGo.RgbLed.dll

 

 

Attached File  universal_app_rgb_led.png   43.77KB   7 downloads

 

working:

 

Attached File  NT3+RGBLED.jpg   46.86KB   2 downloads

 

there were a couple of invalid addresses warnings in the output window. Is it something to be worried about?

 Invalid address 0 and range 40 Ram Start 20000000, Ram end 20030000

'Microsoft.SPOT.Debugger.CorDebug.12.dll' (Managed): Loaded 'C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.3\Assemblies\le\Microsoft.SPOT.Hardware.Usb.dll', Symbols loaded.
 Invalid address 1000fbb4 and range 4 Ram Start 20000000, Ram end 20030000

 Invalid address 0 and range 40 Ram Start 20000000, Ram end 20030000

 Invalid address 1000fbb4 and range 4 Ram Start 20000000, Ram end 20030000

'Microsoft.SPOT.Debugger.CorDebug.12.dll' (Managed): Loaded 'Netduino.IP'
'Microsoft.SPOT.Debugger.CorDebug.12.dll' (Managed): Loaded 'Netduino.IP.Interop'
 Invalid address 0 and range 40 Ram Start 20000000, Ram end 20030000

 Invalid address 1000fbb4 and range 4 Ram Start 20000000, Ram end 20030000

Thanks!



#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 09 May 2015 - 09:05 AM

there were a couple of invalid addresses warnings in the output window. Is it something to be worried about?

No worries. That's extra debug output from the runtime boot. We should probably remove that in a future firmware update...

NETMF has some interesting warning messages. There used to be a warning message which seemed to indicate that the garbage collector had failed. In reality it was just warning that memory was low so it had to collect garbage. So we changed its text to something like "compacting memory". :)

Chris

#10 tridy

tridy

    Advanced Member

  • Members
  • PipPipPip
  • 68 posts
  • LocationStockholm, Sweden

Posted 09 May 2015 - 11:31 AM

Nice! I have tested all 3 components in combination, and all of them work with Universal Project template 4.3.2 SDK!

 

video: http://1drv.ms/1QvSMNr

 



#11 Robert Hugo

Robert Hugo

    Advanced Member

  • Members
  • PipPipPip
  • 35 posts

Posted 13 May 2015 - 12:10 AM

With such a generic title, I felt bad about creating a new topic about the Gobus. I am pretty sure that I've asked before, but I am hoping for an update. :) Will it be possible to attach more than one Shield Base, e.g. one on each of the three ports, on the N3 (and the NGo, for that matter). I haven't followed any updates for a while (sorry to say) so if it's been covered, I am sorry to iterate the question.



#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 May 2015 - 01:15 AM

Hi Robert,

Will it be possible to attach more than one Shield Base, e.g. one on each of the three ports, on the N3 (and the NGo, for that matter).

A bit later this year, you will be able to plug a Shield Base into a Netduino 3 board. That will give you more GPIOs and AnalogInputs--and a dozen more interrupts as well.

Short-term, Netduino Go (4.3.2 beta) will be getting support for two simultaneous shield bases. Longer-term we will remove that limitation completely as we move Shield Base from UART to SPI transport.

When Netduino 3 adds support for Shield Base, you will be able to plug in a Shield Base to each GoBus port. Just watch out to make sure you don't overload the power system by loading up a bunch of power-hungry shields :)

Chris

#13 volleynerd

volleynerd

    Member

  • Members
  • PipPip
  • 11 posts

Posted 14 May 2015 - 12:45 AM

Hi guys - newbie here, trying to get a few GoBus modules (button and buzzer) working with some code.  

Can you post or point me to some sample lines of code to connect to and manipulate those via a GoBus port?  

 

(Netduino 3 board, and I have the latest 4.3.2 Netduino SDK as linked above.)

 

Thanks!



#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 May 2015 - 01:16 AM

Hi volleynerd,

To add the modules to your project, right-click on References and add in their DLLs (NetduinoGo.Button.dll, NetduinoGo.PiezoBuzzer.dll, etc.).

For the button: just create an instance and then wire up its Pressed and Released events. You can also manually check its current state.

For the Piezo Buzzer, here is some sample code. Name that tune :)
            NetduinoGo.PiezoBuzzer piezo = new NetduinoGo.PiezoBuzzer();

            // store the notes on the music scale and their associated pulse lengths
            System.Collections.Hashtable scale = new System.Collections.Hashtable();

            // low octave
            scale.Add("c", 261.626f);
            scale.Add("d", 293.665f);
            scale.Add("e", 329.628f);
            scale.Add("f", 349.228f);
            scale.Add("g", 391.995f);
            scale.Add("a", 440.000f);
            scale.Add("b", 493.883f);
            // high octave
            scale.Add("C", 523.251f);
            scale.Add("D", 587.330f);
            scale.Add("E", 659.255f);
            // silence ("hold note")
            scale.Add("h", 0u);

            int beatsPerMinute = 90;
            int beatTimeInMilliseconds =
            60000 / beatsPerMinute; // 60,000 milliseconds per minute
            int pauseTimeInMilliseconds = (int)(beatTimeInMilliseconds * 0.1);

            // define the song (letter of note followed by length of note)
            string song = "C1C1C1g1a1a1g2E1E1D1D1C2";

            // interpret and play the song
            for (int i = 0; i < song.Length; i += 2)
            {
                // extract each note and its length in beats
                string note = song.Substring(i, 1);
                int beatCount = int.Parse(song.Substring(i + 1, 1));
                // look up the note duration (in microseconds)
                float noteFrequency = (float)scale[note];
                // play the note for the desired number of beats
                piezo.SetFrequency(noteFrequency);
                Thread.Sleep(beatTimeInMilliseconds * beatCount - pauseTimeInMilliseconds);
                // pause for 1/10th of a beat in between every note.
                piezo.SetFrequency(0);
                Thread.Sleep(pauseTimeInMilliseconds);
            }
Does that get you up and running?

Chris

#15 volleynerd

volleynerd

    Member

  • Members
  • PipPip
  • 11 posts

Posted 14 May 2015 - 03:35 PM

Doh!  Straight forward once I add references to the GO modules.  

So far have not found any API documentation specific to the GO modules, is there some available that I'm missing?  I probably should have just gone spelunking around.

 

Yep, Old MacDonald!!  :)

 

Thanks a lot for the quick response and help.



#16 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 May 2015 - 05:43 PM

Hi volleynerd,

Yay! :)

That's really good feedback. The GoBus modules are pretty self-explanatory, but we should probably make up a set of demos and docs for them as well. We need to get the 8 spring/summer modules out first--but I have put this on our list.

Chris

#17 cr0w5t3r

cr0w5t3r

    New Member

  • Members
  • Pip
  • 9 posts
  • LocationUK

Posted 14 May 2015 - 06:50 PM

Hi volleynerd,

Yay! :)

That's really good feedback. The GoBus modules are pretty self-explanatory, but we should probably make up a set of demos and docs for them as well. We need to get the 8 spring/summer modules out first--but I have put this on our list.

Chris

 

Out of curiosity what are the new modules going to be?  :)

 

Nick



#18 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 May 2015 - 08:12 PM

Hi Nick,

Out of curiosity what are the new modules going to be?  :)


Some details on the new modules; we're performance-tuning with the RS-232 module now, more to come.
http://forums.netdui...thank-you-gift/

Chris





Also tagged with one or more of these keywords: gobus, rgb led, buzzer, potentiometer, netduino 3

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.