Settime Real Time Clock Module DS1307 - ArduinoAll

ArduinoAll ขาย Arduino ซื้อ Arduino ทุกอย่าง เปลี่ยนชื่อเป็น AllNewStep
  • ขาย Arduino
  • ซื้อ Arduino
  • แจ้งชำระเงิน
  • Arduino บทความ
  • Arduino เว็บบอร์ด
  • ติดต่อ/ใบเสนอราคา
  • การรับประกัน
  • เกี่ยวกับเรา
  • หน้าแรก
  • >
  • เว็บบอร์ด
  • >
  • Settime Real Time Clock Module…
ความรู้แน่น ฟรีสำหรับชุมชน ArduinoAll ที่นี่เท่านั้น ฟรีและดีที่สุด คอร์สอบรม Arduino + NodeMCUทำเพื่อแบ่งปัน ห้ามนำไปจำหน่าย หรือเก็บเงินค่าเรียน !!!

AllNewStep รับประกันคุณภาพทุกชิ้น วันจันทร์-ศุกร์แจ้งชำระสินค้าก่อน 14.00 จัดส่งทันทีวันนี้ค่ะ

กรุงเทพ /ภาคกลาง ได้พรุ่งนี้

*** สินค้าทุกชิ้น ถ้าสามารถทำรายการสั่งซื้อได้ แสดงว่ามีครบทุกรายการค่ะ ***

พิมพ์ค้นหาบทความ หัวข้อกระทู้ และสินค้าในเว็บ AllNewStep ได้ที่นี่ ตอบกระทู้ ตั้งกระทู้ใหม่ QUOTE Settime Real Time Clock Module DS1307 Heart Kittisak Heart Kittisak IP: 171.4.238.x 4 ปีที่ผ่านมา

ผมได้อัปโหลดโค๊ดดังนี้#include #include #include const char *monthName[12] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};tmElements_t tm;void setup() {bool parse=false;bool config=false;// get the date and time the compiler was runif (getDate(__DATE__) && getTime(__TIME__)) {parse = true;// and configure the RTC with this infoif (RTC.write(tm)) {config = true;}}Serial.begin(9600);while (!Serial) ; // wait for Arduino Serial Monitordelay(200);if (parse && config) {Serial.print("DS1307 configured Time=");Serial.print(__TIME__);Serial.print(", Date=");Serial.println(__DATE__);} else if (parse) {Serial.println("DS1307 Communication Error :-{");Serial.println("Please check your circuitry");} else {Serial.print("Could not parse info from the compiler, Time=\"");Serial.print(__TIME__);Serial.print("\", Date=\"");Serial.print(__DATE__);Serial.println("\"");}}void loop() {}bool getTime(const char *str){int Hour, Min, Sec;if (sscanf(str, "%d:%d:%d", &Hour, &Min, &Sec) != 3) return false;tm.Hour = Hour;tm.Minute = Min;tm.Second = Sec;return true;}bool getDate(const char *str){char Month[12];int Day, Year;uint8_t monthIndex;if (sscanf(str, "%s %d %d", Month, &Day, &Year) != 3) return false;for (monthIndex = 0; monthIndex < 12; monthIndex++) {if (strcmp(Month, monthName[monthIndex]) == 0) break;}if (monthIndex >= 12) return false;tm.Day = Day;tm.Month = monthIndex + 1;tm.Year = CalendarYrToTm(Year);return true;}เพื่อตั้งเวลาสำหรับบันทึกข้อมูลลง SD Card แต่ไม่สำเร็จและมีข้อความแสดงขึ้นดังนี้Arduino: 1.8.12 (Windows 10), Board: "Arduino Uno"In file included from C:\Users\Y520\AppData\Local\Temp\arduino_modified_sketch_299543\SetTime.ino:1:0:C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC/DS1307RTC.h:19:22: error: 'tmElements_t' has not been declaredstatic bool read(tmElements_t &tm);^~~~~~~~~~~~C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC/DS1307RTC.h:20:23: error: 'tmElements_t' has not been declaredstatic bool write(tmElements_t &tm);^~~~~~~~~~~~C:\Users\Y520\AppData\Local\Temp\arduino_modified_sketch_299543\SetTime.ino: In function 'void setup()':SetTime:20:21: error: no matching function for call to 'DS1307RTC::write(tmElements_t&)'if (RTC.write(tm)) {^In file included from C:\Users\Y520\AppData\Local\Temp\arduino_modified_sketch_299543\SetTime.ino:1:0:C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC/DS1307RTC.h:20:17: note: candidate: static bool DS1307RTC::write(int&)static bool write(tmElements_t &tm);^~~~~C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC/DS1307RTC.h:20:17: note: no known conversion for argument 1 from 'tmElements_t' to 'int&'exit status 1no matching function for call to 'DS1307RTC::write(tmElements_t&)'This report would have more information with"Show verbose output during compilation"option enabled in File -> Preferences.ผมต้องแก้ไขตรงไหนครับ

