Serial communication between Spark and Other

I have a Spark that is driving a LCD. I want to connect it via Serial to a RFduino to access a series of sensor values. However, The RFduino will only have new sensor values maybe every 1 minute or so. Both boards will be busy doing other tasks. How would I set this up? Would Spark Poll Rfduino every minute OR RFduino send something when ready? I am not very familiar with interrupts etc so i appreciate any help.

@MagicTech, assuming you connect the RFDuino to Serial1, you can have the Spark wait for serial data from the RFduino using:

    if (Serial1.available()) {
      while (Serial.available()) {
        //read the message into an array of chars or whatever, parse it as necessary, etc.
      }   
    }

//Otherwise, nothing received so go on with the rest of your loop

You just need to check the serial port as part of your loop(). :smile:

Thank you much again.
It will be wired to Serial2…when that becomes available :wink:
nudge nudge…

Hint received, thanks for the nudge :slight_smile:

1 Like

Any news on Serial2as yet?

@MagicTech, Serial2 is available on the local build master repo. :smile:

Thanks @peekay123 , Any idea when it will be part of the standard online Build? I have never done a local build.

It’s supposed to be available but the Make file hasn’t been updated since the last time code was pushed to the WEB IDE.

@MagicTech, hopefully on the next production release. @zachary, any comments on this? :smile:

2 Likes

Hey gang,

I’m working on this now as I’m working on bringing the tinker 10 branches into the compile server. It should get released by the end of this sprint. :slight_smile:

Sorry about the long delay!

Thanks,
David

2 Likes