|
What have you tried? Need me to link a random tutorial from Google?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
not tried anything yet, been researching on the use of USB and DB25 serial port interfaces and the necessary hardware between the PC and LEDs
|
|
|
|
|
how do you control LEDs in C# That already implied that you imagined that one can hook 'em up easily to an existing port. You'd either dive into Windows 7 "sensor api", or look at an external board.
Go for a Raspberry Pi if you're unsure, it has a GPIO-port and there are some samples to get you started on your own project.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
samweps wrote:
how do you control LEDs in C#
By writing appropriate code for what you want to do.
What did you think the answer was going to be with a question like that??
In all seriousness, if you want to use C#, get a Netduino[^] or a FEZ Panda[^] microcontroller and learn how it's really done, without risking your computers expensive hardware. You'll also learn alot about digital electronics if you really want to teach yourself. Try getting this book[^] or this one[^].
|
|
|
|
|
it depends on what you need , if you have a Com ports you can use it easily with some hardware buffer and amplifier , or you can use any controllers, if you are not familiar with Arduino or PI , try to find a CanaKit board, its very easy and with LED's and Relayed output.
|
|
|
|
|
parallel port(DB25)
breadboard
optoisolator for each of the used lines(ie Protect the PC interface
next a latch (something to hold the data)
drivers (for lighting the lighty things)
opto latch
+Vcc
-----------------
r r r r r r r
e e e e e e e
s s s s s s s
i i i i i i i
db25 s s s s s s s
╔═╗latch sig t t t t t t t
-║-║------| o o o o o o o
║ ║ | r r r r r r r
║ ║ ╔═╗ ╔═╗ ╔═╗ | | | | | | |
-║-║-║o║-║l║----║d║--------------------o----|>-----o
-║-║-║p║-║a║----║r║-----------------o-------|>-----o
-║-║-║t║-║t║----║i║--------------o----------|>-----o
-║-║-║o║-║c║----║v║-----------o-------------|>-----o Ground
-║-║-║ ║-║h║----║e║--------o----------------|>-----o
-║-║-║ ║-║ ║----║r║-----o-------------------|>-----o
-║-║-║ ║-║ ║----║s║--o----------------------|>-----o
╚═╝ ╚═╝ ╚═╝ ╚═╝
each of the lines are attached to a pull up resistor
see C# parallel port programming on Code Project
|
|
|
|
|
hi, I would like directions on how to control LEDs through any ports in C#
|
|
|
|
|
Request you to not do resposts.
|
|
|
|
|
He can't. Once a question has an answer, it can't be deleted.
|
|
|
|
|
|
Is it still possible for a program to return a value to a command line BAT file ?
I'm thinking, a real simple square with two buttons, which return a 1 or a 0 value back to the command line that called it.
Can this be done ?
Is it simple ?
How is it done ?
Assuming I can do it, can I post the source code here on CodeProject ? Can I post the EXE ?
|
|
|
|
|
Only if it's an integer (32-bit). Yes. Yes. Look it up. Yes. No.
|
|
|
|
|
Look into "exit codes"
example[^]
Don't follow just one thread, read up on it a little, before jumping in.
|
|
|
|
|
I am beginner.
and I am going to make my own audio player without using "windows media player"
Please help me to finding me complete tutorial for making own audio player.
|
|
|
|
|
Chaman Saini wrote: and I am going to make my own audio player without using "windows media player"
Please help me to finding me complete tutorial for making own audio player.
I suggest you try the built-in class called "soundplayer[^]".
There's little chance that you'll find a "complete" tutorial on writing your own audio player. If you really want to use something else, try looking for an open-source library.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Request you not to repost.
|
|
|
|
|
|
Hello
I wanna ask that what is the reason that I am not able to play the mp3 file.
my whole code for the "class" for simple audio player is as below:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace myplayer
{
class Player
{
[DllImport("winmm.dll")]
private static extern long mciSendString(string lpstrCommand, StringBuilder lpstrReturnString, int uReturnLength, int hwndCallback);
public void open(string file)
{
string command = "open\"" + file + "\" type mpegvideo alias MediaFile";
mciSendString(command, null, 0, 0);
}
public void play()
{
string command = "play MediaFile";
mciSendString(command, null, 0,0);
}
public void stop()
{
string command = "stop MediaFile";
mciSendString(command, null, 0, 0);
command = "close MediaFile";
mciSendString(command, null, 0, 0);
}
}
}
|
|
|
|
|
One obvious problem is that you don't have a space between open and the opening question mark of the file name in your open method.
|
|
|
|
|
please write your correct code here.
|
|
|
|
|
There's no need for that. What he described is spot on.
Look at the open command you're sending:
string command = "open\"" + file + "\" type mpegvideo alias MediaFile";
There is no space between the word "open" and the first quote mark where you sepcify the file name!
The result is your open command looks like this:
open"somefilename.mpg" type mpegvideo alias MediaFile
instead of this:
open "somefilename.mpg" type mpegvideo alias MediaFile
What do you think you have to do to fix that little problem??
|
|
|
|
|
hmmm Thank you so much Buddy.....
I am a beginner so i had face that problem
|
|
|
|
|
but it is still not workin.....I mean it is not playing............
What should I explain so that I can achieve more from you....
|
|
|
|
|
You're sending null in place of a buffer to hold any return information, so you're basically not getting any error information back from MCI.
You might also want to try removing the "type mpegvideo" from your command to see if that does anything.
|
|
|
|
|
You main problem is that you do not check the response from your mciSendString commands so you have no idea whether any of them have succeeded.
|
|
|
|