0

I have connected a bluetooth module(HC-06) and a voice recognition shield(EasyVR) on an arduino UNO.

By using an another HC-06 on the another arduino(so, 2 arduinos and 2 HC-06 totally), I am going to let two arduionos communicate with each other.

Also, simultaneously, one arduino with HC-06 will recogize the voice by using the voice recognition module.

I have successed each operations, but after combining two codes the bluetooth doesn't work...(Voice recognition have successed.)

  1. Is it unable to operate two operations simultaneously?

  2. Can we use these two sentences in one code?

    SoftwareSerial BT(2,3); --> for bluetooth moduleSoftwareSerial Port(12,13); --> for voice recognition module

askedJun 8, 2016 at 3:08
ch8colat's user avatar

2 Answers2

1

Is it unable to operate two operations simultaneously?

The only way you can do two operations simultaneously is to have two Arduinos. An Arduino can only do one thing at a time. In order to make it seem like it's doing things at once you have to create your sketch accordingly. The use ofdelay() is right out. As are long loops using things likewhile(). In short:anything thatblocks is bad.

Can we use these two sentences in one code?

Not reliably, no. They are both resource hungry and, to a large extent, blocking. A general rule is, if you need at least two more UARTs than the board provides then you need a different board. You can only reliably work with one software UART at a time.

I would suggest upgrading to a more capable board with more hardware UARTs. Either that or use a bluetooth system that doesn't use UART, such as an SPI based BLE module.

answeredJun 8, 2016 at 8:48
Majenko's user avatar
0

Physically It is impossible to run 2 things at the same time when you have one microcontroller. "The Arduino is a very simple processor with no operating system and can only run one program at a time". But I am pretty sure that the solution you are trying to find, hides in multitasking or interuption. There are some cones indelay() function: "The problem is that delay() is a "busy wait" that monopolizes the processor. " But in multitasking, you share clock of the processor between two different pieces. You can find more about running different things simultanouslyhere.I have usedmiles() in one of my projects where were coin validator which was outputing impulses and screen which was showing chash inside it.

answeredJun 8, 2016 at 13:05
Giorgi Gvimradze's user avatar

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.