NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 11 12 13 14 15 … 93 Next »
Help an old coder with a VFD

 
  • 0 Vote(s) - 0 Average
Help an old coder with a VFD
35mmslr
Offline

Junior Member

Posts: 8
Threads: 2
Joined: Dec 2005
#1
2011-09-22, 12:52 PM
Hi sub & everyone.

I havent coded for 20years and back then I was doing everything in machine code & asm. However, I have decided to try and modify an old DVD case (a KISS DVP-450) for my HTPC frontend and it has a VFD on it. I have got the VFD connected up to an Arduino and I am able to construct characters on the VFD and light up the other symbols and read the case buttons.

What I am having trouble with is passing information from NPVR to the Arduino. I have looked at the examples that sub provided (test3.zip) but I just cant get my head around it. Does anyone have any good reading material or maybe some snippets of code for getting the status of npvr (e.g. now playing, channel, volume level, recording status, osd menu item highlighted etc.) that I can then use to send to the device (via usb/serial).

Any assistance is greatly appreciated.

Cheers

Dave
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,697
Threads: 767
Joined: Nov 2003
#2
2011-09-22, 05:15 PM
For this type of plugin, you'd need to start a new c# project, add a reference to NUtilities.dll, create a new class that implements the IEventNotification interface (which basically defines a "Notify()" method), then in the constructor add the line "EventBus.GetInstance().AddListener(this);", then you should be good to go. The Notify() method on your class will get called any time somthing happens. It let you know about playing files, watching live tv, changing channels etc. Some of those you'll end up using as cues to send things to your VFD.

If you have any problems getting it going, or really need an example, let me know and I'll try to knock up some code to demonstrate.
35mmslr
Offline

Junior Member

Posts: 8
Threads: 2
Joined: Dec 2005
#3
2011-09-23, 07:44 AM
That's fantastic sub, thanks. I'll cobble something together this weekend and if I cant get it going I'll be back in a flash.
35mmslr
Offline

Junior Member

Posts: 8
Threads: 2
Joined: Dec 2005
#4
2011-09-27, 02:13 PM
Sorry sub, I am getting to grips with c# but it is taking much longer that I expected. Can I take you up on the offer of some sample code please?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,697
Threads: 767
Joined: Nov 2003
#5
2011-09-27, 04:48 PM
Here is an example events plugin. To get it running, build the project, create a 'C:\Users\Public\NPVR\Plugins\TestEvents' directory, and drop the dll in there, then start the app. If (for example) you play a file, this plugin will log the event to npvr.log.

If the project does build for you, you may need to remove the reference to nutility.dll, and re-add it, since my nutility.dll is in a different directory to yours.
35mmslr
Offline

Junior Member

Posts: 8
Threads: 2
Joined: Dec 2005
#6
2011-11-12, 08:21 PM
Thanks Sub, just got a chance to test (been in hospital) . I really can't seem to get to grips with the way c# works. I am trying to send the results of the event over serial but no matter where i define the port I get
Quote:System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
in the log file.

I am using the System.IO.Ports with
Code:
SerialPort port = new SerialPort("COM9", 9600);

Sorry to trouble again but this is driving me to an early grave!

Thanks again sub.

Dave
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,697
Threads: 767
Joined: Nov 2003
#7
2011-11-12, 09:07 PM
I think you've got your project compiled for the .NET 4.0 runtime. Look in your project settings and set it to .NET 2.0.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,917
Threads: 956
Joined: May 2006
#8
2011-11-12, 09:17 PM
Looks like you are trying to run .NET 4 (Version=4.0.0.0 ) NPVR is a .NET 2 app but the CLR should be ok with plugins up to 3.5

Edit: Oops this was stuck in my browser cache and I see sub replied already.

Martin
35mmslr
Offline

Junior Member

Posts: 8
Threads: 2
Joined: Dec 2005
#9
2011-11-12, 10:44 PM
Damn, thanks guys. That was it. I have spent the last 4 hours looking at this code and I didnt notice that.

Now trying to decide between the vfd and a 16x2 lcd. both will be controlled the same way but the vfd is really dark and i have the pwm at max, and i need a separate supply for the 33v! Looks like the lcd might be the winner.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode