C/C++
legocpp.txt
Associated article: Mindstorms Robotics and Visual C++
Tags: C/C++
Published source code accompanying the article by David Wendt in which he a Visual C++ MFC program that combines Mindstorm Robotics RCX code with C++ code to achieve a control robot's behavior. Also see LEGOCPP.ZIP.
Mindstorm Robotics and Visual C++
by David Wendt
Listing One
void TorbotDlg::OnDownload()
{
m_spirit.SelectPrgm( PROGRAM_5 ); // (1) program 5
m_spirit.BeginOfTask( TASK_0 ); // (2) start task generation
{
m_spirit.SetVar( VAR_0, SRC_CONSTANT,0 ); // (3) set var0 to 0
// (4) set sensor 1 to switch
m_spirit....


