给出<Arduino.h>和<inttypes.h>和 <Stream.h>3个头文件的代码
时间: 2023-09-15 15:16:34 浏览: 134
以下是<Arduino.h>头文件的代码示例:
```c++
#ifndef Arduino_h
#define Arduino_h
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include "binary.h"
#include "itoa.h"
#include "pins_arduino.h"
#include "wiring.h"
#include "wiring_analog.h"
#include "wiring_digital.h"
#include "wiring_pulse.h"
#include "wiring_shift.h"
#include "WInterrupts.h"
#ifdef __cplusplus
extern "C"{
#endif
void setup(void);
void loop(void);
#ifdef __cplusplus
} // extern "C"
#endif
#endif
```
以下是<inttypes.h>头文件的代码示例:
```c++
#ifndef _INTTYPES_H_
#define _INTTYPES_H_
#include <stdint.h>
#define PRId8 "d"
#define PRId16 "d"
#define PRId32 "ld"
#define PRId64 "lld"
#define PRIi8 "i"
#define PRIi16 "i"
#define PRIi32 "li"
#define PRIi64 "lli"
#define PRIo8 "o"
#define PRIo16 "o"
#define PRIo32 "lo"
#define PRIo64 "llo"
#define PRIu8 "u"
#define PRIu16 "u"
#define PRIu32 "lu"
#define PRIu64 "llu"
#define PRIx8 "x"
#define PRIx16 "x"
#define PRIx32 "lx"
#define PRIx64 "llx"
#define PRIX8 "X"
#define PRIX16 "X"
#define PRIX32 "lX"
#define PRIX64 "llX"
#define PRIdPTR "ld"
#define PRIiPTR "li"
#define PRIoPTR "lo"
#define PRIuPTR "lu"
#define PRIxPTR "lx"
#define PRIXPTR "lX"
#define SCNd8 "hhd"
#define SCNd16 "hd"
#define SCNd32 "ld"
#define SCNd64 "lld"
#define SCNi8 "hhi"
#define SCNi16 "hi"
#define SCNi32 "li"
#define SCNi64 "lli"
#define SCNo8 "hho"
#define SCNo16 "ho"
#define SCNo32 "lo"
#define SCNo64 "llo"
#define SCNu8 "hhu"
#define SCNu16 "hu"
#define SCNu32 "lu"
#define SCNu64 "llu"
#define SCNx8 "hhx"
#define SCNx16 "hx"
#define SCNx32 "lx"
#define SCNx64 "llx"
#define SCNdPTR "ld"
#define SCNiPTR "li"
#define SCNoPTR "lo"
#define SCNuPTR "lu"
#define SCNxPTR "lx"
#endif
```
以下是<Stream.h>头文件的代码示例:
```c++
/*
Stream.h - library for stream base class
Copyright (C) 2006-2009 David A. Mellis
Modified 23 November 2010 by Mark Sproul
Modified 3 December 2017 by Chuck Todd
*/
#ifndef Stream_h
#define Stream_h
#include "Print.h"
#define DEC 10
#define HEX 16
#define OCT 8
#define BIN 2
class Stream : public Print
{
public:
virtual int available() = 0;
virtual int read() = 0;
virtual int peek() = 0;
virtual void flush() = 0;
};
#endif
```
阅读全文