|
发表于 2021-12-21 08:03:18
|
显示全部楼层
- // 头文件 my.h
- #ifnddef __MY_H_FILE__
- #define __MY_H_FILE__
- enum MY_E_VAR = {
- X=9,
- Y=8,
- Z=7,
- ;}
- void setup();
- void loop();
- void init(void);
- void mask(char J);
- void send(char K);
- void draw(char G[8]);
- #endif
- // C 代码文件 my.c
- #include "my.h"
- void setup() {
- pinMode(X, OUTPUT);
- pinMode(Y, OUTPUT);
- pinMode(Z, OUTPUT);
- init();
- }
- void loop() {
- ...
- draw(0,"start");
- ...
- }
- void init(void)
- {
- char a1,a2
- ...
- send(a2)
- ...
- }
- void mask(char J)
- {
- ...
- digitalWrite
- ...
- }
- void send(char K)
- {
- char c1,c2,c3
- ...
- mask(c1)
- ...
- }
- void draw(char G[8])
- {
- int d1,d2
- ...
- send(G[d2]);
- }
复制代码 |
|