中级光能
此贴禁水,禁挖坟,禁求采纳,禁求豆
违反的举报走起好吧!
大家可以选择是玩mods服还是原版服
玩mods服的玩家要注意mods必须支持1.21Forge(最新版本),且能在游戏加载
玩原版服的可以选择模式:生存/创造
mods服地址:frp-bus.top:37686
原版服地址: frp-bus.top:28143
有问题可以在评论区说,我尽力一一解答
还有上次说要加mods的我试了,好多不能加载
所以我打算学习大佬们制作城市,名字大家可以在下方回答,投票的话点赞就行
崔安昊在2024-08-04 13:44:16追加了内容
┭┮﹏┭┮大家多多关注一下吧,孩纸真的没豆了
崔安昊在2024-08-04 13:59:21追加了内容
大家别喷行吗
我现在不打算开生存了,我打算和大家一起建造城市,想报名的人在评论区扣+1
欢迎各位大佬提意见,
崔安昊在2024-08-04 14:59:25追加了内容
加入时,名字请改成
X.X.X
崔安昊在2024-08-04 15:25:37追加了内容
这tm是哪个sb mb的给lz站出来!
崔安昊在2024-08-04 15:26:19追加了内容
WCNM日你M的
崔安昊在2024-08-09 20:58:35追加了内容
MC出1.21.1了快去看看
崔安昊在2024-08-13 14:33:19追加了内容
#include<Wire.h>
#include<Adafruit_PWMServoDriver.h>
#include<ESP8266WiFi.h>
#include<TimeLib.h>
#include<NtpClientLib.h>
Adafruit_PWMServoDriver pwm0=Adafruit_PWMServoDriver(0x40);
Adafruit_PWMServoDriver pwm1=Adafruit_PWMServoDriver(0x41);
Adafruit_PWMServoDriver pwm2=Adafruit_PWMServoDriver(0x42);
int8_t timeZone=8;
const PROGMEM char *ntpServer="ntp1.aliyun.com";
#define SERVOMIN 200
#define SERVONAX 400
#define USMIN 600
#define USMAX 2400
#define SERVO_FREQ 50
int DateYear=0;
int DateMonth=0;
int DateDay=0;
int DateHour=0;
int DateMinute=0;
int DateSecond=0;
int num1;
int num2;
int num3;
int num4;
int num5;
int num6;
uint8_t servonum=8;
void SerialPrint(){
Serial.print(DateHour);
Serial.print("时");
Serial.print(DateMinute);
Serial.print("分");
Serial.print(DateSecond);
Serial.println("秒");
}
报错
In file included from C:\Users\有梦想的咸鱼\Documents\Arduino\DC\DC.ino:5:
c:\Users\�����������\Documents\Arduino\libraries\NtpClientLib\src/NtpClientLib.h:501:32: error: reference to 'byte' is ambiguous
501 | bool summertime (int year, byte month, byte day, byte hour, byte weekday, byte tzHours);
| ^~~~
In file included from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/LwipDhcpServer.h:36,
from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFiAP.h:30,
from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:35,
from C:\Users\有梦想的咸鱼\Documents\Arduino\DC\DC.ino:3:
c:\users\�����������\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.1.0-gcc10.3-e5f9fec\xtensa-lx106-elf\include\c++\10.3.0\cstddef:69:14: note: candidates are: 'enum class std::byte'
69 | enum class byte : unsigned char {};
| ^~~~
In file included from C:\Users\�����������\AppData\Local\Temp\arduino\sketches\738002A724BF963E6778CA7962F2CC20\sketch\DC.ino.cpp:1:
C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/Arduino.h:161:17: note: 'typedef uint8_t byte'
161 | typedef uint8_t byte;
| ^~~~
In file included from C:\Users\有梦想的咸鱼\Documents\Arduino\DC\DC.ino:5:
c:\Users\�����������\Documents\Arduino\libraries\NtpClientLib\src/NtpClientLib.h:501:32: error: 'byte' has not been declared
501 | bool summertime (int year, byte month, byte day, byte hour, byte weekday, byte tzHours);
| ^~~~
c:\Users\�����������\Documents\Arduino\libraries\NtpClientLib\src/NtpClientLib.h:501:44: error: reference to 'byte' is ambiguous
501 | bool summertime (int year, byte month, byte day, byte hour, byte weekday, byte tzHours);
| ^~~~
In file included from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/LwipDhcpServer.h:36,
from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFiAP.h:30,
from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:35,
from C:\Users\有梦想的咸鱼\Documents\Arduino\DC\DC.ino:3:
c:\users\�����������\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.1.0-gcc10.3-e5f9fec\xtensa-lx106-elf\include\c++\10.3.0\cstddef:69:14: note: candidates are: 'enum class std::byte'
69 | enum class byte : unsigned char {};
| ^~~~
In file included from C:\Users\�����������\AppData\Local\Temp\arduino\sketches\738002A724BF963E6778CA7962F2CC20\sketch\DC.ino.cpp:1:
C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/Arduino.h:161:17: note: 'typedef uint8_t byte'
161 | typedef uint8_t byte;
| ^~~~
In file included from C:\Users\有梦想的咸鱼\Documents\Arduino\DC\DC.ino:5:
c:\Users\�����������\Documents\Arduino\libraries\NtpClientLib\src/NtpClientLib.h:501:44: error: 'byte' has not been declared
501 | bool summertime (int year, byte month, byte day, byte hour, byte weekday, byte tzHours);
| ^~~~
c:\Users\�����������\Documents\Arduino\libraries\NtpClientLib\src/NtpClientLib.h:501:54: error: reference to 'byte' is ambiguous
501 | bool summertime (int year, byte month, byte day, byte hour, byte weekday, byte tzHours);
| ^~~~
In file included from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/LwipDhcpServer.h:36,
from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFiAP.h:30,
from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:35,
from C:\Users\有梦想的咸鱼\Documents\Arduino\DC\DC.ino:3:
c:\users\�����������\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.1.0-gcc10.3-e5f9fec\xtensa-lx106-elf\include\c++\10.3.0\cstddef:69:14: note: candidates are: 'enum class std::byte'
69 | enum class byte : unsigned char {};
| ^~~~
In file included from C:\Users\�����������\AppData\Local\Temp\arduino\sketches\738002A724BF963E6778CA7962F2CC20\sketch\DC.ino.cpp:1:
C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/Arduino.h:161:17: note: 'typedef uint8_t byte'
161 | typedef uint8_t byte;
| ^~~~
In file included from C:\Users\有梦想的咸鱼\Documents\Arduino\DC\DC.ino:5:
c:\Users\�����������\Documents\Arduino\libraries\NtpClientLib\src/NtpClientLib.h:501:54: error: 'byte' has not been declared
501 | bool summertime (int year, byte month, byte day, byte hour, byte weekday, byte tzHours);
| ^~~~
c:\Users\�����������\Documents\Arduino\libraries\NtpClientLib\src/NtpClientLib.h:501:65: error: reference to 'byte' is ambiguous
501 | bool summertime (int year, byte month, byte day, byte hour, byte weekday, byte tzHours);
| ^~~~
In file included from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/LwipDhcpServer.h:36,
from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFiAP.h:30,
from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:35,
from C:\Users\有梦想的咸鱼\Documents\Arduino\DC\DC.ino:3:
c:\users\�����������\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.1.0-gcc10.3-e5f9fec\xtensa-lx106-elf\include\c++\10.3.0\cstddef:69:14: note: candidates are: 'enum class std::byte'
69 | enum class byte : unsigned char {};
| ^~~~
In file included from C:\Users\�����������\AppData\Local\Temp\arduino\sketches\738002A724BF963E6778CA7962F2CC20\sketch\DC.ino.cpp:1:
C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/Arduino.h:161:17: note: 'typedef uint8_t byte'
161 | typedef uint8_t byte;
| ^~~~
In file included from C:\Users\有梦想的咸鱼\Documents\Arduino\DC\DC.ino:5:
c:\Users\�����������\Documents\Arduino\libraries\NtpClientLib\src/NtpClientLib.h:501:65: error: 'byte' has not been declared
501 | bool summertime (int year, byte month, byte day, byte hour, byte weekday, byte tzHours);
| ^~~~
c:\Users\�����������\Documents\Arduino\libraries\NtpClientLib\src/NtpClientLib.h:501:79: error: reference to 'byte' is ambiguous
501 | bool summertime (int year, byte month, byte day, byte hour, byte weekday, byte tzHours);
| ^~~~
In file included from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/LwipDhcpServer.h:36,
from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFiAP.h:30,
from C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\libraries\ESP8266WiFi\src/ESP8266WiFi.h:35,
from C:\Users\有梦想的咸鱼\Documents\Arduino\DC\DC.ino:3:
c:\users\�����������\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.1.0-gcc10.3-e5f9fec\xtensa-lx106-elf\include\c++\10.3.0\cstddef:69:14: note: candidates are: 'enum class std::byte'
69 | enum class byte : unsigned char {};
| ^~~~
In file included from C:\Users\�����������\AppData\Local\Temp\arduino\sketches\738002A724BF963E6778CA7962F2CC20\sketch\DC.ino.cpp:1:
C:\Users\�����������\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2\cores\esp8266/Arduino.h:161:17: note: 'typedef uint8_t byte'
161 | typedef uint8_t byte;
| ^~~~
In file included from C:\Users\有梦想的咸鱼\Documents\Arduino\DC\DC.ino:5:
c:\Users\�����������\Documents\Arduino\libraries\NtpClientLib\src/NtpClientLib.h:501:79: error: 'byte' has not been declared
501 | bool summertime (int year, byte month, byte day, byte hour, byte weekday, byte tzHours);
| ^~~~
exit status 1
Compilation error: exit status 1
这个是arduino的
崔安昊在2024-08-14 08:07:33追加了内容
@薛乘志大佬那个修好了这又来一个Compilation error: 'class NTPClient' has no member named 'getTimeHour24'; did you mean 'getTimeZone'?
代码如下
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
#include <ESP8266WiFi.h>
#include <TimeLib.h>
#include <NtpClientLib.h>
Adafruit_PWMServoDriver pwm0 = Adafruit_PWMServoDriver(0x40);
Adafruit_PWMServoDriver pwm1 = Adafruit_PWMServoDriver(0x41);
Adafruit_PWMServoDriver pwm2 = Adafruit_PWMServoDriver(0x42);
int8_t timeZone = 8;
const PROGMEM char *ntpServer = "ntp1.aliyun.com";
#define SERVOMIN
#define SERVOMAX
#define USMIN 600
#define USMAX 2400
#define SERVO_FREQ 50
int DateYear = 0;
int DateMonth = 0;
int DateDay = 0;
int DateHour = 0;
int DateMinute = 0;
int DateSecond = 0;
int num1;
int num2;
int num3;
int num4;
int num5;
int num6;
uint8_t servonum = 8;
void SerialPrint()
{
Serial.print(DateHour);
Serial.print("时");
Serial.print(DateMinute);
Serial.print("分");
Serial.print(DateSecond);
Serial.println("秒");
}
void setServo(int groups,int num)
{
if(groups == 1){
if(num == 0){
pwm0.setPWM(0,0,SERVOMIN);pwm0.setPWM(1,0,SERVOMIN);pwm0.setPWM(2,0,SERVOMAX);pwm0.setPWM(3,0,SERVOMAX);pwm0.setPWM(4,0,SERVOMAX);pwm0.setPWM(5,0,SERVOMIN);pwm0.setPWM(6,0,SERVOMIN);
}else if(num == 1){
pwm0.setPWM(0,0,SERVOMAX);pwm0.setPWM(1,0,SERVOMAX);pwm0.setPWM(2,0,SERVOMAX);pwm0.setPWM(3,0,SERVOMAX);pwm0.setPWM(4,0,SERVOMIN);pwm0.setPWM(5,0,SERVOMIN);pwm0.setPWM(6,0,SERVOMAX);
}else if(num == 2){
pwm0.setPWM(0,0,SERVOMIN);pwm0.setPWM(1,0,SERVOMAX);pwm0.setPWM(2,0,SERVOMAX);pwm0.setPWM(3,0,SERVOMIN);pwm0.setPWM(4,0,SERVOMAX);pwm0.setPWM(5,0,SERVOMAX);pwm0.setPWM(6,0,SERVOMIN);
}else if(num == 3){
pwm0.setPWM(0,0,SERVOMIN);pwm0.setPWM(1,0,SERVOMAX);pwm0.setPWM(2,0,SERVOMAX);pwm0.setPWM(3,0,SERVOMIN);pwm0.setPWM(4,0,SERVOMIN);pwm0.setPWM(5,0,SERVOMIN);pwm0.setPWM(6,0,SERVOMIN);
}else if(num == 4){
pwm0.setPWM(0,0,SERVOMAX);pwm0.setPWM(1,0,SERVOMIN);pwm0.setPWM(2,0,SERVOMAX);pwm0.setPWM(3,0,SERVOMIN);pwm0.setPWM(4,0,SERVOMIN);pwm0.setPWM(5,0,SERVOMIN);pwm0.setPWM(6,0,SERVOMAX);
}else if(num == 5){
pwm0.setPWM(0,0,SERVOMIN);pwm0.setPWM(1,0,SERVOMIN);pwm0.setPWM(2,0,SERVOMIN);pwm0.setPWM(3,0,SERVOMIN);pwm0.setPWM(4,0,SERVOMIN);pwm0.setPWM(5,0,SERVOMIN);pwm0.setPWM(6,0,SERVOMIN);
}else if(num == 6){
pwm0.setPWM(0,0,SERVOMIN);pwm0.setPWM(1,0,SERVOMIN);pwm0.setPWM(2,0,SERVOMIN);pwm0.setPWM(3,0,SERVOMIN);pwm0.setPWM(4,0,SERVOMAX);pwm0.setPWM(5,0,SERVOMIN);pwm0.setPWM(6,0,SERVOMIN);
}else if(num == 7){
pwm0.setPWM(0,0,SERVOMIN);pwm0.setPWM(1,0,SERVOMAX);pwm0.setPWM(2,0,SERVOMAX);pwm0.setPWM(3,0,SERVOMAX);pwm0.setPWM(4,0,SERVOMIN);pwm0.setPWM(5,0,SERVOMIN);pwm0.setPWM(6,0,SERVOMAX);
}else if(num == 8){
pwm0.setPWM(0,0,SERVOMIN);pwm0.setPWM(1,0,SERVOMIN);pwm0.setPWM(2,0,SERVOMAX);pwm0.setPWM(3,0,SERVOMIN);pwm0.setPWM(4,0,SERVOMAX);pwm0.setPWM(5,0,SERVOMIN);pwm0.setPWM(6,0,SERVOMIN);
}else if(num == 9){
pwm0.setPWM(0,0,SERVOMIN);pwm0.setPWM(1,0,SERVOMIN);pwm0.setPWM(2,0,SERVOMAX);pwm0.setPWM(3,0,SERVOMIN);pwm0.setPWM(4,0,SERVOMIN);pwm0.setPWM(5,0,SERVOMIN);pwm0.setPWM(6,0,SERVOMIN);
}
}else if(groups == 2){
if(num == 0){
pwm0.setPWM(8,0,SERVOMIN);pwm0.setPWM(1+8,0,SERVOMIN);pwm0.setPWM(2+8,0,SERVOMAX);pwm0.setPWM(3+8,0,SERVOMAX);pwm0.setPWM(4+8,0,SERVOMAX);pwm0.setPWM(5+8,0,SERVOMIN);pwm0.setPWM(6+8,0,SERVOMIN+20);
}else if(num == 1){
pwm0.setPWM(8,0,SERVOMAX);pwm0.setPWM(1+8,0,SERVOMAX);pwm0.setPWM(2+8,0,SERVOMAX);pwm0.setPWM(3+8,0,SERVOMAX);pwm0.setPWM(4+8,0,SERVOMIN);pwm0.setPWM(5+8,0,SERVOMIN);pwm0.setPWM(6+8,0,SERVOMAX);
}else if(num == 2){
pwm0.setPWM(8,0,SERVOMIN);pwm0.setPWM(1+8,0,SERVOMAX);pwm0.setPWM(2+8,0,SERVOMAX);pwm0.setPWM(3+8,0,SERVOMIN);pwm0.setPWM(4+8,0,SERVOMAX);pwm0.setPWM(5+8,0,SERVOMAX);pwm0.setPWM(6+8,0,SERVOMIN+20);
}else if(num == 3){
pwm0.setPWM(8,0,SERVOMIN);pwm0.setPWM(1+8,0,SERVOMAX);pwm0.setPWM(2+8,0,SERVOMAX);pwm0.setPWM(3+8,0,SERVOMIN);pwm0.setPWM(4+8,0,SERVOMIN);pwm0.setPWM(5+8,0,SERVOMIN);pwm0.setPWM(6+8,0,SERVOMIN+20);
}else if(num == 4){
pwm0.setPWM(8,0,SERVOMAX);pwm0.setPWM(1+8,0,SERVOMIN);pwm0.setPWM(2+8,0,SERVOMAX);pwm0.setPWM(3+8,0,SERVOMIN);pwm0.setPWM(4+8,0,SERVOMIN);pwm0.setPWM(5+8,0,SERVOMIN);pwm0.setPWM(6+8,0,SERVOMAX);
}else if(num == 5){
pwm0.setPWM(8,0,SERVOMIN);pwm0.setPWM(1+8,0,SERVOMIN);pwm0.setPWM(2+8,0,SERVOMIN);pwm0.setPWM(3+8,0,SERVOMIN);pwm0.setPWM(4+8,0,SERVOMIN);pwm0.setPWM(5+8,0,SERVOMIN);pwm0.setPWM(6+8,0,SERVOMIN+20);
}else if(num == 6){
pwm0.setPWM(8,0,SERVOMIN);pwm0.setPWM(1+8,0,SERVOMIN);pwm0.setPWM(2+8,0,SERVOMIN);pwm0.setPWM(3+8,0,SERVOMIN);pwm0.setPWM(4+8,0,SERVOMAX);pwm0.setPWM(5+8,0,SERVOMIN);pwm0.setPWM(6+8,0,SERVOMIN+20);
}else if(num == 7){
pwm0.setPWM(8,0,SERVOMIN);pwm0.setPWM(1+8,0,SERVOMAX);pwm0.setPWM(2+8,0,SERVOMAX);pwm0.setPWM(3+8,0,SERVOMAX);pwm0.setPWM(4+8,0,SERVOMIN);pwm0.setPWM(5+8,0,SERVOMIN);pwm0.setPWM(6+8,0,SERVOMAX);
}else if(num == 8){
pwm0.setPWM(8,0,SERVOMIN);pwm0.setPWM(1+8,0,SERVOMIN);pwm0.setPWM(2+8,0,SERVOMAX);pwm0.setPWM(3+8,0,SERVOMIN);pwm0.setPWM(4+8,0,SERVOMAX);pwm0.setPWM(5+8,0,SERVOMIN);pwm0.setPWM(6+8,0,SERVOMIN+20);
}else if(num == 9){
pwm0.setPWM(8,0,SERVOMIN);pwm0.setPWM(1+8,0,SERVOMIN);pwm0.setPWM(2+8,0,SERVOMAX);pwm0.setPWM(3+8,0,SERVOMIN);pwm0.setPWM(4+8,0,SERVOMIN);pwm0.setPWM(5+8,0,SERVOMIN);pwm0.setPWM(6+8,0,SERVOMIN+20);
}
}else if(groups == 3){
if(num == 0){
pwm1.setPWM(0,0,SERVOMIN);pwm1.setPWM(1,0,SERVOMIN);pwm1.setPWM(2,0,SERVOMAX);pwm1.setPWM(3,0,SERVOMAX);pwm1.setPWM(4,0,SERVOMAX);pwm1.setPWM(5,0,SERVOMIN);pwm1.setPWM(6,0,SERVOMIN);
}else if(num == 1){
pwm1.setPWM(0,0,SERVOMAX);pwm1.setPWM(1,0,SERVOMAX);pwm1.setPWM(2,0,SERVOMAX);pwm1.setPWM(3,0,SERVOMAX);pwm1.setPWM(4,0,SERVOMIN);pwm1.setPWM(5,0,SERVOMIN);pwm1.setPWM(6,0,SERVOMAX);
}else if(num == 2){
pwm1.setPWM(0,0,SERVOMIN);pwm1.setPWM(1,0,SERVOMAX);pwm1.setPWM(2,0,SERVOMAX);pwm1.setPWM(3,0,SERVOMIN);pwm1.setPWM(4,0,SERVOMAX);pwm1.setPWM(5,0,SERVOMAX);pwm1.setPWM(6,0,SERVOMIN);
}else if(num == 3){
pwm1.setPWM(0,0,SERVOMIN);pwm1.setPWM(1,0,SERVOMAX);pwm1.setPWM(2,0,SERVOMAX);pwm1.setPWM(3,0,SERVOMIN);pwm1.setPWM(4,0,SERVOMIN);pwm1.setPWM(5,0,SERVOMIN);pwm1.setPWM(6,0,SERVOMIN);
}else if(num == 4){
pwm1.setPWM(0,0,SERVOMAX);pwm1.setPWM(1,0,SERVOMIN);pwm1.setPWM(2,0,SERVOMAX);pwm1.setPWM(3,0,SERVOMIN);pwm1.setPWM(4,0,SERVOMIN);pwm1.setPWM(5,0,SERVOMIN);pwm1.setPWM(6,0,SERVOMAX);
}else if(num == 5){
pwm1.setPWM(0,0,SERVOMIN);pwm1.setPWM(1,0,SERVOMIN);pwm1.setPWM(2,0,SERVOMIN);pwm1.setPWM(3,0,SERVOMIN);pwm1.setPWM(4,0,SERVOMIN);pwm1.setPWM(5,0,SERVOMIN);pwm1.setPWM(6,0,SERVOMIN);
}else if(num == 6){
pwm1.setPWM(0,0,SERVOMIN);pwm1.setPWM(1,0,SERVOMIN);pwm1.setPWM(2,0,SERVOMIN);pwm1.setPWM(3,0,SERVOMIN);pwm1.setPWM(4,0,SERVOMAX);pwm1.setPWM(5,0,SERVOMIN);pwm1.setPWM(6,0,SERVOMIN);
}else if(num == 7){
pwm1.setPWM(0,0,SERVOMIN);pwm1.setPWM(1,0,SERVOMAX);pwm1.setPWM(2,0,SERVOMAX);pwm1.setPWM(3,0,SERVOMAX);pwm1.setPWM(4,0,SERVOMIN);pwm1.setPWM(5,0,SERVOMIN);pwm1.setPWM(6,0,SERVOMAX);
}else if(num == 8){
pwm1.setPWM(0,0,SERVOMIN);pwm1.setPWM(1,0,SERVOMIN);pwm1.setPWM(2,0,SERVOMAX);pwm1.setPWM(3,0,SERVOMIN);pwm1.setPWM(4,0,SERVOMAX);pwm1.setPWM(5,0,SERVOMIN);pwm1.setPWM(6,0,SERVOMIN);
}else if(num == 9){
pwm1.setPWM(0,0,SERVOMIN);pwm1.setPWM(1,0,SERVOMIN);pwm1.setPWM(2,0,SERVOMAX);pwm1.setPWM(3,0,SERVOMIN);pwm1.setPWM(4,0,SERVOMIN);pwm1.setPWM(5,0,SERVOMIN);pwm1.setPWM(6,0,SERVOMIN);
}
}else if(groups == 4){
if(num == 0){
pwm1.setPWM(8,0,SERVOMIN);pwm1.setPWM(1+8,0,SERVOMIN);pwm1.setPWM(2+8,0,SERVOMAX);pwm1.setPWM(3+8,0,SERVOMAX);pwm1.setPWM(4+8,0,SERVOMAX);pwm1.setPWM(5+8,0,SERVOMIN);pwm1.setPWM(6+8,0,SERVOMIN);
}else if(num == 1){
pwm1.setPWM(8,0,SERVOMAX);pwm1.setPWM(1+8,0,SERVOMAX);pwm1.setPWM(2+8,0,SERVOMAX);pwm1.setPWM(3+8,0,SERVOMAX);pwm1.setPWM(4+8,0,SERVOMIN);pwm1.setPWM(5+8,0,SERVOMIN);pwm1.setPWM(6+8,0,SERVOMAX);
}else if(num == 2){
pwm1.setPWM(8,0,SERVOMIN);pwm1.setPWM(1+8,0,SERVOMAX);pwm1.setPWM(2+8,0,SERVOMAX);pwm1.setPWM(3+8,0,SERVOMIN);pwm1.setPWM(4+8,0,SERVOMAX);pwm1.setPWM(5+8,0,SERVOMAX);pwm1.setPWM(6+8,0,SERVOMIN);
}else if(num == 3){
pwm1.setPWM(8,0,SERVOMIN);pwm1.setPWM(1+8,0,SERVOMAX);pwm1.setPWM(2+8,0,SERVOMAX);pwm1.setPWM(3+8,0,SERVOMIN);pwm1.setPWM(4+8,0,SERVOMIN);pwm1.setPWM(5+8,0,SERVOMIN);pwm1.setPWM(6+8,0,SERVOMIN);
}else if(num == 4){
pwm1.setPWM(8,0,SERVOMAX);pwm1.setPWM(1+8,0,SERVOMIN);pwm1.setPWM(2+8,0,SERVOMAX);pwm1.setPWM(3+8,0,SERVOMIN);pwm1.setPWM(4+8,0,SERVOMIN);pwm1.setPWM(5+8,0,SERVOMIN);pwm1.setPWM(6+8,0,SERVOMAX);
}else if(num == 5){
pwm1.setPWM(8,0,SERVOMIN);pwm1.setPWM(1+8,0,SERVOMIN);pwm1.setPWM(2+8,0,SERVOMIN);pwm1.setPWM(3+8,0,SERVOMIN);pwm1.setPWM(4+8,0,SERVOMIN);pwm1.setPWM(5+8,0,SERVOMIN);pwm1.setPWM(6+8,0,SERVOMIN);
}else if(num == 6){
pwm1.setPWM(8,0,SERVOMIN);pwm1.setPWM(1+8,0,SERVOMIN);pwm1.setPWM(2+8,0,SERVOMIN);pwm1.setPWM(3+8,0,SERVOMIN);pwm1.setPWM(4+8,0,SERVOMAX);pwm1.setPWM(5+8,0,SERVOMIN);pwm1.setPWM(6+8,0,SERVOMIN);
}else if(num == 7){
pwm1.setPWM(8,0,SERVOMIN);pwm1.setPWM(1+8,0,SERVOMAX);pwm1.setPWM(2+8,0,SERVOMAX);pwm1.setPWM(3+8,0,SERVOMAX);pwm1.setPWM(4+8,0,SERVOMIN);pwm1.setPWM(5+8,0,SERVOMIN);pwm1.setPWM(6+8,0,SERVOMAX);
}else if(num == 8){
pwm1.setPWM(8,0,SERVOMIN);pwm1.setPWM(1+8,0,SERVOMIN);pwm1.setPWM(2+8,0,SERVOMAX);pwm1.setPWM(3+8,0,SERVOMIN);pwm1.setPWM(4+8,0,SERVOMAX);pwm1.setPWM(5+8,0,SERVOMIN);pwm1.setPWM(6+8,0,SERVOMIN);
}else if(num == 9){
pwm1.setPWM(8,0,SERVOMIN);pwm1.setPWM(1+8,0,SERVOMIN);pwm1.setPWM(2+8,0,SERVOMAX);pwm1.setPWM(3+8,0,SERVOMIN);pwm1.setPWM(4+8,0,SERVOMIN);pwm1.setPWM(5+8,0,SERVOMIN);pwm1.setPWM(6+8,0,SERVOMIN);
}
}else if(groups == 5){
if(num == 0){
pwm2.setPWM(0,0,SERVOMIN);pwm2.setPWM(1,0,SERVOMIN);pwm2.setPWM(2,0,SERVOMAX);pwm2.setPWM(3,0,SERVOMAX);pwm2.setPWM(4,0,SERVOMAX);pwm2.setPWM(5,0,SERVOMIN);pwm2.setPWM(6,0,SERVOMIN);
}else if(num == 1){
pwm2.setPWM(0,0,SERVOMAX);pwm2.setPWM(1,0,SERVOMAX);pwm2.setPWM(2,0,SERVOMAX);pwm2.setPWM(3,0,SERVOMAX);pwm2.setPWM(4,0,SERVOMIN);pwm2.setPWM(5,0,SERVOMIN);pwm2.setPWM(6,0,SERVOMAX);
}else if(num == 2){
pwm2.setPWM(0,0,SERVOMIN);pwm2.setPWM(1,0,SERVOMAX);pwm2.setPWM(2,0,SERVOMAX);pwm2.setPWM(3,0,SERVOMIN);pwm2.setPWM(4,0,SERVOMAX);pwm2.setPWM(5,0,SERVOMAX);pwm2.setPWM(6,0,SERVOMIN);
}else if(num == 3){
pwm2.setPWM(0,0,SERVOMIN);pwm2.setPWM(1,0,SERVOMAX);pwm2.setPWM(2,0,SERVOMAX);pwm2.setPWM(3,0,SERVOMIN);pwm2.setPWM(4,0,SERVOMIN);pwm2.setPWM(5,0,SERVOMIN);pwm2.setPWM(6,0,SERVOMIN);
}else if(num == 4){
pwm2.setPWM(0,0,SERVOMAX);pwm2.setPWM(1,0,SERVOMIN);pwm2.setPWM(2,0,SERVOMAX);pwm2.setPWM(3,0,SERVOMIN);pwm2.setPWM(4,0,SERVOMIN);pwm2.setPWM(5,0,SERVOMIN);pwm2.setPWM(6,0,SERVOMAX);
}else if(num == 5){
pwm2.setPWM(0,0,SERVOMIN);pwm2.setPWM(1,0,SERVOMIN);pwm2.setPWM(2,0,SERVOMIN);pwm2.setPWM(3,0,SERVOMIN);pwm2.setPWM(4,0,SERVOMIN);pwm2.setPWM(5,0,SERVOMIN);pwm2.setPWM(6,0,SERVOMIN);
}else if(num == 6){
pwm2.setPWM(0,0,SERVOMIN);pwm2.setPWM(1,0,SERVOMIN);pwm2.setPWM(2,0,SERVOMIN);pwm2.setPWM(3,0,SERVOMIN);pwm2.setPWM(4,0,SERVOMAX);pwm2.setPWM(5,0,SERVOMIN);pwm2.setPWM(6,0,SERVOMIN);
}else if(num == 7){
pwm2.setPWM(0,0,SERVOMIN);pwm2.setPWM(1,0,SERVOMAX);pwm2.setPWM(2,0,SERVOMAX);pwm2.setPWM(3,0,SERVOMAX);pwm2.setPWM(4,0,SERVOMIN);pwm2.setPWM(5,0,SERVOMIN);pwm2.setPWM(6,0,SERVOMAX);
}else if(num == 8){
pwm2.setPWM(0,0,SERVOMIN);pwm2.setPWM(1,0,SERVOMIN);pwm2.setPWM(2,0,SERVOMAX);pwm2.setPWM(3,0,SERVOMIN);pwm2.setPWM(4,0,SERVOMAX);pwm2.setPWM(5,0,SERVOMIN);pwm2.setPWM(6,0,SERVOMIN);
}else if(num == 9){
pwm2.setPWM(0,0,SERVOMIN);pwm2.setPWM(1,0,SERVOMIN);pwm2.setPWM(2,0,SERVOMAX);pwm2.setPWM(3,0,SERVOMIN);pwm2.setPWM(4,0,SERVOMIN);pwm2.setPWM(5,0,SERVOMIN);pwm2.setPWM(6,0,SERVOMIN);
}
}else if(groups == 6){
if(num == 0){
pwm2.setPWM(8,0,SERVOMIN);pwm2.setPWM(1+8,0,SERVOMIN);pwm2.setPWM(2+8,0,SERVOMAX);pwm2.setPWM(3+8,0,SERVOMAX);pwm2.setPWM(4+8,0,SERVOMAX);pwm2.setPWM(5+8,0,SERVOMIN);pwm2.setPWM(6+8,0,SERVOMIN);
}else if(num == 1){
pwm2.setPWM(8,0,SERVOMAX);pwm2.setPWM(1+8,0,SERVOMAX);pwm2.setPWM(2+8,0,SERVOMAX);pwm2.setPWM(3+8,0,SERVOMAX);pwm2.setPWM(4+8,0,SERVOMIN);pwm2.setPWM(5+8,0,SERVOMIN);pwm2.setPWM(6+8,0,SERVOMAX);
}else if(num == 2){
pwm2.setPWM(8,0,SERVOMIN);pwm2.setPWM(1+8,0,SERVOMAX);pwm2.setPWM(2+8,0,SERVOMAX);pwm2.setPWM(3+8,0,SERVOMIN);pwm2.setPWM(4+8,0,SERVOMAX);pwm2.setPWM(5+8,0,SERVOMAX);pwm2.setPWM(6+8,0,SERVOMIN);
}else if(num == 3){
pwm2.setPWM(8,0,SERVOMIN);pwm2.setPWM(1+8,0,SERVOMAX);pwm2.setPWM(2+8,0,SERVOMAX);pwm2.setPWM(3+8,0,SERVOMIN);pwm2.setPWM(4+8,0,SERVOMIN);pwm2.setPWM(5+8,0,SERVOMIN);pwm2.setPWM(6+8,0,SERVOMIN);
}else if(num == 4){
pwm2.setPWM(8,0,SERVOMAX);pwm2.setPWM(1+8,0,SERVOMIN);pwm2.setPWM(2+8,0,SERVOMAX);pwm2.setPWM(3+8,0,SERVOMIN);pwm2.setPWM(4+8,0,SERVOMIN);pwm2.setPWM(5+8,0,SERVOMIN);pwm2.setPWM(6+8,0,SERVOMAX);
}else if(num == 5){
pwm2.setPWM(8,0,SERVOMIN);pwm2.setPWM(1+8,0,SERVOMIN);pwm2.setPWM(2+8,0,SERVOMIN);pwm2.setPWM(3+8,0,SERVOMIN);pwm2.setPWM(4+8,0,SERVOMIN);pwm2.setPWM(5+8,0,SERVOMIN);pwm2.setPWM(6+8,0,SERVOMIN);
}else if(num == 6){
pwm2.setPWM(8,0,SERVOMIN);pwm2.setPWM(1+8,0,SERVOMIN);pwm2.setPWM(2+8,0,SERVOMIN);pwm2.setPWM(3+8,0,SERVOMIN);pwm2.setPWM(4+8,0,SERVOMAX);pwm2.setPWM(5+8,0,SERVOMIN);pwm2.setPWM(6+8,0,SERVOMIN);
}else if(num == 7){
pwm2.setPWM(8,0,SERVOMIN);pwm2.setPWM(1+8,0,SERVOMAX);pwm2.setPWM(2+8,0,SERVOMAX);pwm2.setPWM(3+8,0,SERVOMAX);pwm2.setPWM(4+8,0,SERVOMIN);pwm2.setPWM(5+8,0,SERVOMIN);pwm2.setPWM(6+8,0,SERVOMAX);
}else if(num == 8){
pwm2.setPWM(8,0,SERVOMIN);pwm2.setPWM(1+8,0,SERVOMIN);pwm2.setPWM(2+8,0,SERVOMAX);pwm2.setPWM(3+8,0,SERVOMIN);pwm2.setPWM(4+8,0,SERVOMAX);pwm2.setPWM(5+8,0,SERVOMIN);pwm2.setPWM(6+8,0,SERVOMIN);
}else if(num == 9){
pwm2.setPWM(8,0,SERVOMIN);pwm2.setPWM(1+8,0,SERVOMIN);pwm2.setPWM(2+8,0,SERVOMAX);pwm2.setPWM(3+8,0,SERVOMIN);pwm2.setPWM(4+8,0,SERVOMIN);pwm2.setPWM(5+8,0,SERVOMIN);pwm2.setPWM(6+8,0,SERVOMIN);
}
}
}
void setup() {
Serial.begin(9600);
Serial.println("HI SIR");
pwm0.begin();pwm1.begin();pwm2.begin();
pwm0.setOscillatorFrequency(27000000);
pwm1.setOscillatorFrequency(27000000);
pwm2.setOscillatorFrequency(27000000);
pwm0.setPWMFreq(SERVO_FREQ);
pwm1.setPWMFreq(SERVO_FREQ);
pwm2.setPWMFreq(SERVO_FREQ);
WiFi.begin("DaoGuCheJian", "Daoguchejian");
while (WiFi.status() != WL_CONNECTED) {
delay(300);
Serial.print(".");
}
NTP.setInterval (600);
NTP.setNTPTimeout (1500);
NTP.begin (ntpServer, timeZone, false);
Serial.println(WiFi.status());
Serial.println(WiFi.localIP());
setServo(1,8);
delay(500);
setServo(2,8);
delay(500);
setServo(3,8);
delay(500);
setServo(4,8);
delay(500);
setServo(5,8);
delay(500);
setServo(6,8);
delay(2000);
DateHour = NTP.getTimeHour24();
num1 = DateHour / 10;
num2 = DateHour % 10;
setServo(1,num1);
delay(500);
setServo(2,num2);
delay(500);
DateMinute = NTP.getTimeMinute();
num3 = DateMinute / 10;
num4 = DateMinute % 10;
setServo(3,num3);
delay(500);
setServo(4,num4);
delay(500);
DateSecond = NTP.getTimeSecond();
num5 = DateSecond / 10;
num6 = DateSecond % 10;
setServo(5,num5);
delay(500);
setServo(6,num6);
delay(500);
}
void loop() {
if(!(DateHour == NTP.getTimeHour24()))
{
DateHour = NTP.getTimeHour24();
num1 = DateHour / 10;
num2 = DateHour % 10;
setServo(1,num1);
setServo(2,num2);
SerialPrint();
}
if(!(DateMinute == NTP.getTimeMinute()))
{
DateMinute = NTP.getTimeMinute();
num3 = DateMinute / 10;
num4 = DateMinute % 10;
setServo(3,num3);
setServo(4,num4);
SerialPrint();
}
if(!(DateSecond == NTP.getTimeSecond()))
{
DateSecond = NTP.getTimeSecond();
num5 = DateSecond / 10;
num6 = DateSecond % 10;
setServo(5,num5);
setServo(6,num6);
SerialPrint();
}
}