im a total noob!

hello first of all i suck when reading code and trying to understand it. I stumbled across a sketch that I thought was as easy as copy paste. But of course I get errors that I have no clue what is going on. Basically that sketch is to control 3 dosing pumps daily. My first error is 'amp not declared in this scope

#include <Wire.h>
#define DS1307_I2C_ADDRESS 0x68
 
// Convert normal decimal numbers to binary coded decimal
byte decToBcd(byte val)
{
return ( (val/10*16) + (val%10) );
}
 
// Convert binary coded decimal to normal decimal numbers
byte bcdToDec(byte val)
{
return ( (val/16*10) + (val%16) );
}
 
// Stops the DS1307, but it has the side effect of setting seconds to 0
// Probably only want to use this for testing
/*void stopDs1307()
{
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.write(0);
Wire.writeWire.writeWire.write(0x80);
Wire.endTransmission();
}*/
 
// 1) Sets the date and time on the ds1307
// 2) Starts the clock
// 3) Sets hour mode to 24 hour clock
// Assumes you're passing in valid numbers
void setDateDs1307(byte second,        // 0-59
byte minute,        // 0-59
byte hour,          // 1-23
byte dayOfWeek,     // 1-7
byte dayOfMonth,    // 1-28/29/30/31
byte month,         // 1-12
byte year)          // 0-99
{
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.write(0);
Wire.write(decToBcd(second));    // 0 to bit 7 starts the clock
Wire.write(decToBcd(minute));
Wire.write(decToBcd(hour));      // If you want 12 hour am/pm you need to set
// bit 6 (also need to change readDateDs1307)
Wire.write(decToBcd(dayOfWeek));
Wire.write(decToBcd(dayOfMonth));
Wire.write(decToBcd(month));
Wire.write(decToBcd(year));
Wire.endTransmission();
}
 
// Gets the date and time from the ds1307
void getDateDs1307(byte *second,
byte *minute,
byte *hour,
byte *dayOfWeek,
byte *dayOfMonth,
byte *month,
byte *year)
{
// Reset the register pointer
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.write(0);
Wire.endTransmission();
 
Wire.requestFrom(DS1307_I2C_ADDRESS, 7);
 
// A few of these need masks because certain bits are control bits
*second     = bcdToDec(Wire.read() &amp; 0x7f);
*minute     = bcdToDec(Wire.read());
*hour       = bcdToDec(Wire.read() &amp; 0x3f);  // Need to change this if 12 hour am/pm
*dayOfWeek  = bcdToDec(Wire.read());
*dayOfMonth = bcdToDec(Wire.read());
*month      = bcdToDec(Wire.read());
*year       = bcdToDec(Wire.read());
}
 
//define pins
int motorPin1 = 9;
int motorPin2 = 10;
int motorPin3 = 11;
 
