⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gps_send.c

📁 MANTIS是由科罗拉多大学开发的传感器网络嵌入式操作系统。 这是mantis的0.9.5版本的源码。
💻 C
字号:
//  This file is part of MANTIS OS, Operating System//  See http://mantis.cs.colorado.edu/////  Copyright (C) 2003,2004,2005 University of Colorado, Boulder////  This program is free software; you can redistribute it and/or//  modify it under the terms of the mos license (see file LICENSE)#include <inttypes.h>#include <avr/interrupt.h>#include <stdio.h>#include <ctype.h>#include "led.h"#include "msched.h"#include "uart.h"#include "adc.h"#include "gps.h"#define PHOTO_CHANNEL ADC_CH_2void gps_send_data();void start(void){  mos_thread_new(gps_send_data, 128, PRIORITY_NORMAL);}/** out put all the data to the base station  * The receiver side is the Java  */void gps_send_data(){  uint8_t i;  TSIPPKT *pkt;    gps_init(TSIP_PROTO);  mos_uart_open(0);  gps_set_mode(TSIP_AUTO_REPORT);  mos_adc_open();  while(1){         mos_led_toggle(2);	 pkt = (TSIPPKT *)gps_get_position();	 mos_uart_send(0,'#');	 for(i=0; i<12; i++){ //12 bytes for the lon, lat and alt	   mos_uart_send(0, pkt->buf[i]);	 }	 mos_uart_send(0, '$'); //the begin symbol for the photo sensor readings	 i = mos_adc_eight_polling(PHOTO_CHANNEL); 	 mos_uart_send(0, i);	 // uart_send(0, 'a');	 mos_uart_send(0,'|');  }//while1}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -