CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2013
    Posts
    6

    Anybody can do this...I really appreciate

    Hello Everybody.
    This is my 1st post.
    I wonder if someone helps me with this problem:
    I want to connect a rc toy car to the computer with usb cable and program a program that allows me to control the car just by keyboard(up, down, left, right arrows). And the thing that I want is the source code of cotroling it in c++.
    I beg you to help me...I need to know.
    ThanksAgain.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Anybody can do this...I really appreciate

    What is "a rc toy car"? Does it have some manual about "to control the car just by keyboard" or by some other means?
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2013
    Posts
    6

    Re: Anybody can do this...I really appreciate

    It's a toy car which is controlled by a controller.
    Of course it doesn't, I want to build it but what it is, is not important.
    The major point I need to get is just the code for c++.

    For example for moving a label in vb:
    If keycode=47 then
    Label1.left=label1.left+50
    End If
    (I'm not sure about "47", sorry)

    And the one that I want in c++:
    The CODE that allows me to move the car (connected with a usb cable to usb port) by the arrows.

    I hope you help me by sending the CODE and thank you for replying fast.
    Thanks.

  4. #4
    Join Date
    Jan 2013
    Posts
    6

    Re: Anybody can do this...I really appreciate

    It's a toy car which is controlled by a controller.
    Of course it doesn't, I want to build it but what it is, is not important.
    The major point I need to get is just the code for c++.

    For example for moving a label in vb:
    If keycode=47 then
    Label1.left=label1.left+50
    End If
    (I'm not sure about "47", sorry)

    And the one that I want in c++:
    The CODE that allows me to move the car (connected with a usb cable to usb port) by the arrows.

    I hope you help me by sending the CODE and thank you for replying fast.
    Thanks.

  5. #5
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Anybody can do this...I really appreciate

    Quote Originally Posted by salisali View Post
    It's a toy car which is controlled by a controller.
    Of course it doesn't, I want to build it but what it is, is not important.
    The major point I need to get is just the code for c++.
    There are no standard functions in C++ to "control toy cars". Unless you have an API (Application Programming Interface) or SDK for this toy car, no one can help you. That is how you control devices -- the manufacturer already has a programming library available, and you call the functions in the library to do whatever needs to be done.

    Regards,

    Paul McKenzie

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Anybody can do this...I really appreciate

    Quote Originally Posted by salisali View Post
    For example for moving a label in vb:
    If keycode=47 then
    Label1.left=label1.left+50
    End If
    (I'm not sure about "47", sorry)

    And the one that I want in c++:
    The CODE that allows me to move the car (connected with a usb cable to usb port) by the arrows.
    Well, you can move the label just because the label already has some properties (like left, right, top, ...) and it also has some methods to redraw itself after a property has been changed.

    So, how about your toy car? Which property/methods does it have? How to access/get/set/change them? Do you have some SDK to work with that car?
    Victor Nijegorodov

  7. #7
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Anybody can do this...I really appreciate

    As Paul said, you need the documentation for the controller in the car. It may even come with some example, but your question as asked, can't be answered.

  8. #8
    Join Date
    Jan 2013
    Posts
    6

    The story...

    You mentioned good points that I haven't noticed.thanks.

    so let me tell the story...
    My teacher has assigned me to bring him the code and he said it is at most 5 lines to be built and now I'm shocked on what you saying.

    Conclusion:
    Maybe...
    1.He didn't know what he ordered.
    2.You are making it complex while it's easy to make.
    3.He knew but he wanted me to research.

    But pleeeaaase...I'm just a beginner, what are APIs & SDKs?
    Finally, thanks a lot and I wonder if you just send me a hypothetical code supposing there are API & SDK to be given to my teacher for example:

    If (getch()==47)
    Car.wheel+=50;

    Although it's nonsense but I would be grateful if you send me the better one, I will work on his mind to satisfy.
    ThanksAgain.

  9. #9
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Anybody can do this...I really appreciate

    You're not asking a question that anybody here can answer. Five lines is nonsense. Nobody here is going to guess or make up a hypothetical program. What's the point? Google can help you find what an API or SDK is. The answer's not going to change no matter how many times you ask.

    Go back to your teacher and ask him for the car's controller's documentation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured