Search:

Type: Posts; User: sombrancelha

Search: Search took 0.01 seconds.

  1. Replies
    14
    Views
    2,838

    It worked! Thanks a lot!

    It worked! Thanks a lot!
  2. Replies
    14
    Views
    2,838

    %02x did the trick for the 0, but I'm still...

    %02x did the trick for the 0, but I'm still intrigued on why 0x80 get's printed ffffff80 - is that just a printing problem or is there something deeper? If it's just printing I don't care, as I will...
  3. Replies
    14
    Views
    2,838

    %0x still outputted 0 instead of 00 Regarding...

    %0x still outputted 0 instead of 00

    Regarding flow control: I don't use any hardware flow control, and I haven't set any software flow control either (maybe there's something - from the OS -, but...
  4. Replies
    14
    Views
    2,838

    Thanks! I used CuteCom and saw that it got the...

    Thanks!

    I used CuteCom and saw that it got the communication working nicely, so I saw what options it used (with stty -a -F /dev/ttyS0) and set them accordingly. What I miss-setting were INPCK,...
  5. Replies
    14
    Views
    2,838

    I don't use any flow control. This is what I...

    I don't use any flow control.

    This is what I am doing:



    char aux[8];
    unsigned char readRequest[5] = {0x80, 0x00, 0x7F, 0x6F, 0xFF};
    while (1)
    {
  6. Replies
    14
    Views
    2,838

    I got it, I hadn't set the c_cc[VTIME] and...

    I got it, I hadn't set the c_cc[VTIME] and c_cc[VMIN] parameters correctly. I was sending the bytes in the correct order - and the 3 extra bytes was due to my distraction (I was sending a 8 bytes...
  7. Replies
    14
    Views
    2,838

    Write to serial port

    Hello,

    I am trying to write to device connected via a serial port. It uses 8 data bits, 1 stop bit, even parity and a communication rate of 2400bps. I am developing in Linux.

    I need to send...
  8. Stupid me. I was reading a different number of...

    Stupid me. I was reading a different number of bytes inside the function (on the read() call), once I changed it I got the right result.
  9. Reading from serial port inside a method yields different results than from main

    Hello,

    I am developing an application that reads data from a serial port (on Ubuntu), and below is the relevant code used.



    int fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);...
  10. Replies
    3
    Views
    8,305

    scanf + EOF

    Hello,

    I think my problem is a little common, but I searched the forum and couldn't find a solution that worked for me.

    I have something like this



    while (scanf("%d", &i)){
    switch(i){
  11. Replies
    15
    Views
    36,316

    Create array of pointers dynamically

    Hello,

    I'm trying to dynamically create an array whose contents are pointers to a struct.

    Statically, I have something like this:



    typedef struct {
    ...
  12. Should I use fgets to grab the first line? In...

    Should I use fgets to grab the first line? In that case, I'd have to set a max size for a line, right? Although I could set a big max size, this has it's obvious problems.
  13. Read file line by line and interpret them

    Hello,

    I have to read a file, line by line, and do different things depending on what's in each line.

    The input consists of one command, some arguments (0, 1 or 2) and comments (everything...
  14. Yeah, I was thinking in automatically operating...

    Yeah, I was thinking in automatically operating the GUI. :( Too complex?

    Well, converting the files would suit my needs. It is SQL based.
  15. Read from txt and write in an external program

    Hello,

    I have an excel file which is being used as a database. A new software was developed to replace this excel file and I want to avoid typing all the information again. So I want to make a...
  16. Replies
    21
    Views
    6,670

    so i suppose there's no simple solution to that,...

    so i suppose there's no simple solution to that, right?

    even if it won't solve my problem, how do I print the unicode characters?
  17. Replies
    21
    Views
    6,670

    is it possible to print a character using...

    is it possible to print a character using unicode?

    If so, how?
  18. Replies
    21
    Views
    6,670

    thanks for the help it worked perfectly...

    thanks for the help
    it worked perfectly
    however, i'll consider using ordinary ASCII characters, because it is a lot simpler, even though the output does not look as nice as with the other...
  19. Replies
    21
    Views
    6,670

    dwks, i'm not sure I've understood your...

    dwks,

    i'm not sure I've understood your solution.. are you suggesting that the file should be read at a command-line program?

    And I didn't understand about the batch file.. what exactly is it?...
  20. Replies
    21
    Views
    6,670

    the problem is that someone else is going to...

    the problem is that someone else is going to correct my program (I'm making it for a University course).
    If I use this solution, the person will have to change theirs font.

    Is there any solution...
  21. Replies
    21
    Views
    6,670

    I'm Brazilian, so I give my variables names in...

    I'm Brazilian, so I give my variables names in portuguese. I don't use exit as a variable name, it was just for an example.


    for (i = 0; i < m; i++){
    for (j = 0; j < n; j++)
    ...
  22. Replies
    21
    Views
    6,670

    printf("%c", 176); fprintf(exit, "%c", 176);

    printf("&#37;c", 176);

    fprintf(exit, "%c", 176);
  23. Replies
    21
    Views
    6,670

    fprintf and non-ascii symbols

    Hello,

    I'm trying to print non-ascii symbols on a file, using

    fprintf(file_name, "%c", xxx), where xxx is the symbol number

    I'm trying to print symbols 176, 177, 178 and 219 from...
Results 1 to 23 of 23