switch programming

switch programming

Page 1 of 1

9 Replies - 2494 Views - Last Post: 23 May 2008 - 10:25 AM Rate Topic: -----

#1 mct_pjt  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-May 08

switch programming

Post icon  Posted 20 May 2008 - 08:42 PM

hi can help me to gv th c progamme for the LED switch, and 7 segment , i can take your example as the reference for my pjt thanks alot..
Is This A Good Question/Topic? 0
  • +

Replies To: switch programming

#2 Cerolobo  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 52
  • View blog
  • Posts: 450
  • Joined: 05-April 08

Re: switch programming

Posted 20 May 2008 - 08:58 PM

When you start a thread/post a reply, there is this big yellow box at the top that says

Quote

Before You Post:

1. Are you sure this is the right forum for this post? (No Programming Questions in Introduce Yourself or the Caffeine Lounge)
2. You must show your code before receiving help. We won't do your homework for you.
3. Use BBCode when posting. For example:
Paste Your Code Here

4. Give your topic a descriptive title, NOT "Help" or "Plz Help Me" or "I'm a noob"
5. Describe any errors you are encountering. Help us help you!
6. Please spell-check your entire post.


Now, you didn't follow any of the rules!

First off, that is just a huge run on fragment that is full of grammatical errors.

Quote

hi can help me to gv th c progamme

So, you want us to help you give the (not just a, THE) c "progamme"?

Quote

LED switch

You have a switch with a light on it?

Quote

7 segment ,

7 segment comma?

Quote

i can take your example as the reference for my pjt thanks alot..

So, you want to take our example, to use as a refrence, for your pajama tops (pjt)?
Was This Post Helpful? 0
  • +
  • -

#3 Oscar53  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 15-May 08

Re: switch programming

Posted 21 May 2008 - 09:43 AM

you must download a driver for the LPT if you use a NT Kernel.
under linux it's much easier, however if you have already made the circuit, make the program is fairly banal...
I advice to use the function outportb(address,whichPinTurn) in the dos.h where address is equal to 0x378 (generally) .

for turning the led :
switch (i)
			{
				// The LED required
				case 1 : accens = accens | 0x01; break;
				case 2 : accens = accens | 0x02; break;
				case 3 : accens = accens | 0x04; break;
				case 4 : accens = accens | 0x08; break;
				case 5 : accens = accens | 0x10; break;
				case 6 : accens = accens | 0x20; break;
				case 7 : accens = accens | 0x40; break;
				case 8 : accens = accens | 0x80; break;
			}

						outportb(0x378,accens);



for shuting down the led:

switch (i) {

				case 1 : accens = accens & ~(0x01); break;
				case 2 : accens = accens & ~(0x02); break;
				case 3 : accens = accens & ~(0x04); break;
				case 4 : accens = accens & ~(0x08); break;
				case 5 : accens = accens & ~(0x10); break;
				case 6 : accens = accens & ~(0x20); break;
				case 7 : accens = accens & ~(0x40); break;
				case 8 : accens = accens & ~(0x80); break;
			   }

			outportb(0x378,accens);



bye :D
Was This Post Helpful? 0
  • +
  • -

#4 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Re: switch programming

Posted 22 May 2008 - 10:17 AM

I can haz teh codez? *sigh* This is becoming more and more common . . .
Was This Post Helpful? 0
  • +
  • -

#5 Oscar53  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 15-May 08

Re: switch programming

Posted 22 May 2008 - 10:46 AM

what do you want?
Was This Post Helpful? 0
  • +
  • -

#6 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: switch programming

Posted 22 May 2008 - 11:13 AM

I think that akozlik meant to point out that there are more and more occurrences of people asking to simply be provided with working code, as opposed to making any effort to do it themselves.
Was This Post Helpful? 0
  • +
  • -

#7 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Re: switch programming

Posted 22 May 2008 - 11:17 AM

View PostAmadeus, on 22 May, 2008 - 11:13 AM, said:

I think that akozlik meant to point out that there are more and more occurrences of people asking to simply be provided with working code, as opposed to making any effort to do it themselves.


Ha ha, I'm glad my sarcasm was noted. Indeed I'm noticing more and more that people want to just have the programs written for them without fully understanding how and why they work. That's not a big deal until you realize that a lot of these people are going to be getting jobs working next to us. I can haz teh jobz? Seriously though, follow the forum rules, show that you've put in some effort, give us code samples, and we'll be more than happy to help out!
Was This Post Helpful? 0
  • +
  • -

#8 Cerolobo  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 52
  • View blog
  • Posts: 450
  • Joined: 05-April 08

Re: switch programming

Posted 22 May 2008 - 11:25 AM

Actually, what I found interesting about akozlik link, is that it actually shows the degeneration of grammar on the internet. The first post was actually decent in terms of sentence structure, spelling, and general grammar.

Around 2005, the posts actually started to use net lingo. I'm willing to bet that this is a by product of making computers, the internet, and even programming more user friendly. I will never understand why people choose to type things like "u" instead of "you". Is your time so important that two character strokes are actually worth it?

If anyone is interested, you might like this link. The article was published in 2005, but I still agree with it.

http://www.joelonsof...avaSchools.html
Was This Post Helpful? 0
  • +
  • -

#9 akozlik  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 90
  • View blog
  • Posts: 797
  • Joined: 25-February 08

Re: switch programming

Posted 22 May 2008 - 11:40 AM

Interesting article. It's definitely something that I see a lot. Luckily my university is one of the better ones in the southeast USA, so our CS program is still pretty rigorous. Our Comp Sci I class covered all the data structures, including hash tables and graph theory. It was definitely funny watching everybody freak out over pointers. In the words of Will Ferrell, "it was mind bottling".

In regards to the language used on the internet, it's amazing how ridiculous people sound. I never fully understood why people would choose to sound like idiots, as opposed to intelligent individuals who can construct a basic sentence.

"Would you mind helping me with a programming problem I'm having? My software's crashing at this point in the program, and I've done this this this and this to figure out where the problem lies." has turned into "I can haz teh codez?"

Wow it's frustrating.
Was This Post Helpful? 0
  • +
  • -

#10 Oscar53  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 23
  • Joined: 15-May 08

Re: switch programming

Posted 23 May 2008 - 10:25 AM

Quote

Ha ha, I'm glad my sarcasm was noted.


sorry, I don't understand very well english and I have lost your sarcasm :D

however I posted the code useful to start building the program and now it's his time.

Bye ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1