QUOTE ความคิดเห็นที่ #1 เจ้าของร้าน เจ้าของร้าน 4 ปีที่ผ่านมา

ในนี้แจ้งว่าไม่มีไฟล์ไลบารี ลองเช็คไลบารีหรือใช้ไลบารีตัวใหม่ครับ

QUOTE ความคิดเห็นที่ #2 Heart Kittisak Heart Kittisak IP: 171.4.224.x 4 ปีที่ผ่านมา ผมลองใช้ไลบารี่ตัวใหม่แล้ว มันขึ้นแบบนี้ครับ Arduino: 1.8.16 (Windows Store 1.8.51.0) (Windows 10), Board: "Arduino Uno" In file included from C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:26:0: C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.h:19:22: error: 'tmElements_t' has not been declared static bool read(tmElements_t &tm); ^~~~~~~~~~~~ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.h:20:23: error: 'tmElements_t' has not been declared static bool write(tmElements_t &tm); ^~~~~~~~~~~~ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp: In static member function 'static time_t DS1307RTC::get()': C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:38:3: error: 'tmElements_t' was not declared in this scope tmElements_t tm; ^~~~~~~~~~~~ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:39:14: error: expected primary-expression before ')' token if (read(tm) == false) return 0; ^ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:40:21: error: expected primary-expression before ')' token return(makeTime(tm)); ^ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:40:10: error: 'makeTime' was not declared in this scope return(makeTime(tm)); ^~~~~~~~ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:40:10: note: suggested alternative: 'mktime' return(makeTime(tm)); ^~~~~~~~ mktime C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp: In static member function 'static bool DS1307RTC::set(time_t)': C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:45:3: error: 'tmElements_t' was not declared in this scope tmElements_t tm; ^~~~~~~~~~~~ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:46:18: error: expected primary-expression before ')' token breakTime(t, tm); ^ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:46:3: error: 'breakTime' was not declared in this scope breakTime(t, tm); ^~~~~~~~~ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:47:5: error: expected unqualified-id before '.' token tm.Second |= 0x80; // stop the clock ^ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:48:11: error: expected primary-expression before ')' token write(tm); ^ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:49:5: error: expected unqualified-id before '.' token tm.Second &= 0x7f; // start the clock ^ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:50:11: error: expected primary-expression before ')' token write(tm); ^ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp: At global scope: C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:54:22: error: 'bool DS1307RTC::read' is not a static data member of 'class DS1307RTC' bool DS1307RTC::read(tmElements_t &tm) ^~~~~~~~~~~~ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:54:22: error: 'tmElements_t' was not declared in this scope C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:54:38: error: expected primary-expression before ')' token bool DS1307RTC::read(tmElements_t &tm) ^ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:95:23: error: 'bool DS1307RTC::write' is not a static data member of 'class DS1307RTC' bool DS1307RTC::write(tmElements_t &tm) ^~~~~~~~~~~~ C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:95:23: error: 'tmElements_t' was not declared in this scope C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.cpp:95:39: error: expected primary-expression before ')' token bool DS1307RTC::write(tmElements_t &tm) ^ Multiple libraries were found for "DS1307RTC.h" Used: C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC Not used: C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC-1.4.1 exit status 1 Error compiling for board Arduino Uno. This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences. QUOTE ความคิดเห็นที่ #3 เจ้าของร้าน เจ้าของร้าน 4 ปีที่ผ่านมา

