-
January 22nd, 2013, 12:40 AM
#1
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.
-
January 22nd, 2013, 05:53 AM
#2
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
-
January 22nd, 2013, 07:35 AM
#3
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.
-
January 22nd, 2013, 07:41 AM
#4
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.
-
January 22nd, 2013, 07:53 AM
#5
Re: Anybody can do this...I really appreciate
Originally Posted by salisali
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
-
January 22nd, 2013, 08:13 AM
#6
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.
-
January 22nd, 2013, 10:48 AM
#7
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.
-
January 22nd, 2013, 07:48 AM
#8
Re: Anybody can do this...I really appreciate
Originally Posted by salisali
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
-
January 22nd, 2013, 11:10 AM
#9
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|