I'm familiar with MPlab & MPASM, and have done a little bit of programming with the PIC. The only way, except using the eeprom, to do a lookup table in with a PIC MCU is to do something like this:
Put the number to be "looked up" in W and then,
call getdigit
;code below is a...
I have no idea how your my_malloc functions, but it could be due to segment wrap around. What value does the cohesion pointer start out at?
Kim_Christensen@telus.net
http://www3.bc.sympatico.ca/Kim_Christensen/index.html
I'm assuming you are writing win32 console applications and not DOS programs.
You may be able to use the keybd_event() win32 API function call to do this. I haven't tried it. I do know that the API function SetKeyboardState() won't change the caps lock key in Win32...
Win2000 may not allow an...
#include directives just "paste" the contents of the file named as is where the #include is placed. There is no magic here. Yes.... You have to re-compile everytime you change your source code if you want the changes to be relected in the EXE
What you may want to do instead, is place...
In Windows it is different. I haven't done any wave playback in Win32. In Win16 you could just use sndPlaySound(lpszSoundName, wFlags) where lpszSoundName is a string depicting the wavefile name and wFlags is either SND_SYNC or SND_ASYNC. Other options, such as playing a WAV file from a resource...
Ok... As per your e-mail here's code of how to do it in DOS:
Note: The commands to access IO ports may be different on your compiler.
/* Code to playback an 8bit *.wav file */
#include <stdio.h>
#define PORT 0x220 /* Soundblaster Base Port, change to 0x240 or whatever */
/* for...
Another idea is to compile the EXE using VC++ and then load the EXE into the Borland resource compiler and resave it as an RC file. Used to work with older Borland resource editors...
Kim_Christensen@telus.net
http://www3.bc.sympatico.ca/Kim_Christensen/index.html
For the date use strrchr() to find the last / in the string datebuf and replace it with a NULL or 0
For the time use strrchr() to find the last : in the string timebuf and replace it with a NULL or 0
Then do your
printf("Date: %s Time: %s\n",datebuf,timebuf)...
My next question would be; Are you able to use another program such as ProCom+ for DOS on Com 3&4 successfully?
Also, when you boot up the computer, does the BIOS indicate that it sees all four COM ports? I ask this because the BIOS may not be recognizing those ports and your PEEK method is...
Hmmmm... You may not have posted all your code, because I don't see where you are setting up the baud rate, stop bits, etc for the COM port. Missmatched baud rates between the computer and the PINpad may be your problem.
Kim_Christensen@telus.net...
Like rbobbitt mentioned, kbhit() can be used to wait for a keypress and perform background processing. Then all you gotta do is call getch() to retrieve the key. As mentioned, this is OS / compiler specific and not ANSI code. Untested code follows:
#include <stdio.h>
#include <conio.h>
int...
The following link has some usefull, though dated, info on using directx under Windoze. Can't help you with Unix..
http://www.loirak.com/prog/directx/basics.htm
You won't be able to make anything portable between Unix and MS Windows platforms as there are no standard C functions for graphics...
Like CCTC1 says, graphics are very operating system dependant. I don't know about UNIX, but Windows will NOT allow you to do direct screen writes without an API layer like directx. However, for small simple graphics and just kicking around learning programming, you can call Windows API functions...
First, check your capslock key!!!
Second, the serial port usually puts out voltages in the range of + or - 9 to 15 volts. You cannot change the voltage down to 3 to 5 volts using ANY type of software. This is strictly a hardware issue. Maybe you should try the parallel port instead...
Check your compiler options and see if under code generation you have the option for "floating point emulation" checked. Then recompile your program.
This may solve your problem.
Kim_Christensen@telus.net
http://www3.bc.sympatico.ca/Kim_Christensen/index.html
sound() is neither a C or C++ function or keyword.
Your example probably is older DOS code written for a compiler that supported this compiler specific function call. You are most likely compiling Win32 console programs with Borland C++ 5.5.1 which are only simular to DOS programs in looks. You...
It sounds like you may be writing a game...
For more flexable control of the keyboard, you would need to write your own keyboard handler: ie hooking the keyboard interrupt INT 9 and reading the scan codes. This will allow the user to press two or more keys at once etc...
There may be a way to...
Assuming your compiler supports it, try something like this:
#include <conio.h>
int key;
if (kbhit()) key = getch();
Kim_Christensen@telus.net
http://www3.bc.sympatico.ca/Kim_Christensen/index.html
#include <stdio.h>
char YourString[] = "Hello there, and how are you today?";
printf( "%s", YourString );
Kim_Christensen@telus.net
http://www3.bc.sympatico.ca/Kim_Christensen/index.html
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.