RTCZero and Tone conflict --SOLVED--


having issue when using built in tone library , rtczero library.
below simple rtc example rtczero library. change addition of call tone().  the tone gets short interruption every time make rtc.getxxx() call.  did googling , couldn't find reference issue.  any ideas how remove interruption?

thank you.

code: [select]
/*
  simple rtc arduino 0 , mkr1000

 demonstrates use of rtc library arduino 0 , mkr1000

 this example code in public domain

 http://arduino.cc/en/tutorial/simplertc

  created arturo guadalupi <a.guadalupi@arduino.cc>
  15 jun 2015

  modified
  18 feb 2016
*/

#include <rtczero.h>

/* create rtc object */
rtczero rtc;

/* change these values set current initial time */
const byte seconds = 0;
const byte minutes = 0;
const byte hours = 16;

/* change these values set current initial date */
const byte day = 15;
const byte month = 6;
const byte year = 15;

void setup()
{
  serial.begin(9600);
  
  rtc.begin(); // initialize rtc
  
  // set time
  rtc.sethours(hours);
  rtc.setminutes(minutes);
  rtc.setseconds(seconds);
  
  // set date
  rtc.setday(day);
  rtc.setmonth(month);
  rtc.setyear(year);
  
  // can use also
  //rtc.settime(hours, minutes, seconds);
  //rtc.setdate(day, month, year);
  tone(12, 4000);
}

void loop()
{
  // print date...
  serial.print(rtc.getday());
  serial.print("/");
  serial.print(rtc.getmonth());
  serial.print("/");
  serial.print(rtc.getyear());
  serial.print("\t");
  
  // ...and time
  serial.print(rtc.gethours());
  serial.print(":");
  serial.print(rtc.getminutes());
  serial.print(":");
  serial.print(rtc.getseconds());
 
  serial.println();
  
  delay(1000);
}

nobody else has had issue?  can please try sketch , confirm.  way can sure hardware problem.


Arduino Forum > Products > Arduino Zero (Moderator: cmaglie) > RTCZero and Tone conflict --SOLVED--


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'