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.

hanzibal's Content

There have been 386 items by hanzibal (Search limited from 27-September 23)


By content type

See this member's


Sort by                Order  

#50933 Ultrasonic sensor code.

Posted by hanzibal on 29 June 2013 - 02:58 PM in Netduino 2 (and Netduino 1)

Hi! Found a few things to be a little odd, I'm not sure they'll solve your problem though. You are creating the trigger port each time GetDist() is called. If you wish to share the same trigger pin among multiple class instances, declare the trigger port member as static instead and make sure it only gets created once. Create both the trigger and echo ports in your constructor and store them in private members. Remove the pin members since there's no point in remembering those any more. About interrupts, when adding an event handler, you are only registering a method to be called if and when an interrupt occurs. You are not, as your comment implies, waiting for it to happen at that point. This also means you should move event handler registration to the constructor as well. How are the the instances ultraSonic1 and ultraSonic2 created, what parameters are passed to the constructor?



#55288 Multiple *different* spi devices

Posted by hanzibal on 10 January 2014 - 08:58 PM in General Discussion

Yes, the Netduino can certainly talk to multiple SPI slaves, but you must serialize your data transfers. Basically, you create several SPI configurations and swap between these when interfacing to one or the other slave devices using different !CS pins.

 

In a multi-threaded environment, you must make sure that transfers are not interrupting each other. If necessary, use the lock statement to protect your SPI configuration swapping mechanism.

 

There are several implementations available, here's one for you:

 

http://netmftoolbox....rdware.MultiSPI




#55386 Multiple *different* spi devices

Posted by hanzibal on 15 January 2014 - 02:06 AM in General Discussion

It sounds a bit like the mbi5026 does not honor it's !cs input really well. Have you tried using different Netduino pins for the mbi5026 !cs line or tried adding a pullup resistor on it? The latter might very well do the trick.



#55449 Multiple *different* spi devices

Posted by hanzibal on 17 January 2014 - 09:53 PM in General Discussion

Those must have been some really bad wires, at these small currents and short distances, one would think such things should not matter, but there you go. Glad you solved it!




#50017 is it possible to use existing c code with NETMF ?

Posted by hanzibal on 27 May 2013 - 01:40 PM in General Discussion

Is there anyway I could re-use existing C code libraries in my project. The work that would be involved in translating them in C# would be enormous. 

 

I've ported lots of code from C to C# and found it to be a very straight forward (almost mechanical) process even though it has not always been my own code to begin with. Many things can be taken care of with simple search and replace.

 

There are some converters out there but I have no idea if they're any good - but they should at least be able to do the "no brainers" for you:

 

http://lmgtfy.com/?q=convert+C+to+C%23




#50835 N+2 communication with WebApi

Posted by hanzibal on 26 June 2013 - 12:34 PM in Project Showcase

Nice, is it an Android phone and did you write the app for it?




#50870 N+2 communication with WebApi

Posted by hanzibal on 27 June 2013 - 11:01 AM in Project Showcase

Ah yes, silly me - I see now that you got the same webpage open in the browser of your PC.




#52441 Long live the Netduino

Posted by hanzibal on 29 August 2013 - 08:43 AM in General Discussion

I agree, the Netduino and Pi are not comparable and have different audiences, I was primarily the (in my opinion) somewhat unjustified hype around it.

 

OT: A while ago, I got a Cubieboard and yes, it still sits in unopened box :-) but I mention it because it's comparably priced, has superior hardware over Pi and intended on h/w hacking/interfacing. Runs Android 4.x, Ubuntu, Kali and Debian:

http://cubieboard.org/

http://ubuntuone.com...2MH4kCv5UdA6RmE




#52428 Long live the Netduino

Posted by hanzibal on 28 August 2013 - 07:07 PM in General Discussion

Couldn't agree more! It's a bit like the old Amiga, it worked amazingly well and that was long before the internet or even BBSs in many cases. People were exchanging knowledge through magazines and sending floppy disks by snail mail :-) Same thing, we all had the exact same hardware (almost anyway, there were a few expansion boards). Personally, I instinctively refrained from purchasing a Pi, it was simply too powerful to seem fun and enough challenging for me. I wouldn't be at all surprised if every other Pi ever sold still hides somewhere untouched and in its original packaging. I love the Netduino, it managed to bring my dormant interest for digital electronics back over night! Another thing is the friendly tone and welcoming feel in the forum, personally, I think that is a major contributor to the success.



#50358 L293 H-bridge Control

Posted by hanzibal on 08 June 2013 - 10:30 AM in Netduino Mini

Ok, just modify the erroneous line like this:

// Defines the HBridge IC on the correct pinsHBridgeMotorDriver = new HBridge(PWMChannels.PWM_PIN_20, Pins.GPIO_PIN_19, PWMChannels.PWM_PIN_18, Pins.GPIO_PIN_17);

It works for me (Netduino mini with framework 4.2) and should for you too I hope.

 

EDIT: Works = the code compiles but I don't have a H-brigde driver and forgot to check with the scope.




#50308 L293 H-bridge Control

Posted by hanzibal on 05 June 2013 - 09:08 PM in Netduino Mini

Hi! One or more of the HBridge constructor parameters are of the wrong type. Try writing Cpu.Pin.xxx instead of just Pins.xxx. Does that help? If not, a silly way to find out what is the cause, replace both PWM object parameters with null. if the error goes away, then you know the PWM obejcts are of the wrong type. If not, it's the Pins. Depending on the outcome of the above, investigate further as needed by examining the type of the corresponding parameters making sure they match those of the method signature.



#50345 L293 H-bridge Control

Posted by hanzibal on 07 June 2013 - 09:57 AM in Netduino Mini

