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.

zee's Content

There have been 47 items by zee (Search limited from 17-June 23)


By content type

See this member's


Sort by                Order  

#48199 Parallax Ping))) Ultrasonic Sensor

Posted by zee on 09 April 2013 - 02:17 AM in Project Showcase

Hi Afulki,

 

There are no errors in the coding but i received this error when running the program.

 

'The project must have either an output type of Console Application', or an output type of Class Library and the start action set to a valid .NET MicroFramework application'

 

What does the error means? Your guidance are really appreciated :) Thanks..




#47216 Piezo on Netduino ?

Posted by zee on 15 March 2013 - 03:46 AM in General Discussion

Hi,

 

I need help here.. I am now doing a project for drum using piezo & led.. I have been researching for it for almost a week, but the results seem to be only for Arduino Uno. I could not find any help on the codes for Netduino Plus 2. Is there any codes that is similar to this project?




#47168 Piezo sensor

Posted by zee on 14 March 2013 - 02:57 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi..

 

I need help here! I am doing a project for drum with led lights up upon hit the piezo. Can arduino codes be used for netduino plus 2? Researching since just now and the results are all for arduino uno.




#46858 PWM - Deploy Fail

Posted by zee on 08 March 2013 - 12:37 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi.. Thanks for the quick reply.. I did not set any frequency on it.

 

Here are my codes..

 

 

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
 
namespace Dimmer_PWM
{
    public class Program
    {
        public static void Main()
        {
            // write your code here
 
            SecretLabs.NETMF.Hardware.PWM led = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D5); 
            SecretLabs.NETMF.Hardware.AnalogInput pot = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);
            pot.SetRange(0, 100);
            int potValue = 0; //store and retrieve the potentiometer's current position
 
            while (true)
            {
                //read the value of the potentiometer
                potValue = pot.Read();
 
                //change the led intensity base on the potentiometer's value (0-100%)
               led.SetDutyCycle((uint) potValue);
                             
            }
 
        }
 
    }
}



#47215 PWM - Deploy Fail

Posted by zee on 15 March 2013 - 03:37 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi zee, The code looks fine at first glance. Let's check out the other variables... What board are you using? Netduino? Netduino Plus 2? When you open up project properties, and then go to the .NET MF tab...do you see your Netduino in the device pulldown? When deployment fails, go to the Output tab in Visual Studio. If it shows more information about what failed during deployment, please post that info here. Chris

 

Hi Chris,

 

Thanx for the response..

 

I am using Netduino Plus 2.. Yes, there is Netduino in the device pulldown.. 

The error in the output tab, stated "Unable to communicate with device - USB:Netduino"..




#46813 PWM - Deploy Fail

Posted by zee on 07 March 2013 - 09:02 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

This is my second time try to run this project. Its from the 'Getting Started with Netduino' on Chapter 6, Dimmer Code..I have installed the SecretLabs.NETMF.Hardware.PWM and there is no error in the code. However, when it is running, it states that "unable to communicate with device - USB:Netduino" under the output tab.

There is also a message box pop-up "There were deployment errors. Continue?".

 

 

Please help me !!! Thank you!




#48424 RTTTL - Ringtone Player

Posted by zee on 16 April 2013 - 03:31 AM in General Discussion

I think the Queue class is found within the the System.Collections namespace, so try changing from just new Queue() to new System.Collections.Queue() or probably better to simply add this statement in the beginning of Program.cs

 

using System.Collections; 

 

You might also want to look at this post also covering an RTTL player:

 

http://forums.netdui...sed-controller/

 

Yes yes.. It works! Thank you Hanzibal  :D




#48404 RTTTL - Ringtone Player

Posted by zee on 15 April 2013 - 09:35 AM in General Discussion

Hi,

 

I am currently doing a project on ringtone player. This code we found on http://dev-bin.com/2...e-player-rtttl/ .. Hence we decided to try it out and we found an error in Program.cs. We try to solve it by refer to the reference on the link but it did not seem to work.

 

static Queue SongQueue = new Queue();

 

 

Error 1 The type or namespace name 'Queue' could not be found (are you missing a using directive or an assembly reference?) C:UsersL33532DesktopMidPresentationMidPresentationProgram.cs 18 16 MidPresentation
Error 2 The type or namespace name 'Queue' could not be found (are you missing a using directive or an assembly reference?) C:UsersL33532DesktopMidPresentationMidPresentationProgram.cs 18 38 MidPresentation
 
 
PS: Need your help as soon as possible because our deadline is in 2 more days. URGENTTTT!!!  :o  :unsure:  :wacko:
 
Thanx.. :)

Attached Files




#49321 Set password on touch shield with servo

Posted by zee on 10 May 2013 - 01:18 AM in General Discussion

Oh. Thanx Hanzibal. Will try to work it out.  :)




#49203 Set password on touch shield with servo

