Serialdeclaration on mega

#include <SoftwareSerial.h>

float Gewicht = 0;
int masse = 0;
float tara;

void setup() {

//Mittelwert von tara
for (int i = 0; i < 500; i++) {
tara = tara +;

tara = tara / 500;


void loop() {
float sensorValue = 0;

//Mittelwert des Messwertes
for (int i = 0; i < 500; i++) {
sensorValue = sensorValue +;

sensorValue = sensorValue / 500;
Gewicht = ((sensorValue - tara) / 0.2173);
masse = Gewicht;

Serial.print("Messwert: “);
Serial.println(” = “);
Serial.println(” gramm ");

this is my code, but the compilation error says the Serial3 on line sensorvalue=sensorvalue +

And i have no idea why, please help me.

Did you select the right board under tools --> board?

And you don't need to include SoftwareSerial.h

Lastly, please use code tags when posting code (you can edit your opening post)

** **[code]** **

paste your code after that
** **[/code]** **
after that.

You probably are still compiling for a UNO

Change the board type to the MEGA you have and your will be fine

Thank you very much, I was still using UNO because i am switching all the time.

Do you maybe know how to change my code so that it saves to the sd card( i have a breakoutboard attached) . I thought of the Library SD card but i am not sure if it works.

Well no I don't because I don't know what you want to save, how often etc...

Yes you can use the SD library - just take one of the examples you'll see it's very self explanatory

Start the SD card library
Open a file
Write a string in the file or binary data
Close the file

Loop and start again after a while (like every minute or something)