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.

Geancarlo2's Content

There have been 70 items by Geancarlo2 (Search limited from 08-May 23)


By content type

See this member's


Sort by                Order  

#26958 Working around lack of timezone on ND+

Posted by Geancarlo2 on 11 April 2012 - 07:45 PM in Netduino Plus 2 (and Netduino Plus 1)

Maybe this http://tinyclr.com/forum/23/6474/ will work for you.



#26545 What's wrong with my string array declaration?

Posted by Geancarlo2 on 05 April 2012 - 03:10 PM in General Discussion

Not true, I have literally just created a jagged byte array for the project I am working on.

        private byte[][] workBuffer = new byte[2][] { new byte[35], new byte[35]};

You misunderstood my post because of the timing :)
byte[,] is a multidimensional array
byte[][] is a jagged array



#26526 What's wrong with my string array declaration?

Posted by Geancarlo2 on 05 April 2012 - 12:36 PM in General Discussion

As far as I remember multidimensional arrays aren't implemented in .netmf but you can use jagged arrays(string[][]).



#37165 What About PICAXE for 1-Wire Support

Posted by Geancarlo2 on 14 October 2012 - 05:52 PM in General Discussion

IMO, Netduino should provide One-Wire support in the standard firmware instead lol



#35753 timer question

Posted by Geancarlo2 on 22 September 2012 - 01:36 AM in Netduino 2 (and Netduino 1)

Given that your program knows when it is turning lights on or off, it's just a matter of storing what you did and when you did. If you know 100% sure that netduino will be working uninterrupted, you can probably use DateTime.Now and figure how to work your requirements out. Otherwise, you should consider getting a RTC chip with some memory+battery...



#31635 Target framework ?

Posted by Geancarlo2 on 05 July 2012 - 08:26 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi, here is a friend's blog post explaining the update process in portuguese: http://netduinobrasi...duino-plus.html Tip: Don't buy from any "open source hardware" shops in Brazil, they are overpriced and it's cheaper to import. Actually electronics overall in Brazil is overpriced due to our asinine government's priorities :)



#41070 static bool

Posted by Geancarlo2 on 06 December 2012 - 02:23 AM in Netduino 2 (and Netduino 1)

These two methods are not equivalent. The last one only Reads once. Did you mean something like this instead, which is definitely way too verbose?


I think you missed the last line inside the loop since you tried to assign a bool to a delegate :P



#40379 static bool

Posted by Geancarlo2 on 28 November 2012 - 04:56 PM in Netduino 2 (and Netduino 1)

You can't create static members in the scope of a method. If the compiler/vs doesn't let you, you are probably wrong...

This does what you want:

public static void Method_7()
        {
            bool nutrientState = phcontroller.Read();
            while (nutrientState == true)            
            {
                a.Write(false);
                Thread.Sleep(5454);
                a.Write(true);
                b.Write(false);
                Thread.Sleep(3000);
                b.Write(true);
                Thread.Sleep(5 * MinuteMs);
            }
        }


phcontroller.Read() is a method call and returns a bool. nutrientState stores the value returned. When you compare it in "nutrientState == true", phcontroller.Read() is not called again, the value stored in nutrientState is used.

Note that the way it is coded, the loop will run forever until the thread is aborted.



#40383 static bool

Posted by Geancarlo2 on 28 November 2012 - 06:43 PM in Netduino 2 (and Netduino 1)

No problem :P
in that case you can create the variable outside the scope of the method.

static bool nutrientState = false;//initial value
public static void Method_7()
        {
            nutrientState = phcontroller.Read();//read the port and assign result to nutrientState
            while (nutrientState == true)//run until nutrientState is set to false            
            {
                a.Write(false);
                Thread.Sleep(5454);
                a.Write(true);
                b.Write(false);
                Thread.Sleep(3000);
                b.Write(true);
                Thread.Sleep(5 * MinuteMs);
            }
        }

Here it is a static class member and you can set it to false somewhere else. Of course if you set nutrientState to false while it is performing the stuff inside the loop, it'll complete it first and then check nutrientState - if this is not the behaviour you want, you must take a moment and rethink how to implement your logic.



#40422 static bool

Posted by Geancarlo2 on 29 November 2012 - 01:45 PM in Netduino 2 (and Netduino 1)

