Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 5 months ago.
no interrupt is being detected in ble nano?
I tried pins D7, D6, D4, CTS pin, A4 pin but no data is shown on my app. when I call function by a ticker everything seems to work fine. But its not working when I assign interruptin or digitalin to any pins.
no interrupt detected
int main(void) { pulses.mode(PullDown); Ticker duration; //Ticker ticker; //ticker.attach(interup, 0.01); pulses.rise(&onTick); timer.start(); ble.init(); duration.attach(timing, 1); ble.gap().onDisconnection(disconnectionCallback); /* Setup primary service. */ //init Wheel to 100revs //uint16_t irritime; CyclingSpeedAndCadenceService cscService(ble, CyclingSpeedAndCadenceService::MODE_SPEED_CADENCE, CyclingSpeedAndCadenceService::LOCATION_CHAINSTAY); /* Setup auxiliary service. */ DeviceInformationService deviceInfo(ble, "Jay", "Model1", "SN1", "hw-rev1", "fw-rev1", "soft-rev1"); /* Setup advertising. */ ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE); ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LIST_16BIT_SERVICE_IDS, (uint8_t *)uuid16_list, sizeof(uuid16_list)); ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::CYCLING_SPEED_AND_CADENCE_SENSOR); ble.gap().accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME)); ble.gap().setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED); ble.gap().setAdvertisingInterval(1000); /* 1000ms */ ble.gap().startAdvertising(); //nextWheel = 7 + (rand() % 10); //nextCrank = 8 + (rand() % 20); // infinite loop while (1) { // check for trigger from periodicCallback() if (ble.getGapState().connected) { if (triggerCrank && triggerWheel) { r = 0; t.reset(); t.start(); while (t.read_ms()<1000) { ; } t.stop(); rpm = r; for(int i=0; i<=5; i++) { rpmf = rpmf +rpm; } //irritime = min; uint16_t runtime = timer.read(); cscService.updateCounters((rpmf/6)*60, irritime, runtime, total*100); triggerWheel = false; triggerCrank = false; rpmf = 0; }
I tried to put condition and test the pins. I found out that it is considering pullup and pulldown mode but not accepting any current. Do i need to do something else to make the pins work?
posted by jayendra mishra 18 Oct 2016Can you provide the complete code that using interrupt detection?
posted by jixing zou 19 Oct 2016Do you have an idea of maximum voltage range of the I/O pins?
posted by jayendra mishra 19 Oct 2016