-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworldline_clock.cpp
48 lines (37 loc) · 970 Bytes
/
worldline_clock.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
Name: worldline_clock.ino
Created: 2017/7/7 1:25:19
Author: AraragiEro
*/
//----------------------附加库-------------------------
#include "class_initialization.h"
#include <SPI.h>
#define PT_USE_TIMER
#include <pt.h>
#include <pt-timer.h>
#include <SPI.h>
#include <DS3231.h>
//-------------------线程初始化--------------
static struct pt pt_time;
static struct pt pt_worldline;
static struct pt pt_digital;
//-----------------------setup----------------------------
void setup()
{
SPI.setClockDivider(SPI_CLOCK_DIV2);
//线程初始化--------------------
PT_INIT(&pt_worldline);//
PT_INIT(&pt_time);
PT_INIT(&pt_digital);
E_Glow_tube.change_state(worldlinechange_state);
//引脚按钮初始化
pinMode(worldline_button, INPUT_PULLUP);
pinMode(SPIdataPin, OUTPUT);
pinMode(SPIclockPin, OUTPUT);
pinMode(HC595, OUTPUT);
}
//----------------------loop-----------------------------
void loop()
{
pt_worldline_mission(&pt_worldline);
}