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

Charlieplexing: Now uses the TristatePort class


  • Please log in to reply
9 replies to this topic

#1 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 25 November 2010 - 05:06 AM

I hope you guys find this useful, I think it should help some of you that are doing POV projects. Wikipedia schematic: http://en.wikipedia....rlieplexing.png My Fritzing schematic is attached below. In the video I use this code in the program class. My Video: Video which I learned this from (obviously not mine): EDIT: Updated code! It has new methods to make new patterns! Thanks

Attached Files



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 November 2010 - 05:25 AM

Omar, Thanks for posting this. I have only seen Charlieplexing with .NET MF once before. Nice! As for a new type of port, have you looked at TristatePort? Chris

#3 Eric Burdo

Eric Burdo

    Advanced Member

  • Members
  • PipPipPip
  • 130 posts

Posted 25 November 2010 - 12:33 PM

TristatePort?



I've never seen that... I'll have to look into it.
~ Eric D. Burdo ~ http://brick-labs.com/

Today LED's, tomorrow, the world!!! Well, OK, maybe servos.

#4 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 25 November 2010 - 01:56 PM


As for a new type of port, have you looked at TristatePort?

Chris


Wow I had no clue that class was there! To set a tristate port as input (like having an InputPort) do I do "port.Active = false"?
I have to update this code now.

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 November 2010 - 05:29 PM

Wow I had no clue that class was there! To set a tristate port as input (like having an InputPort) do I do "port.Active = false"?


Precisely.

Chris

#6 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 25 November 2010 - 06:21 PM

Precisely.

Chris

Will .Write(false/true) override the .Active = false? or should I first write .Active = true;?

EDIT; I got it now. this is really cool, I think its more efficient now.

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 November 2010 - 06:35 PM

Will .Write(false/true) override the .Active = false? or should I first write .Active = true;?


With TristatePorts, you should write ".Active = true;" to switch from input to output.

Chris

#8 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 25 November 2010 - 07:10 PM

With TristatePorts, you should write ".Active = true;" to switch from input to output.

Chris

Thanks for the help, I updated the code and now it works way faster! Now all the LEDs can be on at the same time with no visible flicker.

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 25 November 2010 - 07:12 PM

Thanks for the help, I updated the code and now it works way faster! Now all the LEDs can be on at the same time with no visible flicker.


Nice!

#10 Michel Trahan

Michel Trahan

    Advanced Member

  • Members
  • PipPipPip
  • 155 posts

Posted 07 May 2011 - 03:45 PM

Now I understand why the tristate ports exist in the first place :) Thanks ! If I understand correctly your code, you are missing the ability to turn on with no time limit, and one to turn off later on, which would be needed for the digital clock or do you turn on a pattern for 1 second at a time (if you wanted one with seconds) ? Meaning, you code is blocking no ? you have to wait for it to be done to move to another one. Say turn on a pattern, do something and when done turn to another pattern. Just a thought :)
Started with C in 1985, moved to Vb3 ... to vb6 and stopped. Now started with .Net and learning C# and VB.net and wishing VB.net was on MF !




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.