Did you try replacing with null as described? The error has nothing to do with oop, it's just a matter of passing parameters of the correct type. Yes, it could be enumerator difference between the two. EDIT: Could you zip and attach your code so I could try it?



#50367 L293 H-bridge Control

Posted by hanzibal on 09 June 2013 - 12:47 PM in Netduino Mini

That is great news, good luck with your project!




#50909 Main Thread Hangs

Posted by hanzibal on 28 June 2013 - 11:56 PM in Netduino Plus 2 (and Netduino Plus 1)

Since the last thing of Main() is to call output0.Flash() which enters an infinite loop, I don't think Main() ever returns, at least not according to the Program.cs attached where ToggleMethod is set to LoopIteration for all instances of the ToggleOutput class by a static member of the Program class.



#50897 Main Thread Hangs

Posted by hanzibal on 28 June 2013 - 02:35 PM in Netduino Plus 2 (and Netduino Plus 1)

The scheduler may have problems switching between threads since they are all running in tight loops. Try yielding briefly in the loop by calling Thread.Sleep(1) once in a while.




#49971 3x4 Matrix Keypad bounce problem

Posted by hanzibal on 25 May 2013 - 09:52 PM in Netduino 2 (and Netduino 1)

Ok, that is truly strange. What if you just assign a variable DateTime.Now, does that produce anything other than zero? If not, could be hardware problems but one should think more stuff would also not work then so I assume you get a decent value and that would leave a firmware upgrade or you've teied that already perhaps? I don't know the differences, if any, between the N2 and NP2 with respect to such an issue, I'd suspect there's none.



#49975 3x4 Matrix Keypad bounce problem

Posted by hanzibal on 26 May 2013 - 06:30 AM in Netduino 2 (and Netduino 1)

I really doubt it's the keypad, I think you should try setting a few breakpoints in select places of the Toolbox.NETMF.Hardware.MatrixKeyPad driver code and find out where that zero originates from. There could be a bug in there or perhaps something resulting from incorrect wiring.



#49966 3x4 Matrix Keypad bounce problem

Posted by hanzibal on 25 May 2013 - 08:31 PM in Netduino 2 (and Netduino 1)

I'd expect time to be zero when the board starts up since there's no RTC on board, or is there? After startup, clock should start ticking of course. Would that explain the phenomena you're seeing? EDIT: What is the initial value of the ButtonLastPushed variable? I guess it should be DateTime.MinValue.



#50462 Netduino Plus 2, SPI interferes with Networking?

Posted by hanzibal on 13 June 2013 - 10:55 AM in Netduino Plus 2 (and Netduino Plus 1)

I would have thought it be unusual for an SPI slave device to ignore chip select but could be it only looks at the raising edge of the clock as long as !cs is asserted, i.e. performing and AND operation on the two. Maybe that is defacto standard procedure. The parameters you set do matter and controls how the Netduino SPI module manages the cs and clock pins respectively but I guess you knew that already.



#50776 a new i/o pin

Posted by hanzibal on 24 June 2013 - 10:58 PM in Netduino Mini

Interesting.... Getting +/-6V could be useful in some cases. Any idea of how much it can source? I would guess about half as much as any other regular pin since those are 3V3.



#50857 a new i/o pin

Posted by hanzibal on 27 June 2013 - 06:30 AM in Netduino Mini

Sounds like you got it from a secret place ;-)



#50736 Seeking economical premade voltage sensor array?

Posted by hanzibal on 23 June 2013 - 12:19 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi! Why not multiplex the 12 using only a single voltage divider and analogue input? You'd have to sample 12 times as often but it would be very economical... About the relays, pretty much the same deal or use a latched shift register. EDIT: Your avatar looks like a turbo charged in-line four jap motor or an old BMW M3, but what is it? EDIT: If its for a motronic application, speed could be a problem.



#50754 Seeking economical premade voltage sensor array?

Posted by hanzibal on 24 June 2013 - 08:47 AM in Netduino Plus 2 (and Netduino Plus 1)

Yes, the general idea was to use an analogue multiplexer that can handle the voltage and then a single voltage divider between that and the Netduino. The CD4067B 16 channel mux/demux can handle up to 20V but Vcc must also be 20V:

 

http://www.ti.com/li...ink/cd4097b.pdf

 

If 20V is not readily available you need a step-up converter from 12V which infortunately would increase cost. On the other hand, such converters come quite cheaply on eBay:

http://www.ebay.com/...=item1c33d18e42

 

If you spend some time searching, you might be able to find a demultiplexer that can handle input voltage significantly greater than Vcc and then of course you won't need the converter.

 

Audi?




#50756 Seeking economical premade voltage sensor array?

Posted by hanzibal on 24 June 2013 - 09:18 AM in Netduino Plus 2 (and Netduino Plus 1)

It suddenly hit me that you need an analogue switch instead of a multiplexer. There are many but this one is a 16 channel switch that can deal with 230V signals. I don't know but they could be expensive.

 

http://datasheets.ma...05-MAX14806.pdf

 

EDIT: Here's an overview from Texas Instruments:

http://www.ti.com/li...5d/slyb125d.pdf




#56290 Extending Digital Input using game Controller

Posted by hanzibal on 23 February 2014 - 10:36 AM in General Discussion

USB gamepads are typically implemented as HID devices and must be connected to a USB host. The host (usually a PC) periodically polls the device to read the current state of buttons, directional pads, thumbsticks and so on. I find your project description to be somewhat cryptic - are you looking to have the Netduino act as USB host reading the gamepad or is it the other way around - e.g. the Netduino should act as a gamepad that will be read by a PC over USB as means of sending sensor information to the PC?




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.