sketch not running corectly

Yes I am a newby.

This is the horizontal display of my sketch\

Day of week: 45:165:85 165/165/165

I have been unable for it to scroll viritcal and sketch is not giving me the data i was hopping for.

#include “Wire.h”
#define DS3231_I2C_ADDRESS 0x68
// Convert normal decimal numbers to binary coded decimal
byte decToBcd(byte val)
{
return( (val/1016) + (val%10) );
}
// Convert binary coded decimal to normal decimal numbers
byte bcdToDec(byte val)
{
return( (val/16
10) + (val%16) );
}
void setup()
{
Wire.begin();
Serial.begin(9600);
// set the initial time here:
// DS3231 seconds, minutes, hours, day, date, month, year
// setDS3231time(30,42,21,26,7,15);
}
void setDS3231time(byte second, byte minute, byte hour, byte day,
byte month, byte year)
{
// sets time and date data to DS3231
Wire.beginTransmission(DS3231_I2C_ADDRESS);
Wire.write(0); // set next input to start at the seconds register
Wire.write(decToBcd(second)); // set seconds
Wire.write(decToBcd(minute)); // set minutes
Wire.write(decToBcd(hour)); // set hours

Wire.write(decToBcd(month)); // set month
Wire.write(decToBcd(year)); // set year (0 to 99)
Wire.endTransmission();
}
void readDS3231time(byte *second,
byte *minute,
byte *hour,
byte *day,
byte *month,
byte *year)
{
Wire.beginTransmission(DS3231_I2C_ADDRESS);
Wire.write(0); // set DS3231 register pointer to 00h
Wire.endTransmission();
Wire.requestFrom(DS3231_I2C_ADDRESS, 7);
// request seven bytes of data from DS3231 starting from register 00h
*second = bcdToDec(Wire.read() & 0x7f);
*minute = bcdToDec(Wire.read());
*hour = bcdToDec(Wire.read() & 0x3f);
*day = bcdToDec(Wire.read());
*month = bcdToDec(Wire.read());
*year = bcdToDec(Wire.read());
}
void displayTime()
{
byte second, minute, hour, day, month, year;
// retrieve data from DS3231
readDS3231time(&second, &minute, &hour,&day, &month,&year);
// send it to the serial monitor
Serial.print(hour, DEC);
// convert the byte variable to a decimal number when displayed
Serial.print(":");
if (minute<10)
{
Serial.print(“0”);
}
Serial.print(minute, DEC);
Serial.print(":");
if (second<10)
{
Serial.print(“0”);
}
Serial.print(second, DEC);
Serial.print(" “);
Serial.print(day, DEC);
Serial.print(”/");
Serial.print(month, DEC);
Serial.print("/");
Serial.print(year, DEC);
Serial.print(" Day of week: ");
switch(day){
case 1:
Serial.println(“Sunday”);
break;
case 2:
Serial.println(“Monday”);
break;
case 3:
Serial.println(“Tuesday”);
break;
case 4:
Serial.println(“Wednesday”);
break;
case 5:
Serial.println(“Thursday”);
break;
case 6:
Serial.println(“Friday”);
break;
case 7:
Serial.println(“Saturday”);
break;
}
}
void loop()
{
displayTime(); // display the real-time clock data on the Serial Monitor,
delay(1000); // every second
}

Please give me some direction thanks

Please give me some direction thanks

7 below:

http://forum.arduino.cc/index.php/topic,148850.0.html

Kutton: sketch is not giving me the data i was hopping for.

In addition to what @zoomkat said, how are we supposed to know what you are hoping for ?

(I usually only hop when I am in urgent need of the rest-room)

...R

I waned direction on how to make my information display scrolling vertically. I thought it would show me The date in word format instead as numerical .

Is this really your sketch?

No

Kutton:
No

It’s not the code you are running. So, why did you post it? What does it have to do with your problem?

You asked if it was my code I answered no since I copied it off the internet. It is the code I am trying to run. Do not understand the unfriendly replies. I told you I am new and I was asking for a little help.

Well, the title you gave the thread is "sketch not running correctly" and you referred to it in the first post as "my sketch". So the confusion should be easy to understand.

The days of the week are in "word" format, so why not look at that part of the code and adapt it?

Scrolling, we don't know what kind of scrolling you want. You have to explain that.

viritcal Instead of horizontal

viritcal Instead of horizontal

If you are sending the serial data to the Serial Monitor application, then vertical scrolling is not possible. If you are sending the serial data to something else, it is in your best interests to tell us what you are sending the data to. It is in your best interests to spell vertical correctly, too.

I am out of here

Kutton: I am out of here

Seems strange to take that attitude after @PaulS gave you a simple and practical answer.

...R