Search:

Type: Posts; User: samuelmoneill

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    2,881

    integer to hexadecimal

    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;...
  2. Replies
    1
    Views
    1,540

    Direction Pad - movement

    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...
  3. Replies
    5
    Views
    4,691

    brewbuck, you are right. The issue is code...

    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...
  4. Replies
    5
    Views
    4,691

    Cyclic Redundancy Check: disable

    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...
  5. Replies
    2
    Views
    941

    Process Help

    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...
  6. Replies
    8
    Views
    4,620

    Delete char from string?

    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] =...
  7. Replies
    1
    Views
    1,931

    CGROM table

    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"...
  8. Replies
    21
    Views
    6,426

    Is it essential to have a process running that is...

    Is it essential to have a process running that is constantly listening for bytes to read in the port?
  9. Replies
    21
    Views
    6,426

    As I stated incoming_comand is of type...

    As I stated incoming_comand is of type COMMAND_PACKET



    typedef struct
    {
    ubyte
    command;
    ubyte
    data_length;
  10. Replies
    21
    Views
    6,426

    Ok, I have tried a slightly different approach....

    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:...
  11. Replies
    21
    Views
    6,426

    Hi Mats here is my attempt at understanding...

    Hi Mats

    here is my attempt at understanding what you mean.



    void receive_packet(COMMAND_PACKET *packet)
    {
    int ret;
    unsigned char buf[2];
  12. Replies
    21
    Views
    6,426

    Yes the first thing I get back should be the...

    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...
  13. Replies
    21
    Views
    6,426

    Yes you are right, I don't really know what I am...

    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...
  14. Replies
    21
    Views
    6,426

    How about this? void...

    How about this?



    void receive_packet(COMMAND_PACKET *packet)
    {
    ubyte i;
    unsigned char readbuf[20];
    unsigned char received[20];
    int index;
  15. Replies
    21
    Views
    6,426

    I still don't fully know how to do it? Do I call...

    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...
  16. Replies
    21
    Views
    6,426

    Thanks Mats, should something like this do the...

    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...
  17. Replies
    21
    Views
    6,426

    Sure thing Mats, this is what I got from the...

    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...
  18. Replies
    21
    Views
    6,426

    Serial Port - Receive Packet

    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...
  19. Replies
    3
    Views
    1,106

    Thank you Ideswa. That worked a charm. But I...

    Thank you Ideswa. That worked a charm.

    But I have another question:



    //============================================================================
    // 631_WinTest Code.
    // Copyright...
  20. Replies
    3
    Views
    1,106

    How to call/use function

    Hi,

    I will set the pretext:



    typedef struct
    {
    ubyte
    command;
  21. Replies
    3
    Views
    1,184

    Thanks Mats but how would I find out the...

    Thanks Mats

    but how would I find out the number of bytes it has written or if it returns an error?
  22. Replies
    3
    Views
    1,184

    Function Write()

    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...
  23. Replies
    5
    Views
    2,118

    You are right ssharish. the compile error...

    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:

    ...
  24. Replies
    5
    Views
    2,118

    Compiler Warning

    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>
  25. Replies
    2
    Views
    3,057

    You are right thank you. It is defined in...

    You are right thank you.

    It is defined in another include file.
Results 1 to 25 of 37
Page 1 of 2 1 2