![]() ![]() I disconnected all other devices from the Arduino and left only the HC-05 Bluetooth module running. It showed that the Arduino receives the input from my APP (0, 1 etc.) and then after 30 seconds nothing comes up. I recorded the input on my computer with a simple program (see below). I have connected it correctly (TX->RX) to the Arduino. Ok, I have tried several things, but since I am a beginner I have so far gained more question marks than understanding.įor clarification regarding the TX / TX connections. If (sensorPinValue 380 & rtc_time > 720 & rtc_time < 1380) Int rtc_time = myRTC.hours * 60 + myRTC.minutes Int laSunset = oberwil.sunset(myRTC.year, myRTC.month, myRTC.dayofmonth, false) Replacing the module was not successful, so it's not the Bluetooth module.ĭoes anyone know where the error could be, or has a workaround?ĭusk2Dawn oberwil(47.512152, 7.559374, 2) If I disconnect the Bluetooth module from the power supply and switch it on again, it can be reconnected and the connection is established again! The Bluetooth module continues to flash normally as if it is connected, but no further data is received by the Arduino. Then I can switch the lamp manually (on/off). The module switches from continuous blinking to receiving. I can connect the Arduino to the smartphone. The connection to my smartphone and the app with a HC-05 module is always breaking up. The change of modes and the manual control is done using a Bluetooth connection and a smartphone app. There are three modes available: Manual (on and off), switching according to the time, switching according to brightness. It should switch on at sunset and then switch off again at a certain time. I would like to remote control a lamp from an Arduino. Enter the COM on which your Arduino is on.I'm working on my first Arduino project and I've come across a problem with the Bluetooth connection that is unsolvable for me. MyPort = new Serial(this, "COM3", 9600) // My Arduino is on COM3. ![]() Depending upon the contents of the string the code will simulate the pressing of the appropriate keyboard key (if the string is "Up" it will press the UP key). (Remember that we simply want to read the data till " :" since we are sending the string followed by a colon from Arduino). The below "Processing" code basically reads the string which is sent by Arduino over serial port. So, for example, when the keyPress(VK_UP) method is called it would simulate the pressing of the up key (VK_UP is just the constant for the up arrow key). The code uses the Robot class which allows programmatic control of the keyboard. Processing is just java but doesn't need to be manually compiled and running it is also easier. Processing is used to actually simulate the pressing of a key. Now, we will talk about the "Processing" part. * with a colon when you want to simulate a keypress. *Add or subtract to the code for your application. Just have a colon at the end to make it easier to parse the string. Serial.println("Up:") //It doesn't matter what you print. This is because I had some trouble reading the string ending character in my Processing code and just chose this easy way to simply read until I get a " :". Note: You would notice that I am sending "Up :" instead of just "Up". How to modify the program is given in detail in the second last step, though it is actually very easy and may not really need the explanation. My program is going to simulate the pressing of the "UP" key when D12 push button is pressed and "DOWN" key when D11 push button is pressed. It needs to be modified to suit to your application. (The Processing code required is found in next section). And remember to place the switches in such a way that it is convenient to play. Repeat the connecting of the switches for all the buttons that you need. All you have to do is connect one terminal of the switch to +5V and the other terminal to a digital pin (for example D12) as well as GND through the pull down resistor. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |