hanzibal's Content - Netduino Forums - Page 15
   
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 17-June 23)


By content type

See this member's


Sort by                Order  

#50680 Strange AnalogInput readings

Posted by hanzibal on 20 June 2013 - 11:52 PM in General Discussion

You could try removing R1 and R2 on the shield, those are 2k2 I2C pull-up resistors to 5V. After removing them, add your own pull-ups to 3.3V externally. That should work as long as the RTC considers 3.3V as logic high, which I think it does but check the d/s first. Be careful desoldering R1 and R2 not lifting the pads in case you want to put them back in future. If you know you will never use R1 and R2, just take a sharp knife and cut the traces instead of desoldering.



#50514 How to read input from sound sensor?

Posted by hanzibal on 16 June 2013 - 12:17 PM in Netduino 2 (and Netduino 1)

Hi and welcome to the forum! It sounds as if you got it wired correctly but beware the Netduiono analague ports are not 5V tolerant. You could try feeding the module 3V3 instead of 5V and see what happens. I'm not saying you have but there's a possibility you might have damaged the ADC of your Netduino. According to the discription, you should get a transition (in either direction doesn't clearly state which) on the digital pin when the sound pressure exceeds a certain threshold depending on the potentiometer position. Could be transition is made from high to low so try wiring to an interrupt port and have it trigger on both edges. Then put a Debug.Print in the event handler and see if you get anything as you clap and dial the pot slowly from one extreme to the other. I assume that if you had a scope, you would have already used it so I guess you either don't have a one or didn't see a signal According to the review, you need to make a pretty loud noise for it to react, like clapping your hands very close to it. Since you probably already tried this, it would seem to me you got a rotten egg :-(



#50071 PWM Constructor Trouble

Posted by hanzibal on 29 May 2013 - 06:27 AM in Netduino Plus 2 (and Netduino Plus 1)

Thats great, have fun!



#49964 PWM Constructor Trouble

Posted by hanzibal on 25 May 2013 - 06:22 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello and welcome to the forum!

Yes, I believe you should use the PWMChannel enum as you suggested yourself, I also noticed this at some point and I think it was introduced with v4.2 of the framework. Take a look at the code attached for the lcd driver class in the below post and you should be able to see how to use PWM. I believe the file is named lcd1602.cs or something like that.

http://forums.netdui...-and-ir-remote/

Good luck!



#50498 what material is Smartwatch made up of?

Posted by hanzibal on 15 June 2013 - 05:22 PM in General Discussion

Kickstarter has a very low tolerance for antagonists. Having an account on kickstarter is a privilege.

That sentence pretty much summarizes what I disapprove of - the lack of balance. A crowd of yey-sayers can easily contribute in creating an unjustified hype over something that you are not allowed to be critical of. That's just does not seem right to me. How could it be a privildge to have an account, the account holders usually pay money, don't they? The priviledged ones ought to be the project owners. I can only imagine how much hard work it takes to get a project up there and reaching the monetary goals, but then again, it's not supposed to be easy either. Don't get me wrong now, I'm not against the Kickstarter concept in essence and also have nothing against the Agent smartwatch or any other Kickstarter project for that matter. It's the lack of balance I'm against. In fact, I really love the Kickstarter idea - it's a great way for people to get great products on the market using the common approval rather than that of a few capitalists and the kind of control they usually imply. There's so much great talent and potential out there and I think Kickstarter presents a fantastic opportunity for those to come into the open.



#51320 Thinking Of Begining To Use Netduino

Posted by hanzibal on 10 July 2013 - 11:29 PM in General Discussion

I agree, a Netduino is not a good choise for those things and I don't even think the PI could cope. Any of those would probably be a really big detour from achieving what you want. As all of the bullets are pretty high level stuff, I'd recommend using a PC. Later, you could move to a micro or nano ATX if size is important. Of course, a Netduino could perhaps handle some of it but what's the point if you got s PC on the side. To be quite honest, I think the stuff you've mentioned taken together could take years to develop no matter what hardware you got.



#56613 Help with line of code (var rowNumber)

Posted by hanzibal on 04 March 2014 - 12:35 AM in Netduino 2 (and Netduino 1)

Judging from the RegisterAddressMap enum, there seem to be an 8 digit limit to the driver.

The enum is conceptionally mistreated. They way they are defined, they are not meant for you to apply arithmetics operations onto them.

Surely, as the corresponding enum values just so happens to be 0,1,2,3...etc because of the order in which they appear, you consecuently happen to get "digit1" by adding a one to "digit0". However, when adding a one to "digit7" you suddenly get "DecodeMode" instead of "digit8" which is not defined.

See what I mean?



#56818 Help with line of code (var rowNumber)

Posted by hanzibal on 15 March 2014 - 03:43 PM in Netduino 2 (and Netduino 1)

When cascading as depicted on page 13 of the d/s, you don't send data to a certain chip, instead you just clock out the data bits in a series out the MOSI line and into the shift register of each chip. When all bits are in place, you assert the load pin for all chips at once and each chip will load whatever command there is sitting in its shift register at that point.

Of curiosity, how come you need more than 16 digits?



#56729 Help with line of code (var rowNumber)

Posted by hanzibal on 09 March 2014 - 08:23 PM in Netduino 2 (and Netduino 1)

Those are the values assigned by default so it won't change anything.

Actually, the MAX 7219 and 7221 are 8 digit driver chips but they support daisy-chaining while the driver class apparently does not.

https://www.sparkfun...219-MAX7221.pdf

The solution is to modify the driver so that it supports cascading.



#56225 Own IO Shield

Posted by hanzibal on 20 February 2014 - 10:26 AM in Project Showcase

That Richard's pretty good :-)



#50859 Led.dispose() turns on led...why?

Posted by hanzibal on 27 June 2013 - 06:49 AM in General Discussion

It so happens that the pin you are claiming is electrically connected to an on-board LED. When disposing the pin, it reverts to its default config and usage. I'm not sure but, could it be the pin (and thus the LED) is used as a power indicator on your board?



#49420 Old school ft. New school: Snake with a Lumia 920 controlling a 5110 LCD usin...

Posted by hanzibal on 14 May 2013 - 11:42 AM in Project Showcase

Very nice, at first I didn't see the Lumia but only an old 5110 but then I noticed the animated "fly by" arrows and reallzed the 5110 was never capable of that. Thanks for sharing! Edit: also, congrats on becoming a Nokia Developer Champion!



#49384 Outputting to I/Os in parallel

Posted by hanzibal on 13 May 2013 - 02:10 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi!

 

I have some vague notion of reading somewhere that you could group pins together to form a parallel data bus on the version 2 boards but I can't find that info now and could be that was only a feature of the CPU itself and hasn't been made available to managed code yet. Perhaps someone can correct me on this?

 

So from what I know, the short answer would be no, I don't think there's any parallel bus.

 

...but - there are plenty of different solutions involving some external component. For example, with a shift register you can create a virtually parallel bus using SPI to drive it. You might want to look at the 74F166 which is an 8 bit bidirectional shift register:

 

http://www.nxp.com/d...heet/74F166.pdf

 

Also there's the PCF8574 8 bit quasi-bidirectional I2C I/O expander which is easy to use. Both of these ICs are available in breadboard friendly DIP16 packages.

 

For the latter, I've written a driver class and I2C bus manager that can be found in this post

http://forums.netdui...-and-ir-remote/




#49485 Outputting to I/Os in parallel

Posted by hanzibal on 16 May 2013 - 07:46 AM in Netduino Plus 2 (and Netduino Plus 1)

A really cool and useful feature of the PCF8574 8 bit I2C I/O Expander is that it is quasi-bidirectional meaning the pins work in both directions without the need for being configured in one direction or the other.

Also, I'm currently working on a driver class for the MCP23S17 which is a 16 bit I/O Expander with SPI interface. With my software, you can use it pin by pin or group pins together to form one or more parallel buses. This chip is also bidirectional and has excellent per pin interrupt handling. I'll be posting the code when done.



#50791 The latest thing: Oscilloscope Art

Posted by hanzibal on 25 June 2013 - 10:31 AM in General Discussion

I used an MCP41100 digital pot for drawing the signal and here's the code for it:

http://forums.netdui...-potentiometer/




#50361 The latest thing: Oscilloscope Art

Posted by hanzibal on 08 June 2013 - 10:04 PM in General Discussion

Can you see what the oscilloscope says?  :ph34r:

 

oscart_text.JPG

 

I'll be uploading some code later so we can compete in drawing the best oscilloscope art  :D

 




#50370 The latest thing: Oscilloscope Art

Posted by hanzibal on 09 June 2013 - 01:31 PM in General Discussion

...and here's how I did it:

http://forums.netdui...-potentiometer/




#50243 Static or Instance

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

I'm with NooM here, try and keep classes as self-contained as possible. Avoid scattering bits and pieces as statics in the main class. Gather and isolate things that belong together. In my opinon, the more globals, the worse the code in terms of clarity, change management, maintainance, porting, scalability, generalizantion, scalability, etc. Be aware of the limited amount of system resources, primarily RAM and processing power (your code is being interpreted at run time, there's no JIT here). Create late and destroy early. Be clever and figure out more efficient ways of doing calculations etc than you perhaps normally would. Optimize, use hash tables. Keep it short, lean and mean. Whenever possible, use event driven constructs (interrupts) rather than polling. Avoid tight loops as much as possible. Use multithreading concepts like producer/consumer relations between threads employing sempahores and mutexes. The scheduler does a really excellent job, sometimes almost magical. If you must do tight stuff, remember to yield once in a while in favor of other threads. Other than that, at least I don't take any particular explicit actions for memory management. In general, the GC normally does a better job when left in peace. Personally, I don't care much for IDispose. I mean, if you for example instanciate a driver class for an LCD, a switch or something like that - would you dispose of it run time? I know I wouldn't. Naturally, transient objects should be disposed of early, don't allow stuff to "build up" over time. EDIT: Of course, don't apply all of the above per sé but selectively when necessary, sensible and justified.



