rfduino

Executing multiple functions/commands on Arduino

◇◆丶佛笑我妖孽 提交于 2019-12-12 01:43:08
问题 I am using an RFduino and an iOS application to control some RGB LEDs. This is how I'm sending a string command to the module: - (IBAction)fadeButtonPressed:(id)sender { [rfduino send:[@"fade" dataUsingEncoding:NSUTF8StringEncoding]]; } These command(s) are coming back just fine on the RFduino side: void RFduinoBLE_onReceive(char *data, int len) { if (strncmp(data, "fade", 4) == 0) { // begin fading chosen LED colour } } Is there a better way of executing multiple functions on Arduino? It