Posted by zee on 08 May 2013 - 01:27 AM in General Discussion

Hi,

 

Thank for the quick response. You mean, touch shield can't be used for password? In order for me to use a servo to do some actions, I need to use something like this?

 http://www.karlssonr...CFVSVMgodv04AEw

or

https://www.sparkfun.../products/10250

 

 

I'm sorry for this noob question. But, what else can touch shield do?




#49131 Set password on touch shield with servo

Posted by zee on 07 May 2013 - 01:59 AM in General Discussion

Hi,

 

Has anyone tried to do a project on touch shield with servo? It is to set a correct password on the touch shield and servo will turn it if the button been pressed correctly. 

 

I did followed the codes from http://forums.netdui...=+touch +shield and I am using the same product https://www.sparkfun.../products/10508

 

I still could not understand of how and where to insert the code for setting password and connect together with servo (if possible).




#49405 Sparkfun PIR motion sensor

Posted by zee on 14 May 2013 - 02:44 AM in Project Showcase

Hi,

 

Need help here!

What's the problem here?  :wacko:  :unsure:

Connected to 10K Ohm & PullUp.. But it keep prompts me this error.

 

Attached Thumbnails

  • PIR Error.jpg



#47869 ToggleButton sample

Posted by zee on 01 April 2013 - 03:25 AM in Project Showcase

Hi zee, Your button class isn't being used in your main program, so the button is acting as a software reset button (its default state). Chris

 

 

Hi Chris,

 

But it works as it stopped the song and continue it automatically after few seconds. Could you guide me how should i put the Button class in Program.cs? Is it supposed to be in 2 different classes as shown above or all in one class?




#47615 ToggleButton sample

Posted by zee on 27 March 2013 - 05:17 AM in Project Showcase

Program.cs 

 

 

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
using System.IO.Ports;
using System.Text;
 
namespace PushButton_OutputMusic
{
    public class Program
    {
        private static SecretLabs.NETMF.Hardware.PWM speaker = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D5);
 
        static System.Collections.Hashtable scale = new System.Collections.Hashtable();
 
        public static void Main()
        {
 
            while (true)
            {
                GetSound();
             
            }
        }
 
        private static void GetSound()
        {
             
            //low octave
            scale.Add("c", 1915u);
            scale.Add("d", 1700u);
            scale.Add("e", 1519u);
            scale.Add("f", 1432u);
            scale.Add("g", 1275u);
            scale.Add("a", 1136u);
            scale.Add("b", 1014u);
 
            // high octave
            scale.Add("C", 956u);
            scale.Add("D", 851u);
            scale.Add("E", 758u);
            scale.Add("F", 191u);
            scale.Add("G", 170u);
            scale.Add("A", 153u);
            scale.Add("B", 136u);
            scale.Add("C2", 127u);
 
            // 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);
 
            string song = "C1C1C1g1a1a1g2E1E1D1D1C2h"; //old macdonald
            song += "C1C1G1G1A1A1G2F1F1E1E1D1D1C2h"; //twinkle little star
 
            while (true)
            {
 
                for (int i = 0; i < song.Length; i += 2)
                {
                    //song loop
 
                    string note = song.Substring(i, 1); 
                    int beatCount = int.Parse(song.Substring(i + 1, 1)); 
 
                    uint noteDuration = (uint)scale[note];
 
                    speaker.SetPulse(noteDuration * 2, noteDuration); 
 
                    Thread.Sleep(beatTimeInMilliseconds * beatCount - pauseTimeInMilliseconds);
 
                    speaker.SetDutyCycle(0); //set to 0, turn the piezo off momentarily
                    Thread.Sleep(pauseTimeInMilliseconds);
 
                } 
 
               Thread.Sleep(1000);
 
            }
        }
 
     
    }
}

 

Next, Button.cs

 

using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;
 
namespace PushButton_OutputMusic
{
    class Button
    {
        InterruptPort button;
        OutputPort led;
        bool ledState;
 
        public void buttonToggle()
        {
        ledState = true;
 
            led = new OutputPort(Pins.ONBOARD_LED, ledState);
            button = new InterruptPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeLow);
 
            //bind the interrupt handler to the pin's interrupt event
            button.OnInterrupt += new NativeEventHandler(SwitchInterruptHandler);
 
            while (true)
            {
 
                Thread.Sleep(Timeout.Infinite);
             
            } 
        }
 
        public void SwitchInterruptHandler(UInt32 data1, UInt32 data2, DateTime time)
        {
 
            button.DisableInterrupt();
 
            //invert the previous state of the LED
            ledState = !ledState; 
 
            //set the LED to its new state
            led.Write(ledState);
 
            button.EnableInterrupt();
        }
    }
}

 

 

Is this correct? The song auto play after i deploy. Then i pressed the button, the song stop and it starts automatically in few seconds. My objective is to make the song start and stop when pressing the button on Netduino..




