Hi,
I am programming a PIC controller and need to be able to do hexadecimal manipulation.
Here is my code in MikroC
int percentage percent_digit1, percent_digit2, percent_digit3;...
Type: Posts; User: samuelmoneill
Hi,
I am programming a PIC controller and need to be able to do hexadecimal manipulation.
Here is my code in MikroC
int percentage percent_digit1, percent_digit2, percent_digit3;...
I am writing a menu system for an LCD screen. The screen has 6 buttons, Up, Down, Left, Right, Select, Cancel.
I have written the following code to scroll up and down through the menu. Here is my...
brewbuck,
you are right. The issue is code size. If I could fool the CRC to think that it only has one element in the lookup table that would dramatically reduce its size. Or as you say to use an...
Does anyone know if it is possible to disable or fool a CRC?
I am writing a program in C to interact with an LCD screen through a Serial Com Port on a WinXP machine.
The issue is that the LCD...
Hi,
I have written a program in C that opens Com Port 1 and sends characters to an LCD screen it can also read in packet responses from the LCD screen. But if I press a button on the LCD device I...
Is it possible to set an index of a char array (string) to NULL.
I know that you cant do the following:
int MAXBUFFERSIZE] = 5
char buffer[MAXBUFFERSIZE];
buffer[4] = 't';
buffer[4] =...
Hi,
I am writing a program that takes user input from a WinXP machine and sends it through a Serial Com Port to an LCD Screen.
The LCD screen has an in-built CGROM table for example the "tab"...
Is it essential to have a process running that is constantly listening for bytes to read in the port?
As I stated incoming_comand is of type COMMAND_PACKET
typedef struct
{
ubyte
command;
ubyte
data_length;
Ok, I have tried a slightly different approach. This way it says that I am receiving 1 byte from the port. But I am having trouble with casting the receive buffer as a COMMAND_PACKET. Error:...
Hi Mats
here is my attempt at understanding what you mean.
void receive_packet(COMMAND_PACKET *packet)
{
int ret;
unsigned char buf[2];
Yes the first thing I get back should be the command.
The packet type for this particular packet as far as I know is 0x40 as defined in the data sheet
0 (0x00): Ping Command
The LCD will...
Yes you are right, I don't really know what I am doing. Can you explain it to me please?
At this stage I know how to write a file to the Com port. One of the commands write a ping request to the...
How about this?
void receive_packet(COMMAND_PACKET *packet)
{
ubyte i;
unsigned char readbuf[20];
unsigned char received[20];
int index;
I still don't fully know how to do it?
Do I call the readFile() function first?
How do I get and store the information of command and legth from the packet?
void...
Thanks Mats, should something like this do the trick? But it doesn't work? Do you know where I have gone wrong?
void receive_packet(COMMAND_PACKET *packet)
{
ubyte i;
unsigned...
Sure thing Mats,
this is what I got from the data sheet:
0 (0x00): Ping Command
The LCD will return the Ping Command to the host.
type = 0x00 = 010
valid data_length is 0 to 16...
Hi guys,
I have a program that currently opens a serial com port on WinXP machine and sends data in a packet to an LCD screen. But some of the commands for the LCD screen require the program to...
Thank you Ideswa. That worked a charm.
But I have another question:
//============================================================================
// 631_WinTest Code.
// Copyright...
Hi,
I will set the pretext:
typedef struct
{
ubyte
command;
Thanks Mats
but how would I find out the number of bytes it has written or if it returns an error?
Hi,
can anyone tell me how to get the retun value of the function:
write(int fildes, const void *buf, size_t ubyte);
Would I be right in saying that the return value of -1 for the...
You are right ssharish.
the compile error occurs here:
if((bytes_written=write(handle, data, length)) != length)
What I did to correct this error was cast handle as an int:
...
Hi guys,
I am having difficulty with the following compiler warning:
[Warning] passing arg 1 of 'write' makes integer from pointer without a cast
#include <windows.h>
#include <stdio.h>
You are right thank you.
It is defined in another include file.