📄 sense_and_forward.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 "led.h"#include "dev.h"#include "com.h"#include "msched.h"#include "clock.h"static comBuf send_pkt; //comBuf goes in heapvoid send_thread ();void start (void){ mos_thread_new (send_thread, 128, PRIORITY_NORMAL);}void send_thread (){ send_pkt.size = 2; //2 bytes while(1) { mos_led_toggle(0); dev_read (DEV_MICA2_TEMP, &send_pkt.data[0], 1); com_send(IFACE_RADIO, &send_pkt); mos_thread_sleep(1000); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -