Forum: C Jun 9th, 2009 |
| Replies: 6 Views: 631 What I posted is a segment of code from putchar.c which you can find in the lib folder.
printf won't work the way you posted because TI needs to be set before calling printf. You usually set TI... |
Forum: C Jun 8th, 2009 |
| Replies: 6 Views: 631 Depends how printf is implemented in your compiler. In Keil, TI must
be set before printf is called. The is because of how putchar is implemented (which is called by printf.)
while (!TI);
TI =... |
Forum: C May 30th, 2009 |
| Replies: 4 Views: 621 As long pins 2 and 3 are tied together, it will work. |
Forum: C May 30th, 2009 |
| Replies: 4 Views: 621 Attach a female DB9 connector onto your male to female RS-232 cable.
Get the solder type, not PCB type. Then solder wires to it and tie pin 2 and pin 3 together. |
Forum: C Apr 18th, 2009 |
| Replies: 28 Views: 5,621 Those seem to be range sensors though that output a voltage corresponding to the distance of the IR led?
You can get detectors with a digital output. Like the TSOP1738. |
Forum: C Apr 18th, 2009 |
| Replies: 28 Views: 5,621 You could go with ten IR LEDS and ten IR phototransistors and use this simple circuit.
http://www.reconnsworld.com/ir_ultrasonic/basicirdetectemit.gif
The output is high when an object blocks the... |
Forum: C Apr 17th, 2009 |
| Replies: 28 Views: 5,621 Which I did because there's no reason I can see to use more than one IR receiver attached to a single device.
And build a IR detector out of discrete components? What kind of silly idea is that?... |
Forum: C Apr 17th, 2009 |
| Replies: 28 Views: 5,621 What the hell are you talking about. I said it's probable you don't need more than one receiver, not what he does and doesn't need. I don't know, that's why I am effectively asking.
It's just food... |
Forum: C Apr 17th, 2009 |
| Replies: 28 Views: 5,621 You probably don't need lots of IR sensors. You probably only need one and send different data to it. If you want to interface to the PC though its serial port, it's easiest to use a microcontroller... |
Forum: C Jan 10th, 2009 |
| Replies: 9 Views: 622 After you run your program, check the state of the port pins with LPT to confirm it isn't working.
http://neil.fraser.name/software/lpt/
If not, there's also Userport. ... |
Forum: C Jan 10th, 2009 |
| Replies: 9 Views: 622 XP won't allow access to the port. Install GiveIO, and it will.
http://sourceforge.net/project/showfiles.php?group_id=46487&package_id=77441&release_id=150767 |
Forum: C Nov 24th, 2008 |
| Replies: 2 Views: 635 You can download the uVision IDE with an evaluation compiler that's limited to 2K of object code. If it's the c51 compiler you want, that should be good for a couple hundred lines of code. |
Forum: C Nov 23rd, 2008 |
| Replies: 25 Views: 1,826 The first step is using a search engine and typing "Turbo C graphics".
Next you could enter "How to draw Mickey Mouse".
Then if necessary, use a forum to post code and ask a question as to why... |
Forum: C Nov 22nd, 2008 |
| Replies: 25 Views: 1,826 http://lazyfoo.net/SDL_tutorials/lesson20/index.php |
Forum: C Nov 16th, 2008 |
| Replies: 2 Views: 382 int i;
int *p;
p = &i; // p holds the address of i
*p = 10;
The last assignment says take the value in p, go to that address and put 10 there.
Therefore, i now holds 10.
To prove that... |
Forum: C Nov 6th, 2008 |
| Replies: 11 Views: 1,452 In your 2nd for loop i starts at 1. In the first i starts at 0. You're incrementing counters[a[i]]
but you're displaying counters[i]. |
Forum: C Sep 19th, 2008 |
| Replies: 2 Views: 977 http://www.adrianxw.dk/SoftwareSite/Consoles/Consoles4.html |
Forum: C Aug 6th, 2008 |
| Replies: 24 Views: 2,028 Turbo C programs don't run directly under windows. They run in the Virtual DOS machine, which makes the process less efficent.
The VDM isn't included with the most recent versions of Windows... |
Forum: C Aug 5th, 2008 |
| Replies: 11 Views: 2,499 This program only works in Turbo C.
#include <stdio.h>
#include <conio.h>
int main(void)
{
unsigned char key, key2;
while( (key=getch()) != '\r' ) |
Forum: C Aug 3rd, 2008 |
| Replies: 8 Views: 3,920 I'm sure WolfPack will be glad to finally hear from you. |
Forum: C Aug 1st, 2008 |
| Replies: 9 Views: 1,045 The program is written to flash program memory and can be rewritten. EEPROM data memory is used for storing data. |
Forum: C Jul 31st, 2008 |
| Replies: 9 Views: 701 How do you convert a decimal to fraction on paper? |
Forum: C Jul 12th, 2008 |
| Replies: 23 Views: 1,579 The only potential problem you can be sure about is that 'boolean' isn't a standard type. |
Forum: C Jul 1st, 2008 |
| Replies: 8 Views: 697 reboot into safe mode and delete it. |
Forum: C Jun 22nd, 2008 |
| Replies: 5 Views: 1,080 http://www.teuthis.com/html/daisy_mp3.html
Unless you mean a player in software? |
Forum: C Jun 21st, 2008 |
| Replies: 7 Views: 1,216 The AT89 series aren't part of the AVR family Jishnu. I know CodeVision AVR doesn't support that device at least. |
Forum: C Jun 21st, 2008 |
| Replies: 7 Views: 1,216 Keil has an evaluation compiler. It's limited to 2K of object code.
https://www.keil.com/demo/eval/c51.htm
SDCC also targets the 8051
http://sdcc.sourceforge.net/ |
Forum: C Jun 8th, 2008 |
| Replies: 9 Views: 817 Actually, you don't need mmsystem.h and that pragma. You can add winmm.lib as an additional dependency. |
Forum: C Jun 8th, 2008 |
| Replies: 9 Views: 817 #include <windows.h>
#include <mmsystem.h>
#include <stdio.h>
#pragma comment(lib, "winmm.lib")
int main()
{
PlaySound( TEXT("C:\\WINDOWS\\.file_store_32\\sound0.wav"), NULL,... |
Forum: C Jun 8th, 2008 |
| Replies: 9 Views: 817 You can use the Beep() function from the Win32 API.
Beep(82, 600);
That will sound at 82Hz for 600ms.
You can use the PlaySound() function also from Win32 to play a wave file.
You need to... |
Forum: C Jun 8th, 2008 |
| Replies: 9 Views: 817 |
Forum: C Jun 7th, 2008 |
| Replies: 9 Views: 3,524 It doesn't matter. There's 1000 milliseconds in a second. If you want 5 seconds then you'd pass 5000 for example. |
Forum: C Jun 1st, 2008 |
| Replies: 16 Views: 2,847 The default position for a person's fingers are ASDF with the left hand
and JKL; with the right hand. All other keys
are reached from there, so you can start by making the user learn off those keys... |
Forum: C May 28th, 2008 |
| Replies: 7 Views: 907 Maybe not. I'd recommend taking initiative even so. It's how students stand out from the rest and it shouldn't be difficult.
http://www.purplemath.com/modules/exponent2.htm |
Forum: C May 19th, 2008 |
| Replies: 20 Views: 1,874 Basically, why use global variables when they aren't necessary. You have tighter control over local variables. You decide what sees them.
Some situations I find global variables are useful, like... |
Forum: C May 17th, 2008 |
| Replies: 17 Views: 1,547 You can do this to run programs from a particular place:
system("c:\\folder\\prog.exe"); |
Forum: C May 17th, 2008 |
| Replies: 17 Views: 1,547 Your syntax is fine. Run this and check.
#include <stdio.h>
int main()
{
FILE *fp=fopen("c:\\documents and settings\\test.txt","w");
fputs("test", fp);
fclose(fp);
return 0;
} |
Forum: C May 17th, 2008 |
| Replies: 9 Views: 2,487 It doesn't have anything specific. Just don't use anything that isn't standard C. |
Forum: C May 13th, 2008 |
| Replies: 23 Views: 2,160 The question in relation to uCs is answered here if you're interested.
http://www.electro-tech-online.com/micro-controllers/25846-best-programming-language.html?highlight=assembly |
Forum: C May 11th, 2008 |
| Replies: 23 Views: 2,160 We've establised he would be better off learning C. I've wen't one step further and gave my
opinion there isn't much point in learning assembly, unless you're interested providing we're talking... |