Note that there are some explanatory texts on larger screens.

plurals
  1. POInterfacing DF Robot Bluetooth module with Arduino
    primarykey
    data
    text
    <p>How can the DF Robot Bluetooth module be connected to the Arduino so that the Arduino can communicate with it.</p> <p>I used <a href="http://yerobot.com/download/mannual/DF-Bluetooth%20Manual.pdf" rel="nofollow noreferrer">this tutorial</a>.</p> <p>I managed to get the light flashing on the module and it seems to be able to pair fine, but when I run the serial monitor and send a letter (say 'H') which should turn a light on I get a Java error:</p> <pre><code>java.io.IOException: Bad file descriptor in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at processing.app.Serial.write(Serial.java:470) at processing.app.Serial.write(Serial.java:492) at processing.app.SerialMonitor.send(SerialMonitor.java:128) at processing.app.SerialMonitor.access$100(SerialMonitor.java:29) at processing.app.SerialMonitor$4.actionPerformed(SerialMonitor.java:82) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) </code></pre> <p>I checked the wiring and I have the RXD going to the RX (pin 0) on the board and TXD to TX (pin 1) and the rest wired up, but again still no luck. What could be the matter?</p> <p>This is the code I have on the Arduino:</p> <pre><code>int ledpin = 13; char val; void setup() { pinMode(ledpin, OUTPUT); // pin 48 (on-board LED) as OUTPUT Serial.begin(9600); // start serial communication at 9600bps } void loop() { if( Serial.available() ) { // if data is available to read val = Serial.read(); // read it and store it in 'val' } if( val == 'H' ) { // if 'H' was received digitalWrite(ledpin, HIGH); // turn ON the LED } else { digitalWrite(ledpin, LOW); // otherwise turn it OFF } delay(100); // wait 100ms for next reading } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload