![](/media/cache/profiles/2a0f97f81755e2878b264adf39cba68e.50x50_q85.jpg)
Program to control an accelerometer, motors and a rangefinder using the ScmRTOS ported to mbed. (Work in progress and buggy)
Hexacopter/serial_out.h
- Committer:
- jberry
- Date:
- 2010-11-01
- Revision:
- 0:9b057566f9ee
File content as of revision 0:9b057566f9ee:
#pragma once #ifndef SERIAL_OUT_H #define SERIAL_OUT_H #include <processes.h> #include <Mutexes.h> #include <channels.h> #include <serial.h> //DigitalOut led3(LED3); extern BusOut leds; template<> OS_PROCESS void Serial_Out::Exec() //Output stream handling process { char temp1 = 0; //led3 = 0; //char buf[50] = "output process working.\n"; for(;;) { //Sleep(500); TX_channel.pop(temp1); leds = 0x8; //wait_ms(200); //simulate delays //Sleep(10); //led3 = !led3; //OUT->printf(buf); //if(OUT == &USB) //{ //Serial_Mutex.Lock(); //XB_Mutex.Lock(); if(OUT->writeable()) { OUT->putc(temp1); //XB_Mutex.Unlock(); } else { //TX_channel.push_front(temp1); //OUT->printf("output is not writeable!\n"); //Sleep(0.5); //sleep } //Serial_Mutex.Unlock(); //} leds = 0x8; } } #endif