OK, had a few beers but can't understand why this doesn't work and hope the "Beerless" in our ranks can tell me why.
Simple code,
As expected, it prints 123 on the monitor.
Change it to pointer,
It now prints zero. I know it's an error that sits between keyboard and monitor but can't work it out. What am I missing?
Mike.
Simple code,
Code:
void setup(){
Serial.begin(115200);
Serial.println("\n\n\nStarted.");
fooBar(123);
}
void loop(){
}
void fooBar(uint16_t val){
Serial.println(val);
}
Change it to pointer,
Code:
void fooBar(uint16_t *val){
Serial.println(*val);
}
Mike.