diff --git a/Arduino-Aime-Reader.ino b/Arduino-Aime-Reader.ino index e573bf4..8ad1597 100644 --- a/Arduino-Aime-Reader.ino +++ b/Arduino-Aime-Reader.ino @@ -62,23 +62,22 @@ void setup() { // SerialDevice.begin(119200);//high_baudrate=true SerialDevice.setTimeout(0); FastLED.addLeds(leds, NUM_LEDS); + FastLED.setBrightness(50); nfc.begin(); - if (!nfc.getFirmwareVersion()) { - while (1) { - fill_solid(leds, NUM_LEDS, 0xFF0000); - FastLED[0].show(leds, NUM_LEDS, BRI); - delay(500); - fill_solid(leds, NUM_LEDS, 0x000000); - FastLED[0].show(leds, NUM_LEDS, BRI); - delay(500); - } + while (!nfc.getFirmwareVersion()) { + fill_solid(leds, NUM_LEDS, 0xFF0000); + FastLED.show(); + delay(500); + fill_solid(leds, NUM_LEDS, 0x000000); + FastLED.show(); + delay(500); } nfc.setPassiveActivationRetries(0x10);//设定等待次数 nfc.SAMConfig(); memset(&req, 0, sizeof(req.bytes)); memset(&res, 0, sizeof(res.bytes)); fill_solid(leds, NUM_LEDS, 0x0000FF); - FastLED[0].show(leds, NUM_LEDS, BRI); + FastLED.show(); } void loop() { diff --git a/cmd.h b/cmd.h index 92dcad7..20704d1 100644 --- a/cmd.h +++ b/cmd.h @@ -1,7 +1,6 @@ #include "FastLED.h" #define NUM_LEDS 6 -#define DATA_PIN D5 -#define BRI 50 +#define DATA_PIN 14 CRGB leds[NUM_LEDS]; #include @@ -139,7 +138,7 @@ static void sg_nfc_cmd_reset() {//重置读卡器 return; } fill_solid(leds, NUM_LEDS, 0xFFFF00); - FastLED[0].show(leds, NUM_LEDS, BRI); + FastLED.show(); } static void sg_nfc_cmd_get_fw_version() { @@ -167,7 +166,7 @@ static void sg_led_cmd_reset() { sg_res_init(1); res.reset_payload = 0; fill_solid(leds, NUM_LEDS, 0x000000); - FastLED[0].show(leds, NUM_LEDS, BRI); + FastLED.show(); } static void sg_led_cmd_get_info() { @@ -181,7 +180,7 @@ static void sg_led_cmd_set_color() { uint8_t g = req.color_payload[1]; uint8_t b = req.color_payload[2]; fill_solid(leds, NUM_LEDS, CRGB(r, g, b)); - FastLED[0].show(leds, NUM_LEDS, BRI); + FastLED.show(); } static void sg_nfc_cmd_radio_on() {