Program to control an accelerometer, motors and a rangefinder using the ScmRTOS ported to mbed. (Work in progress and buggy)
main.cpp
00001 //****************************************************************************** 00002 //* 00003 //* FULLNAME: Single-Chip Microcontroller Real-Time Operating System 00004 //* 00005 //* NICKNAME: scmRTOS 00006 //* 00007 //* PROCESSOR: ARM Cortex-M3 00008 //* 00009 //* TOOLKIT: RVCT (ARM) 00010 //* 00011 //* PURPOSE: Port Test File 00012 //* 00013 //* Version: 3.10 00014 //* 00015 //* $Revision: 196 $ 00016 //* $Date:: 2010-09-09 #$ 00017 //* 00018 //* Copyright (c) 2003-2010, Harry E. Zhurov 00019 //* 00020 //* Permission is hereby granted, free of charge, to any person 00021 //* obtaining a copy of this software and associated documentation 00022 //* files (the "Software"), to deal in the Software without restriction, 00023 //* including without limitation the rights to use, copy, modify, merge, 00024 //* publish, distribute, sublicense, and/or sell copies of the Software, 00025 //* and to permit persons to whom the Software is furnished to do so, 00026 //* subject to the following conditions: 00027 //* 00028 //* The above copyright notice and this permission notice shall be included 00029 //* in all copies or substantial portions of the Software. 00030 //* 00031 //* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00032 //* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00033 //* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00034 //* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 00035 //* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 00036 //* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH 00037 //* THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00038 //* 00039 //* ================================================================= 00040 //* See http://scmrtos.sourceforge.net for documentation, latest 00041 //* information, license and contact details. 00042 //* ================================================================= 00043 //* 00044 //****************************************************************************** 00045 //* mbed port by Igor Skochinsky 00046 00047 #include <mbed.h> 00048 #include <scmRTOS.h> 00049 #include <processes.h> 00050 #include <serial.h> 00051 #include <Command_handler.h> 00052 #include <event_flags.h> 00053 #include <Servo_Control.h> 00054 #include <serial_out.h> 00055 #include <PING_rangefinder.h> 00056 #include <Motor_control.h> 00057 #include <accelerometer.h> 00058 //--------------------------------------------------------------------------- 00059 // 00060 00061 // 00062 00063 00064 00065 00066 00067 // 00068 int main() 00069 { 00070 00071 USB.baud(921600); 00072 USB.attach(USB_serial); 00073 //XB.baud(115200); 00074 //XB.attach(XB_serial); 00075 // configure IO pins 00076 //led1.write(0); 00077 //led2.write(0); 00078 00079 // run 00080 OS::Run(); 00081 } 00082 00083 00084 00085 00086 //--------------------------------------------------------------------------- 00087 00088 //--------------------------------------------------------------------------- 00089
Generated on Wed Jul 13 2022 05:20:16 by 1.7.2