User Profile

Collapse

Profile Sidebar

Collapse
alexis4
alexis4
Last Activity: May 7 '13, 08:42 PM
Joined: Dec 2 '09
Location: Greece
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • You can use it as many times as you like, even if it's nested (switch into a switch).
    See more | Go to post

    Leave a comment:


  • alexis4
    started a topic usb implementation in Java
    in Java

    usb implementation in Java

    Hi!

    I have just studied the basics of java myself, started to learning its classes and made my "Hello Java project". Until now I was working with C# serial class, as a virtual comm port. I need above all to build the communication infastracture for my projects to come.
    I did some research, but I found some articles about some APIs for linux, some others are referring to "dead projects" for windows and most...
    See more | Go to post

  • alexis4
    replied to Training material for a beginner C programmer
    in C
    Also this is a good one:
    Beginning C: From Novice to Professional (Beginning: from Novice to Professional)
    http://www.amazon.com/Beginning-Novi.../dp/1590597354...
    See more | Go to post
    Last edited by Niheel; Dec 17 '11, 12:21 AM. Reason: When linking out, it's good to give some reference about what the landing page is

    Leave a comment:


  • alexis4
    replied to Split number into digits
    in C
    It seems correct. Does it work OK?
    See more | Go to post

    Leave a comment:


  • alexis4
    replied to Split number into digits
    in C
    How can that work? You are printing fin right? So:

    Loop 1: fin=12345/10000 = 1
    Loop 2: fin = 12345/1000 = 12

    So how could you separate the digit without the remainder?...
    See more | Go to post

    Leave a comment:


  • alexis4
    replied to Split number into digits
    in C
    Follow this algorithm:

    (12345/10000)%10 = 1
    (12345/1000)%10 = 2
    (12345/100)%10 = 3
    (12345/10)%10 = 4
    (12345/1)%10 = 5


    Implement this algorithm in code and off you go!

    EDIT: Obviously the "%10" in line 1 and the "/1" in line 5 is not needed. But I gave it this way to make the algorithm more obvious, in case you implement a loop.
    See more | Go to post

    Leave a comment:


  • alexis4
    replied to Loop back to the start of a program?
    in C
    I deleted my post because I thought you were asking for something else. The answer was irrelevant. Sorry for that.
    See more | Go to post

    Leave a comment:


  • alexis4
    replied to (void*)0 : what is this cast?
    in C
    Thank you donbock, all seems much more clear now!
    See more | Go to post

    Leave a comment:


  • alexis4
    replied to (void*)0 : what is this cast?
    in C
    Thanks once more donbock. I got the idea, but I missed the technical explanation. How can

    void fooMethod1(void *p, ...);

    protect my data accessed inside fooMethod1, while

    void fooMethod1(int *p, ...);

    cannot?
    See more | Go to post

    Leave a comment:


  • alexis4
    replied to (void*)0 : what is this cast?
    in C
    OK thank you both again, that made sence... So I wrote the below peace of dummy code:

    Code:
    void function1 (void *ptr);
    uint8 a = 10;
    uint8 *p;
    
    void main (void)
    {
      p = &a;	
      function1(p);
    }
    
    void function1 (void *ptr)
    {
      uint8 *pp;
      pp = (uint8 *)ptr;
      (*pp)++;
      pp = NULL;
    }
    The result at the end of function1()...
    See more | Go to post

    Leave a comment:


  • alexis4
    replied to (void*)0 : what is this cast?
    in C
    Thank you both for your answers.



    Can you please give me examples of using this or give me references to study this by myself? I am interested on how a type like this can be used as parameter passing. And what is the usage of passing such parameters in functions?

    Please note that I don't use C++, so examples on C is my main interest.

    Thanks again....
    See more | Go to post

    Leave a comment:


  • alexis4
    started a topic (void*)0 : what is this cast?
    in C

    (void*)0 : what is this cast?

    Hello!

    The below sample code is from string.h

    Code:
    #ifndef NULL
    #define NULL    ((void*)0)
    #endif

    What is this void* cast? Under what circumstances can it be used? Can you please give an example or a link reference?

    I thought that I recently saw passing an expression like that as an argument to a function. Is this true?

    Thanks!
    See more | Go to post

  • I feel a little weird answering after the experts, but I have recently done a similar thing not in C++, but in C. Add 365 days for each year and for the leap years you can control it like:

    Code:
    if (!(year % 4))
    {
      AddOneMoreDay();
    }

    Now for the last and first years which are not complete with 365 (or 366) days, you can add 30 for each month, using a switch-case at the same time like:
    ...
    See more | Go to post
    Last edited by alexis4; Oct 3 '11, 08:40 PM. Reason: Last paragraph added

    Leave a comment:


  • Well I learned C# for the same reason, just to display data sent by the MCU. Books are good to use, but to be honest I 've learned from googling.

    If you are completely new and didn't spend a lot of time yet on C#, also take a look at Java, it is very close to C# and it's cross platform.

    Cheers!
    See more | Go to post

    Leave a comment:


  • I saw the youtube video, the application seems to work just fine. But I agree 100% that the conversion must be done by the GUI. So if you use on the GUI side the same method you used on the MCU side (that is adding 0x30 to the hex value), you will get the same desired result on the PC monitor.

    So what you have is a string (let's name it str) from the RS232 port, that must be converted properly so that it can be displayed on the PC...
    See more | Go to post

    Leave a comment:


  • Post1:



    Post4:



    I am really confused. I want to help you but I cannot understand your problem. Read your posts from the beggining and you will see it too.

    You send raw hex bytes from the MCU, these bytes are succesfully received by the GUI and your problem is that you need to convert these bytes to ASCII format so that they will be readable from humans? Am I right? Is this...
    See more | Go to post

    Leave a comment:


  • You have Japanese windows? If so go to tools->options->enviroment->internationa l settings and in language choose "same as Microsoft windows". I don't know if that will solve it, but give it a shot.
    See more | Go to post

    Leave a comment:


  • 150 and 250Mb? I don't think that these videos will be downloaded from many people...

    Now if I understood correctly you need to convert ascii to hex right?
    If so, take a look at the following link, it explains how.

    http://www.dotnetspider.com/resource...ing-c-dot.aspx

    But anyway, a simple google search for "C# ascii to hex" will give you plenty of results....
    See more | Go to post

    Leave a comment:


  • Thank you Rabbit, I suppose you mean the android SDK in Eclipse, did I get that right?
    See more | Go to post

    Leave a comment:


  • Are Eclipse with WindowBuilder compatible with android programming?

    Hi!

    I am new to Java (actually did not even started yet, just seen some tutorials and read some articles). After my searching I decided to use Eclipse with WindowBuilder as the GUI designer tool. But if I decide to go with mobile programming also (android in specific), will this be enough, or I 'll need extra installation of other software?

    Thanks in advance!
    See more | Go to post
No activity results to display
Show More
Working...