cannot combine with previous 'type-name' declaration specifier

Hello, I am getting this error and i have no idea what to do with it.

cannot combine with previous 'type-name' declaration specifier

If I could get any help with this it would be very useful.

Here is the code that is giving me the error.

int dataPin = 11;

Thanks

kidos100: int dataPin = 11;

Well there's obviously nothing wrong with that line by itself. So my guess is that it has to do with another line somewhere. You'll have to post the whole code if you want help finding the error.

My wild guess is you left off a semicolon at the end of the previous line.

here is the full code.

#include <Wire.h>

//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
//Pin connected to DS of 74HC595
int dataPin = 11;


int easy_1;
int easy_2;
int easy_3;
int easy_4;

int med_1;
int med_2;
int med_3;
int med_4;

int hard_1;
int hard_2;
int hard_3;

const int playerYellow = 2;
const int playerGreen = 3;
const int playerBlue = 4;
const int playerRed = 5;

char byte1;
char byte2;
char byte3;
byte


void setup()
{
 pinMode(latchPin, OUTPUT);    // Set pins to the correct mode.
 pinMode(playerYellow, INPUT);
 pinMode(playerGreen, INPUT);
 pinMode(playerBlue, INPUT);
 pinMode(playerRed, INPUT);
 Wire.begin(4);                // Join i2c bus with address #4
 Wire.onReceive(receiveWire);  // Register event;
}

void loop()
{
 getValues();
}



void getValues()
{
 hard_1 = analogRead(0);
 hard_2 = analogRead(1);
 hard_3 = analogRead(2);
}



void receiveWire(int numBytes)
{
 while(1 < Wire.available()) // loop through all but the last
 {
 if (numBytes = 2)
 {
 byte1 = Wire.read();
 byte2 = Wire.read();
 }
 else if (numBytes = 1)
 {
 byte3 = Wire.read();
 }
 }
}

Slave_Spanish_Project.ino (1.31 KB)

char byte1;
char byte2;
char byte3;
byte

oops

if (numBytes = 2)
...
if (numBytes = 1)

and again

Thanks, that fixed my problem.