#56349 bitwise comparison & IF condition

Posted by hanzibal on 24 February 2014 - 09:45 PM in General Discussion

That makes it compile but it's not quite the same thing, I'd say it translates into this:
if ((this_led_color & mask) != 0)       SDI.Write(true);else       SDI.Write(false);
Checking for equality to mask is no longer the same when mask has other than a single bit set.



#52408 debug success but output doesn't showing

Posted by hanzibal on 28 August 2013 - 06:44 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi there and welcome to the Netduino forums. Debug messages should show but I suspect you debug output is direct to the immediate Window. Either switch to immediate window while debugging or change Visual Studio settings to direct debug message to the output window.




#56471 Lcd 16x4 initialization

Posted by hanzibal on 26 February 2014 - 10:33 PM in General Discussion

Faith, what controller is it, got a datasheet you can point to?



#51251 Webserver and locking

Posted by hanzibal on 09 July 2013 - 12:58 PM in Netduino Plus 2 (and Netduino Plus 1)

You should use an interlocked exchange to change the value of the _serverReady varible. The Interlocked.Exchange method will replace the value and return the previous value in a single atomic (unbreakable) operation.
int _serverReady = 1;if(Interlocked.Exchange(ref _serverReady, 0) == 1){            // process request       .      .      .      // done, open unlock the door      _serverReady = 1;}else{      // server busy}
As indicated above, I think you have to declare _serverReady as an integer for this work. You might want to use the volatile modifier on your variable declaration but I don't know if that feally matters in .NETMF. There might also be a way to configure the listener as synchronous so that the server will never attempt to process requests in parallel. Could be this feature is not available in .NETMF, I'm not sure.



#49461 New to this, I want to make sure I use the right tools

Posted by hanzibal on 15 May 2013 - 11:12 AM in General Discussion

Hi Dave and welcome to the forum,

I totally agree with Dave  :P

 

Seems like a good kit to start with. As you know the Netduino Plus 2 has networking capabilities and can send emails and such. As for sound, you can use PWM to play a chime on that piezo buzzer.

 

Since you're an experienced developer, I'm sure you'll manage to put the door bell/mailer together.

 

Good luck!




#50681 Mocking Inputs?

Posted by hanzibal on 20 June 2013 - 11:58 PM in General Discussion

Instead of Unit-testing, you might consider "black boxing" by writing a corresponding set of interfaces through which data Is introduced. You would then make your fake implementations always returning fixed or random dummy data as needed. Later of course, you would make real (non-fake) implementations.



#50553 How Many Motors can the Netduino Control?

Posted by hanzibal on 17 June 2013 - 03:29 PM in General Discussion

With the right controller, on, off, forward and backward (no speed control) would require 2 pins per motor. So depending on which Netduino you got, you could potentially control 8 to 11 motors and with an IO expander IC you could control many more.




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.