The way that is coded it checks only once. To get the behaviour you want(check on each iteration):

public static void Method_6()
        {
            while (phcontroller.Read() && method_state_6)
            {
                ph.Write(false);
                Thread.Sleep(1 * SecondMs);
                ph.Write(true);
                Thread.Sleep(5 * MinuteMs);

            }
}

or +verbose:
public static void Method_6()
        {
            while (phcontroller.Read()==true && method_state_6 == true)
            {
                ph.Write(false);
                Thread.Sleep(1 * SecondMs);
                ph.Write(true);
                Thread.Sleep(5 * MinuteMs);

            }
}

or ++(really unnecessary)verbose:
public static void Method_6()
        {
            bool phState = phcontroller.Read();
            while (phState == true && method_state_6 == true)
            {
                ph.Write(false);
                Thread.Sleep(1 * SecondMs);
                ph.Write(true);
                Thread.Sleep(5 * MinuteMs);
                phState = phcontroller.Read();
            }
}

To be honest, I think you should study a good c# book before moving forward with your project... your questions are language/logic related. Don't let the difficulties discourage you, gather more knowledge and when you succeed it'll be even more gratifying.



#39646 Smartphone as control panel

Posted by Geancarlo2 on 19 November 2012 - 06:59 PM in Netduino Plus 2 (and Netduino Plus 1)

So you basically want an web server running on your Netduino http://forums.netdui...h__1#entry20317 + http://forums.netdui...h__1#entry23532



#39651 Smartphone as control panel

Posted by Geancarlo2 on 19 November 2012 - 08:05 PM in Netduino Plus 2 (and Netduino Plus 1)

Internet is not in this equation really. Like you said, all it takes is to be connected to the same access point, so you can connect to its local network address. Internet can be seen as an upperset of your local network.



#26223 simple code need help

Posted by Geancarlo2 on 01 April 2012 - 03:29 AM in Visual Studio

That line was pointed as unreachable because you probably forgot the brackets, so your while true loop would repeat "controller.Write(false);" indefinitely. :D


public static void Thread_5()
{
while (true)
{
controller.Write(false);
Thread.Sleep(1 * SecondMs);
controller.Write(true);
Thread.Sleep(10 * MinuteMs);
}
}
public static void Thread_6()
{
for (int i = 0; i < 14; i++)
{
Thread.Sleep(1 * DayMs);
solenoid.Write(false);
Thread.Sleep(20 * SecondMs);
solenoid.Write(true);
}

}



#26221 simple code need help

Posted by Geancarlo2 on 01 April 2012 - 02:56 AM in Visual Studio

This \/ is what I meant and you are missing the {} on your loops inside thread_5 and 6. In terms of syntax I think there's nothing else to be fixed..
public const int SecondMs = 1000;
public const int MinuteMs = 60 * SecondMs;
public const int HourMs = 60 * MinuteMs;
public const int DayMs = 24 * HourMs;
public const int WeekMs = 7 * DayMs;
static OutputPort ph = new OutputPort(Pins.GPIO_PIN_D2, true);
static OutputPort b = new OutputPort(Pins.GPIO_PIN_D3, true);
static OutputPort a = new OutputPort(Pins.GPIO_PIN_D4, true);
static OutputPort drain = new OutputPort(Pins.GPIO_PIN_D5, true);
static OutputPort solenoid = new OutputPort(Pins.GPIO_PIN_D6, true);
static OutputPort heater = new OutputPort(Pins.GPIO_PIN_D7, true);
static OutputPort controller = new OutputPort(Pins.GPIO_PIN_D8, true);