C:\Users\Y520\Documents\Arduino\libraries\DS1307RTC\DS1307RTC.h:19:22: error: 'tmElements_t' has not been declared

static bool read(tmElements_t &tm);

ในนี้แจ้งว่าไลบารีไม่ถูกต้องครับ

QUOTE ความคิดเห็นที่ #4 Heart Kittisak Heart Kittisak IP: 58.11.17.x 4 ปีที่ผ่านมา พอมีไฟล์ไลบารีของ DS1307RTC ไหมครับ QUOTE ความคิดเห็นที่ #5 เจ้าของร้าน เจ้าของร้าน 4 ปีที่ผ่านมา

ตัวอย่างดังนี้ครับ https://www.allnewstep.com/p/3661

แสดงความคิดเห็นที่ 1-5 จากทั้งหมด 5 ความคิดเห็น ขาย ARDUINOคุณภาพ อันดับ 1ได้รับรางวัลร้านยอดเยี่ยมตั้งแต่ปี 2558 lnwshop of the day badge ประจำวันที่ 16 กันยายน 2558 ขาย Arduino วีดีโอสอน Arduinoสอน esp8266สอน Arduino IoT สอน Arduino แบบเร็วสอน NodeMCU

ค้นหา Arduino

ค้นหา ค้นหาโดยละเอียด
ดูทั้งหมด

อุปกรณ์ Arduino

