Hi Ian,
Sounds like a good approach; BusIn is an easy way to read a bus on a flexible selection of pins as a single variable. I assume there is some way you know if something has been received.
As a simple example, you could do something like the following to do things whenever the state changes (untested):
#include "mbed.h"
BusIn bus(p5, p6, p7, p8);
int main() {
int last = 0;
while(1) {
if(last != bus) {
last = bus;
switch(last) {
case 3: dosomething(); break;
case 6: dosomethingelse(); break;
default: dodefault(); break;
};
}
}
}
I'm sure with some investigation on the /handbook/BusIn page you should be heading in the right direction.
Simon
I have just joined mbed and I'am a complete novice..I have a keeloq receiver with a 4 bit output each going low on activation giveing 16 possible combinations..I was hopeing to input this to my mbed giveing a value in a variable for manipulation ..is BusIn the way to go..any help would be very much appreciated