public static void Main()
{
drain.Write(false);
Thread.Sleep(16 * MinuteMs);
drain.Write(true);

Thread tid_1 = new Thread(new ThreadStart(Thread_1));
Thread tid_2 = new Thread(new ThreadStart(Thread_2));
Thread tid_3 = new Thread(new ThreadStart(Thread_3));
Thread tid_4 = new Thread(new ThreadStart(Thread_4));
Thread tid_5 = new Thread(new ThreadStart(Thread_5));
Thread tid_6 = new Thread(new ThreadStart(Thread_4));
.
.
.



#26218 simple code need help

Posted by Geancarlo2 on 01 April 2012 - 01:50 AM in Visual Studio

You have declared your variables inside Main() so they only exist in that scope. Declare them like below after your consts:

static OutputPort blahblah=new OutputPort(etcetc);

you also forgot {} in Thread_5 and Thread_6



#27187 Serial Data Transfer Protocol problem

Posted by Geancarlo2 on 13 April 2012 - 09:30 PM in Netduino Plus 2 (and Netduino Plus 1)

In my opinion a robust protocol should have some king of checksum/acknowledgment and send the length of the message. say something like LL LL CC CC CC CC TT PL PL PP PP PP PP PP...... LL LL=total packet length(2 bytes) CC CC CC CC=checksum over TT PL PL PP PP PP..(4 bytes) TT=packet type(1 byte) PL PL=payload length(2 bytes) PP PP PP ...=payload(length equal to the value of PL PL) This is the protocol implemented by a game I used to play and its pretty simple to implement. Pardon me if I misunderstood your first question:D



#27193 Serial Data Transfer Protocol problem

Posted by Geancarlo2 on 13 April 2012 - 10:52 PM in Netduino Plus 2 (and Netduino Plus 1)

If you got it figured already, its cool then :D. Using a protocol like I mentioned you can also break data in pieces as small as you want, it's just a matter of creating appropriate headers that can specify such things.



#26229 Redacted 00101100

Posted by Geancarlo2 on 01 April 2012 - 09:58 AM in General Discussion

Now it says "April's Fools!" :lol:



#40292 Questions about Netduino+2, realtime and netmf

Posted by Geancarlo2 on 27 November 2012 - 08:26 AM in Netduino Plus 2 (and Netduino Plus 1)

So for example if I am interested in this:
STM32F051R8T6 ARM Cortex-M0 32-bit microcontroller with 64KB of Flash memory

1) it is not enought to run netmf

2) if I want to develop on that cortex-m0 my only option is to buy expensive compiler suite + ide, for example Keil has the free limited to only 32kb. The first option is the "basic" @ 2000euros :blink:

correct?

so with netmf I spend a little more on CPU (Cortex M4 is 7$ for 1000pcs), but I save huge on IDE+tools?

1) correct

2) wrong. You can go with the free and open alternative: gcc toolchain for arm + openocd + eclipse cdt. Just takes a little more work and knowledge to get things up and running. There are also other free "bundles", such as CoIDE(http://coocox.org/)



#35549 Question on a Circuit

Posted by Geancarlo2 on 19 September 2012 - 09:00 PM in General Discussion

Hi, if you want minimal part count maybe ds1722 will work better for you. It's also cheaper..



#38123 Program in assembly language?

Posted by Geancarlo2 on 28 October 2012 - 04:45 PM in Netduino 2 (and Netduino 1)

Hi, you can erase the board and program it using ARM or Thumb instruction sets, but of course you have no access to NETMF. To be honest you should start with a simpler 8-bit microcontroller or use an emulator software for educational purposes...



#24563 Powering the Netduino

Posted by Geancarlo2 on 22 February 2012 - 05:19 PM in General Discussion

It's one of the serial-enabled LCD's on sparkfun. Here's it's datasheet. I was basing the power requirement on the statement: "Backlight transistor can handle up to 1A" I see no other indications of what it would need to draw.

The datasheet says the modules uses 3mA with backlight off and about 60mA when it is on. The transistor can handle 1A in case you want to draw current through pin 15-explained on section "Hi-Current Control Pin".



#28847 Netduino Plus Reliability

Posted by Geancarlo2 on 11 May 2012 - 06:22 PM in Netduino Plus 2 (and Netduino Plus 1)

NetworkInterface.PhysicalAddress :)



#28867 Netduino Plus Reliability

Posted by Geancarlo2 on 12 May 2012 - 03:35 AM in Netduino Plus 2 (and Netduino Plus 1)

Yes, in case your mac has been somehow wiped and you have to set it once again, don't forget you also gotta reboot the netduino so as to make it reconnect



#26259 Netduino Plus missing Classes under System.IO

Posted by Geancarlo2 on 02 April 2012 - 02:47 AM in Netduino Plus 2 (and Netduino Plus 1)

I advise you check if the assemblies Microsoft.SPOT.IO and System.IO are referenced in your project. I can't really test anything else because I don't have access to a Netduino anymore :lol:




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.