สินค้าทั้งหมด [5206] สินค้าแนะนำ [819] ขาย Arduino Board (Arduino Compatible) [69]ขาย Arduino อุปกรณ์/กล่องเคส Arduino [9]ขาย Arduino ชุดคิท Arduino ชุด Starter Kit / Learning Kit [31]ชุดทดลองสำหรับ Arduino ชุด Starter Kit++ [7]คอร์สเรียน Arduino / หนังสือ Arduino [4]สินค้าแบรน Seeed Studio [57]Seeed Sensor Module [43]Seeed Board บอร์ดไมโครคอนโทรเลอร์ [0]Seeed Starter Kit อุปกรณ์เริ่มต้นเรียนรู้ [6]สายไฟจัมเปอร์ [8]สอน Arduino [44]โปรเจก Arduino พื้นฐาน [44]ชุดคิทวงจรอิเล็กทรอนิกส์ Electronic Kit [57]ขาย Arduino บอร์ด Shields [38]ขาย Micro:bit [36]ขาย Raspberry Pi [103]STM32 Microcontroller [28]STM32 Arduino Compatible [12]STM32 / STM8 [15]PIC Microcontroller [8]PIC Board [1]IC PIC [7]IC [167]IC Arduino [25]IC เรกูเลต [38]IC เซนเซอร์ [5]IC IO/Driver [44]IC ใช้งานพื้นฐาน [34]IC เสียง [5]IC Digital [16]LCD/LED [340]LED [156]โมดูลจอ LCD [58]โมดูลจอแสดงผล OLED [19]LED Module [102]LED 7 Segment [60]โมดูล 7 Semgnet แสดงตัวเลขอเนกประสงค์ [27]7 segment 1 หลัก [15]7 segment 2 หลัก [4]7 segment 3 หลัก [4]7 segment 4 หลัก [10]Servo / Motor / Car [275]Servo [52]Motor [55]โมดูลขับมอเตอร์ / อุปกรณ์ IO [62]Smart Car [68]โครงสร้างหุ่นยนต์ / พลาสติก Smart Car [38]Power / Regulator [250]USB Power [11]เรกูเลเตอร์ Step Up [37]เรกูเลเตอร์ Step Down [89]เรกูเลเตอร์ Step Up&Down [15]แหล่งจ่ายไฟอะแดปเตอร์ / Adapter [98]Internet of Things IoT [219]Smart Home / Wi-Fi / Sonoff [23]ESP8266 WiFi [86]ESP32 WiFi Bluetooth [74]ESP8285 WiFi [7]LoRa / LoRa Antenna [16]WiFi Module [2]M5Stack ESP32 [10]NB-IoT [1]ขาย Arduino Sensor [1143]เซนเซอร์ความเร่ง / ไจโร / IMU [35]เซนเซอร์วัดระยะทาง [34]เซนเซอร์แสงและการมองเห็น [92]เซนเซอร์ตรวจจับความเคลื่อนไหว [36]เซนเซอร์วัดสภาพแวดล้อม [272]เซนเซอร์แก๊ส [33]โมดูลวัดแรงดันและกระแสไฟฟ้า [131]โมดูลสวิตช์ [108]โมดูลบันทึกข้อมูล [16]โมดูลนาฬิกา Real Time Clock [10]โมดูลสื่อสารไร้สาย [76]โมดูลอินเตอร์เน็ต [11]โมดูล RFID / NFC / Smart Card [36]โมดูล USB Converter [35]โมดูล JoyStick [6]โมดูลเสียง [45]โมดูลเครื่องเสียง [44]โมดูล GSM/GPS [17]โมดูล 3D Printer / CNC [9]โมดูลกำเนิดสัญญาณ Signal Gennerator [7]โมดูลแปลงสัญญาณ I/O [85]ขาย Arduino โมดูลบอร์ดรีเลย์ [106]Relay 5V [53]Relay 9V [4]Relay 12V [31]Relay 24V [14]Relay 3V [4]Socket / PCB [526]แผ่นปริ๊น PCB [112]USB Socket [22]CHIP Socket [15]IC Socket [22]Universal ZIF Sockte [16]Pin Header [177]ก้างปลา [34]Jack /Terminal / Adapter [126]Electronic component [656]ตัวเก็บประจุ [45]ตัวต้านทาน [173]
ตัวต้านทานค่าคงที่ [66]ตัวต้านทานปรับค่าได้ [96]ตัวต้านทานแบบ network [8]
ไดโอด [10]
ซีเนอร์ไดโอดแบบ SMD [0]
รีเลย์ [38]ทรานซิสเตอร์ [37]สวิตช์ [235]อุปกรณ์อื่น ๆ [17]Crystal คริสตัล [13]ลำโพง / Buzzer [50]กลอนแม่เหล็กไฟฟ้า [21]Inductors ตัวเหนี่ยวนำ [10]โซลินอยด์วาล์ว [6]Accessories [856]USB Adapter / สาย USB [67]บอร์ดทดลอง [38]สายไฟจัมเปอร์ [222]อุปกรณ์อื่น ๆ [36]แจ๊ค / รางถ่าน / ขั้วถ่าน [109]แบตเตอรี่ 18650 Li-ion / รางถ่าน 18650 / ที่ชาร์จแบต Li-ion [90]น็อต Nut/Bolt [164]
Nut Screw M2 [33]Nut Screw M3 [62]Nut Screw M2.5 [60]น็อตสกรูขนาดอื่น [0]Nut Screw M4 [7]
แผ่นระบายความร้อน [43]พัดลมระบายความร้อน [21]เสาอากาศ/สายอากาศ [24]ฟิวส์ / กระบอกฟิวส์ / อุปกรณ์ฟิวส์ [18]กล่องพลาสติก [22]เครื่องมือ / อุปกรณ์ DIY [124]FPGA + Programmer [2]ดูหมวดหมู่ทั้งหมด

ติดต่อ AllNewStep

MEMBER ZONE

คุณเป็นตัวแทนจำหน่าย
  • ระดับ{{userdata.dropship_level_name}}
  • ไปหน้าหลักตัวแทน
