Go Down

Topic: void value not ignored as it ought to be (Read 2 times) previous topic - next topic

Delta_G

Here are two more illegal conversions from byte pointer to uint8_t

Code: [Select]
void fadeLedIn(int pinNumber){
  for(int j = 0; j <= 255; j+=10){
    analogWrite(pinNumber,j);
    delay(10);
  } 
}

void fadeLedOut(int pinNumber){
  for(int j = 255; j >= 0; j-=10){
    analogWrite(pinNumber,j);
    delay(10);
  } 
  digitalWrite(pinNumber, LOW);
}


Go through your code and fix all these.  If you are going to use the array you'll need to put the index with it.  Get all that fixed, and post us new code to look at. 

hilukasz


Here are two more illegal conversions from byte pointer to uint8_t

Code: [Select]
void fadeLedIn(int pinNumber){
  for(int j = 0; j <= 255; j+=10){
    analogWrite(pinNumber,j);
    delay(10);
  } 
}

void fadeLedOut(int pinNumber){
  for(int j = 255; j >= 0; j-=10){
    analogWrite(pinNumber,j);
    delay(10);
  } 
  digitalWrite(pinNumber, LOW);
}


Go through your code and fix all these.  If you are going to use the array you'll need to put the index with it.  Get all that fixed, and post us new code to look at. 


I would fix it if I knew what was wrong to be honest. this section of code has compiled fine in the past, not sure what would be wrong with it. I don't even know how to look up what that "illegal conversions from byte pointer to uint8_t" error is, google isn't giving me anything.
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com

Delta_G

Googling for pointer and c++ gives a ton of stuff.  Many many tutorials that explain what a pointer is.  Once you know that it should be obvious that you can't convert one to an intended type. 

But even without that, I told you how to fix it.  pin numbers is an array.  You're using it without an index.  That won't work. 

Delta_G

Code: [Select]
Serial.print(allValues[0]); Serial.print(" , "); Serial.print(allValues[1]); delay(10);

And I'm betting this line will give you an allValues not declared in this scope error.  I don't see it declared anywhere anyway.

EDIT:  Found it in the previous code, but it was commented out there. 

hilukasz


Googling for pointer and c++ gives a ton of stuff.  Many many tutorials that explain what a pointer is.  Once you know that it should be obvious that you can't convert one to an intended type. 

But even without that, I told you how to fix it.  pin numbers is an array.  You're using it without an index.  That won't work. 


maybe I am misunderstanding but pinNumber is an int, not an array. are you looking at ledPin or sensorPin maybe? those are different and in fact an array.
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com

Go Up