#47614 ToggleButton sample

Posted by zee on 27 March 2013 - 02:39 AM in Project Showcase

Put your song code in a separate thread.  Start and stop the thread using the button toggle code.

 

Hi Dave,

 

You mind explain to me the steps? I am soooo noob in this netduino. Really new to me. Is it add new class or add new project?

I did tried to add both, but received few errors. Putting them in a different project, no errors but how to link? Add class, received lots of errors.

Appreciate your help :)




#47578 ToggleButton sample

Posted by zee on 26 March 2013 - 01:20 AM in Project Showcase

Hi Dab,

 

Is there any way that piezo speaker can be on/off too upon pressing the toggle button? I have a project to do, where song will be play through piezo if the button is been press & led on, and the song will be stop when the button been press again & led off.




#48876 Touch Shield

Posted by zee on 30 April 2013 - 09:25 AM in General Discussion

Problem solved !  B)  :D  B)  :D

 

One of the jumper is faulty. HAHA! :D




#48875 Touch Shield

Posted by zee on 30 April 2013 - 09:16 AM in General Discussion

I don't fully understand what you mean by "from shield board TX to resistor (with SDA) to D2" though?

 Ignore this. Haha!

 

I did found the solution Last Friday and when i want to try again today, seems like its not working. Whats happening??  :wacko:  :blink:

 

This should be correct right?

readonly InterruptPort irqpin = new InterruptPort(Pins.GPIO_PIN_D2, true, ResistorModes.PullUp, Port.InterruptMode.InterruptEdgeLow);

 

Both resistors are connectec to 5V. 1 resistor will wired up to SDA and the other resistor to SCL. And, InterruptPort is directly connected from touch shield to D2. Right?




#48678 Touch Shield

Posted by zee on 24 April 2013 - 03:18 AM in General Discussion

Hi,

 

I am doing on a project for home security. I decided to add in the touch shield https://www.sparkfun.../products/10508. I am sure the codes are all correct as when i run it, there is no error. But i am curious about my wiring. Unsure if it is correct or wrong.

 
Connected with 2 1K resistors. 1 resistor for SCL and the other for SDA. It is connected together with the 5V from the netduino board. 3.3V directly connected from the netduino to the touch shield. Interrupt port on D2 with ResistorModes.PullUp (from shield board TX to resistor (with SDA) to D2).. All grounds are connected.
 
Is there any missing or errors on my wiring?



#48679 Touch Shield

Posted by zee on 24 April 2013 - 03:18 AM in General Discussion

Btw, i am using Netduino Plus 2




#48198 uPLibrary : a .Net Micro Framework Helper Library

Posted by zee on 09 April 2013 - 02:02 AM in Project Showcase

Hi Paolo,

 

Just to clarify, to do a project on ultrasonic for distance measurement, is it a must to have this library? If yes, i encountered this errors and need your help. Thanx..

 

I tried to install the package but it show me this errors:

 

 

PM> Install-Package uPLibrary
Install-Package : The current environment doesn't have a solution open.
At line:1 char:16
+ Install-Package <<<<  uPLibrary
    + CategoryInfo          : InvalidOperation: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.InstallPackageCommand
 
 



#46999 Yet another supported shield question (GPS)

Posted by zee on 11 March 2013 - 03:04 AM in Netduino 2 (and Netduino 1)

P.S.

Here's some very rough test code I put together to make sure we were getting data from the GPS receiver. You might want to put this in an event handler-based class which parsed the data out and raised events whenever a new location was received.

But this will show you your GPS data stream Posted Image I've put a 100ms delay in between each iteration of the loop so that we're not getting and printing one byte of data at a time.

I plugged TX, RX, and PWR into pins D0, D1, and D2. This corresponds to serial port 1 (COM1) and a "powerpin" of D2.
 

using System;using System.IO.Ports;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.Netduino;namespace GpsLogger{    public class Program    {        public static void Main()        {            // write your code here            SerialPort serialPort = new SerialPort("COM1", 4800, Parity.None, 8, StopBits.One);            serialPort.Open();            // pin D2 off = gps module turned on            OutputPort powerPin = new OutputPort(Pins.GPIO_PIN_D2, false);            while (true)            {                int bytesToRead = serialPort.BytesToRead;                if (bytesToRead > 0)                {                    // get the waiting data                    byte[] buffer = new byte[bytesToRead];                    serialPort.Read(buffer, 0, buffer.Length);                    // print out our received data                    Debug.Print(new String(System.Text.Encoding.UTF8.GetChars(buffer)));                }                Thread.Sleep(100); // wait a bit so we get a few bytes at a time...            }        }    }}

 

Hi Chris,

 

May i know what will be the output like?

There's no error but im just wondering how will the output like?

Sorry for my noob question. Im soooo new to this sensor device.. :)





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.