void setup()  // run once, when the sketch starts
{
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
 
Wire.begin();
Serial.begin(9600);
 
// Change these values to what you want to set your clock to.
// You only need to run this the first time you setup your RTC.
// Set the correct value below and un comment it to run it.
 
/*
second = 45;
minute = 55;
hour = 9;
dayOfWeek = 2;
dayOfMonth = 30;
month = 4;
year = 13;
setDateDs1307(second, minute, hour, dayOfWeek, dayOfMonth, month, year);
 
*/
 
}
void loop() // run over and over again
{
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
 
// this prints the output to the serial window (tools &gt; serial monitor in arduino) and is great for testing
getDateDs1307(&amp;second, &amp;minute, &amp;hour, &amp;dayOfWeek, &amp;dayOfMonth, &amp;month, &amp;year);
Serial.print(hour, DEC);
Serial.print(&quot;:&quot;);
Serial.print(minute, DEC);
Serial.print(&quot;:&quot;);
Serial.print(second, DEC);
 
// Set the time you want the motors to kick in
if((hour == 21)&amp;&amp;(minute == 23)&amp;&amp;(second==10)){
Serial.print(&quot; TRUE&quot;);
Serial.println(&quot; &quot;);
Serial.println(&quot; MP1&quot;);
analogWrite(motorPin1, 255);
delay(8500); // set how long you want the motor to run... 1000 = aprox 1ml
 
analogWrite(motorPin1, 0);
Serial.println(&quot; MP2&quot;);
analogWrite(motorPin2, 255);
delay(9500); // set how long you want the motor to run... 1000 = aprox 1ml
 
analogWrite(motorPin2, 0);
Serial.println(&quot; MP3&quot;);
analogWrite(motorPin3, 255);
delay(5500); // set how long you want the motor to run... 1000 = aprox 1ml
analogWrite(motorPin3, 0);
 
}
// we dont really need this since we set the pin to low above but just incase <img class="wp-smiley" alt=":)" src="http://fishtankprojects.com/wp-includes/images/smilies/icon_smile.gif"> 
else{Serial.println(&quot; false&quot;);
analogWrite(motorPin1, 0);
analogWrite(motorPin2, 0);
analogWrite(motorPin3, 0);
}
 
delay(1000);
 
}
if((hour == 21)&&(minute == 23)&&(second==10)){

Those "amp"s?

if((hour == 21)&&(minute == 23)&&(second==10)){

Problems with "quote"s too, I see.

*second    = bcdToDec(Wire.read() & 0x7f);amp's here

Same treatment.

does it matter with the version of arduino im using too?

what matters is how you are copying and pasting the code.

"&" is being converted to "&"

Serial.print(&:&);

I corrected that issue now this is a new error "expected promary-espression before '.' token

Raymond_Q:

Serial.print(&:&);

I corrected that issue now this is a new error "expected promary-espression before ‘.’ token

and how is that corrected ?
to do what ?

i’m sorry but if you’re a “total noob” - you really need to work through the easy-peasy stuff first before even diving into I2C and real-time clocks !
even i haven’t gotten to that yet !
(i consider myself a n00bie !)

you really need to KNOW (at least about them), everything that is on this page;
http://arduino.cc/en/Reference/HomePage

it’s not even a case of learning to walk before you run, (IMHO) you’re turning up at a state level(?) track meet and gearing up and wondering why the other runners are doing certain stretch exercises.

/rant

if you’re serious - stick with it - but you need to “slow down a bit” and get past the basics.

Can you start by telling us where you found that code ? You copy-pasted the html code, you need to get the sketch text lines.

i got it from this website http://fishtankprojects.com/diy-aquarium-projects/arduino-controlled-dosing-pumps.html

Allthough that project is well documented, the code was added to that page in a wrong way. There is a nasty code-to-html translation problem with it.

Can you upload your code once more ? We can try line-by-line to see what has gone lost in translation.

here it is thank you for your time

#include <Wire.h>
#define DS1307_I2C_ADDRESS 0x68
 
// Convert normal decimal numbers to binary coded decimal
byte decToBcd(byte val)
{
return ( (val/10*16) + (val%10) );
}
 
// Convert binary coded decimal to normal decimal numbers
byte bcdToDec(byte val)
{
return ( (val/16*10) + (val%16) );
}
 
// Stops the DS1307, but it has the side effect of setting seconds to 0
// Probably only want to use this for testing
/*void stopDs1307()
{
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.write(0);
Wire.writeWire.writeWire.write(0x80);
Wire.endTransmission();
}*/
 
// 1) Sets the date and time on the ds1307
// 2) Starts the clock
// 3) Sets hour mode to 24 hour clock
// Assumes you're passing in valid numbers
void setDateDs1307(byte second,        // 0-59
byte minute,        // 0-59
byte hour,          // 1-23
byte dayOfWeek,     // 1-7
byte dayOfMonth,    // 1-28/29/30/31
byte month,         // 1-12
byte year)          // 0-99
{
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.write(0);
Wire.write(decToBcd(second));    // 0 to bit 7 starts the clock
Wire.write(decToBcd(minute));
Wire.write(decToBcd(hour));      // If you want 12 hour am/pm you need to set
// bit 6 (also need to change readDateDs1307)
Wire.write(decToBcd(dayOfWeek));
Wire.write(decToBcd(dayOfMonth));
Wire.write(decToBcd(month));
Wire.write(decToBcd(year));
Wire.endTransmission();
}
 
// Gets the date and time from the ds1307
void getDateDs1307(byte *second,
byte *minute,
byte *hour,
byte *dayOfWeek,
byte *dayOfMonth,
byte *month,
byte *year)
{
// Reset the register pointer
Wire.beginTransmission(DS1307_I2C_ADDRESS);
Wire.write(0);
Wire.endTransmission();
 
Wire.requestFrom(DS1307_I2C_ADDRESS, 7);
 
// A few of these need masks because certain bits are control bits
*second     = bcdToDec(Wire.read() &amp; 0x7f);
*minute     = bcdToDec(Wire.read());
*hour       = bcdToDec(Wire.read() &amp; 0x3f);  // Need to change this if 12 hour am/pm
*dayOfWeek  = bcdToDec(Wire.read());
*dayOfMonth = bcdToDec(Wire.read());
*month      = bcdToDec(Wire.read());
*year       = bcdToDec(Wire.read());
}
 
//define pins
int motorPin1 = 9;
int motorPin2 = 10;
int motorPin3 = 11;
 
void setup()  // run once, when the sketch starts
{
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
 
Wire.begin();
Serial.begin(9600);
 
// Change these values to what you want to set your clock to.
// You only need to run this the first time you setup your RTC.
// Set the correct value below and un comment it to run it.
 
/*
second = 45;
minute = 55;
hour = 9;
dayOfWeek = 2;
dayOfMonth = 30;
month = 4;
year = 13;
setDateDs1307(second, minute, hour, dayOfWeek, dayOfMonth, month, year);
 
*/
 
}
void loop() // run over and over again
{
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
 
// this prints the output to the serial window (tools &gt; serial monitor in arduino) and is great for testing
getDateDs1307(&amp;second, &amp;minute, &amp;hour, &amp;dayOfWeek, &amp;dayOfMonth, &amp;month, &amp;year);
Serial.print(hour, DEC);
Serial.print(&quot;:&quot;);
Serial.print(minute, DEC);
Serial.print(&quot;:&quot;);
Serial.print(second, DEC);
 
// Set the time you want the motors to kick in
if((hour == 21)&amp;&amp;(minute == 23)&amp;&amp;(second==10)){
Serial.print(&quot; TRUE&quot;);
Serial.println(&quot; &quot;);
Serial.println(&quot; MP1&quot;);
analogWrite(motorPin1, 255);
delay(8500); // set how long you want the motor to run... 1000 = aprox 1ml
 
analogWrite(motorPin1, 0);
Serial.println(&quot; MP2&quot;);
analogWrite(motorPin2, 255);
delay(9500); // set how long you want the motor to run... 1000 = aprox 1ml
 
analogWrite(motorPin2, 0);
Serial.println(&quot; MP3&quot;);
analogWrite(motorPin3, 255);
delay(5500); // set how long you want the motor to run... 1000 = aprox 1ml
analogWrite(motorPin3, 0);
 
}
// we dont really need this since we set the pin to low above but just incase <img class="wp-smiley" alt=":)" src="http://fishtankprojects.com/wp-includes/images/smilies/icon_smile.gif"> 
else{Serial.println(&quot; false&quot;);
analogWrite(motorPin1, 0);
analogWrite(motorPin2, 0);
analogWrite(motorPin3, 0);
}
 
delay(1000);
 
}

If "amp" is an ampersand (&), what do you think a "quot" might be?

You need to change a lot, it is too many to mention all of them.

Can you do a search and replace ?
Use Ctrl+F and search for: &
replace it by: &
click on replace all.

search for: "
replace all with: "

That should be all.

thank you very much! :)