My objective is to be able to receive variables or data from various sensors on the Arduino board and, also, to control actuator, such as motors, using the computer by programming in C++. I want to be able to program like RoboRealm and do other more power-demanding task on the computer and have it to control motors and sensors.
I would really want some ways to do that. I have tried different thing on the internet... but none of them seem to work. Is there any simple way to do this??
I read about how to set up a serial connection in the Playground: http://www.arduino.cc/playground/Interfacing/CPPWindows
I tried to build the code but that gave me some error.
1>------ Rebuild All started: Project: ComputerControl, Configuration: Debug Win32 ------ 1>Deleting intermediate and output files for project 'ComputerControl', configuration 'Debug|Win32' 1>Compiling... 1>stdafx.cpp 1>Compiling... 1>ComputerControl.cpp 1>c:\b-drive\clubs\mech warfare\arduino robot\computercontrol\computercontrol\computercontrol.cpp(17) : error C2664: 'CreateFileW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast 1>Build log was saved at "file://c:\B-Drive\Clubs\Mech Warfare\Arduino Robot\ComputerControl\ComputerControl\Debug\BuildLog.htm" 1>ComputerControl - 1 error(s), 0 warning(s) ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Then I tried to cast 'LPCWSTR' to the parameter 1 (port). I got another error.
1>------ Rebuild All started: Project: ComputerControl, Configuration: Debug Win32 ------ 1>Deleting intermediate and output files for project 'ComputerControl', configuration 'Debug|Win32' 1>Compiling... 1>stdafx.cpp 1>Compiling... 1>ComputerControl.cpp 1>Compiling manifest to resources... 1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0 1>Copyright (C) Microsoft Corporation. All rights reserved. 1>Linking... 1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup 1>C:\B-Drive\Clubs\Mech Warfare\Arduino Robot\ComputerControl\Debug\ComputerControl.exe : fatal error LNK1120: 1 unresolved externals 1>Build log was saved at "file://c:\B-Drive\Clubs\Mech Warfare\Arduino Robot\ComputerControl\ComputerControl\Debug\BuildLog.htm" 1>ComputerControl - 2 error(s), 0 warning(s) ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Is this the right way to do this? Or are there other solutions?