ระดับสมาชิกของคุณ ที่ร้านค้านี้ รายการสั่งซื้อของฉัน
  • ทั้งหมด {{(order_nums && order_nums.all)?'('+order_nums.all+')':''}}
  • รอการชำระเงิน {{(order_nums && order_nums.wait_payment)?'('+order_nums.wait_payment+')':''}}
  • รอตรวจสอบยอดเงิน {{(order_nums && order_nums.wait_payment_verify)?'('+order_nums.wait_payment_verify+')':''}}
  • รอจัดส่งสินค้า {{(order_nums && order_nums.wait_send)?'('+order_nums.wait_send+')':''}}
  • รอยืนยันได้รับสินค้า {{(order_nums && (order_nums.wait_receive || order_nums.wait_confirm))?'('+(order_nums.wait_receive+order_nums.wait_confirm)+')':''}}
  • รอตรวจสอบข้อร้องเรียน {{(order_nums && order_nums.dispute)?'('+order_nums.dispute+')':''}}
  • เรียบร้อยแล้ว {{(order_nums && order_nums.completed)?'('+order_nums.completed+')':''}}
  • ทั้งหมด {{(order_nums && order_nums.all)?'('+order_nums.all+')':''}}
  • รอการชำระเงิน {{(order_nums && order_nums.wait_payment)?'('+order_nums.wait_payment+')':''}}
  • รอตรวจสอบยอดเงิน{{(order_nums && order_nums.wait_payment_verify)?'('+order_nums.wait_payment_verify+')':''}}
  • รอจัดส่งสินค้า {{(order_nums && order_nums.wait_send)?'('+order_nums.wait_send+')':''}}
  • ส่งสินค้าเรียบร้อยแล้ว {{(order_nums && order_nums.sent)?'('+order_nums.sent+')':''}}
logout เข้าสู่ระบบด้วย lnwaccount logo เข้าสู่ระบบ สมัครสมาชิก lnwaccount logo ยังไม่มีบัญชีเทพ สร้างบัญชีใหม่ ไม่มีค่าใช้จ่าย สมัครสมาชิก (ฟรี) ตรวจสอบพัสดุ ร้านArduinoAll ขาย Arduino ซื้อ Arduino ทุกอย่าง เปลี่ยนชื่อเป็น AllNewStep ArduinoAll ขาย Arduino ซื้อ Arduino ทุกอย่าง เปลี่ยนชื่อเป็น AllNewStep {{is_joined?'เป็นสมาชิกแล้ว':'Join เป็นสมาชิกร้าน'}} 4689 สมัครสมาชิกร้านนี้ เพื่อรับสิทธิพิเศษ บัตรประชาชน บุ๊คแบ๊งค์ คุ้มครองโดยLnwPay ขาย arduino | ซื้อ arduino | จ่ายเงิน arduino | เรียน arduino | เว็บบอร์ด arduino | เกี่ยวกับ arduino | ติดต่อเรา | สินค้า arduino | Site Map ธ.กรุงไทย ธ.กรุงไทย Copyright © 2025 www.allnewstep.com All rights reserved. ร้านค้าออนไลน์ Inspired by LnwShop.com (v2) สินค้าในตะกร้า0 ชนิด 0 ชิ้น คุณมีสินค้า 0 ชิ้นในตะกร้า สั่งซื้อทันที สินค้าในตะกร้า ({{total_num}} รายการ) ขออภัย ขณะนี้ยังไม่มีสินค้าในตะกร้า ราคาสินค้าทั้งหมด ฿ {{price_format(total_price)}} - ฿ {{price_format(discount.price)}} ราคาสินค้าทั้งหมด {{total_quantity}} ชิ้น ฿ {{price_format(after_product_price)}} ราคาไม่รวมค่าจัดส่ง รวมภาษีมูลค่าเพิ่มแล้ว ดูสินค้าในตะกร้า เริ่มการสั่งซื้อ เลือกซื้อสินค้าเพิ่ม พูดคุย-สอบถาม

Tag » Arduino Tmelements_t Tm Error