Go Down

Topic: Library for RAM chip (Read 4 times) previous topic - next topic

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

farlepet


AWOL

_read isn't a function returning a reference, so the assignment isn't possible.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

farlepet

OK, so how would I make it so you could do a statement like: Serial.print(AM9111.read()); ?

AWOL

Code: [Select]
int AM9111::_read()
{
  digitalWrite(_odp,0);
  digitalWrite(_wep,1);
  int rv = 0;
  bitWrite(_rbits,0,digitalRead(_IO[0]));
  bitWrite(_rbits,1,digitalRead(_IO[1]));
  bitWrite(_rbits,2,digitalRead(_IO[2]));
  bitWrite(_rbits,3,digitalRead(_IO[3]));
  _read() = _rbits;
  return rv;
}

Have you ever thought why this routine would always return zero? (if it were to compile)
Is that what you want?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up