arduino

Multiple libraries were found servo.h

点点圈 提交于 2019-12-24 19:22:51
问题 Multiple libraries were found servo.h error. Please help to fix. I am getting this error: Error: Arduino: 1.8.5 (Windows 8), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 4M (3M SPIFFS), v2 Lower Memory, Serial1, None, Only Sketch, 115200" Smart_Door:20: error: 'servo' does not name a type servo.attach(2); // attaches the servo on GPIO2 to the servo object ^ Multiple libraries were found for "Servo.h" Used: C:\Users\Deepak\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1

Issues with TCP on Arduino

亡梦爱人 提交于 2019-12-24 19:21:35
问题 I am experimenting with my Arduino Leonardo and a simple C socket server. The C part must send a string to the Arduino but I cannot connect to the arduino (after the socket is initialized C function is blocked and can not connect to Arduino). The C function code is: #include <stdio.h> #include <winsock2.h> #pragma comment(lib, "ws2_32.lib") //Winsock Library int connect() { WSADATA wsa; SOCKET s; struct sockaddr_in server; char* message; printf("\nInitialising Winsock..."); if (WSAStartup

modbus rtu over tcp (modbus tcp gateway)

狂风中的少年 提交于 2019-12-24 18:23:41
问题 Is it possible to build a modbus-RTU ethernet gateway using a linux box or arduino? I have plc slaves linked together using modbus RTU, and I want to connect one of them over TCP with my pc as master. I wonder if I can use a linux box (rasbery pi/raspbian) connected to a router, as a modbus-to-tcp converter by piping the usb port to my local ip on some port, as one plc will be connected in modbus rtu to the linux box`s usb port. Piping command will be something Like this: nc -l 5626 > /dev

HTTPREAD missing characters with Arduino and SIM900

一世执手 提交于 2019-12-24 17:48:48
问题 I am using a SIM900 module with my Arduino and it is missing characters although it is returning the right number of characters expected. I have ERROR on AT+SAPBR=1,1 and AT+HTTPINIT so I am not sure if this is the reason for it. Im not sure how to fix these issues either. AT+CGATT? +CGATT: 1 OK AT+CGATT=1 OK AT+SAPBR=3,1,"CONTYPE","GPRS" OK AT+SAPBR=3,1,"APN","mobile.o2.co.uk" OK AT+SAPBR=1,1 ERROR AT+HTTPINIT ERROR AT+HTTPPARA="URL","http://www.xxxxxxxxxxx.com/temp/" OK AT+HTTPACTION=0 OK

Difference between uint8_t* vs uint8_t

徘徊边缘 提交于 2019-12-24 17:23:01
问题 What is the difference/use for these 2 types? I have a basic understanding regarding pointers but I just can't wrap my head around this. uint8_t* address_at_eeprom_location = (uint8_t*)10; This line found in an Arduino example makes me feel so dumb. :) So basically this is a double pointer? 回答1: The uint_t is the unsigned integer, this is the data stored directly in the memory. The uint_t * is the pointer to the memory in which the number is stored. The (uint_t*) is cast of the 10 - (literal

Using JFrame with a Continuous Input Stream

坚强是说给别人听的谎言 提交于 2019-12-24 17:16:35
问题 I'm trying to implement code which reads from my redboard's serial port and based on what it reads have it repaint a circle. The end goal of this is to use the Robot class to achieve actual cursor control, but I first want to learn more about Java along the way and so I'm trying to achieve it with some basic graphics first. To summarize my issue, I do not know how to use JFrame with a continuously changing input from a static method. The serial port accessing JAR can be found at http:/

How to print in Arduino a char variable as a number to the Serial Port?

两盒软妹~` 提交于 2019-12-24 17:00:13
问题 I am using Arduino Uno. I am reading a byte value from the EEPROM and storing the value in a variable of type char (1 byte). I want to print the value of the variable as a number (not to the corresponding ASCII code) to the Serial Monitor. For example consider char val = 5 . I want to see to the Serial Monitor 5 and not the ASCII value. I tried both Serial.print(val) and Serial.write(val) but the result is the same: it prints always the ASCII code. How can I print the value to the Serial

Arduino GSM GPS Shield doesn't do the GSM_READY check

送分小仙女□ 提交于 2019-12-24 16:44:08
问题 Before you mark this question as duplicate, please note that I have already tried this, this & this I bought an Arduino UNO R3 & a SIM808 GSM/GPS shield recently. The RX of the Shield is connected to Pin 11 of Arduino, TX to Pin 10 with both the GNDs connected to each other. I have connected my Arduino to my computer with the USB & the shield is connected to an external power supply with a 12V Adapter. Additionally, I have connected the 3.3V of the Arduino to Vcc of the shield. Following is

GET Request from Arduino to Lua (ESP8266)

限于喜欢 提交于 2019-12-24 16:04:03
问题 I have a problem with my GET request. ESP8266 with NodeMCU. My code in Arduino: String cmd = "conn:send(\"GET /json.htm?type=command&param=udevice&idx=2&nvalue=0&svalue=11 HTTP/1.1\r\nHost: 192.168.0.101\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n\")"; wifi.println("conn=nil"); wifi.println("conn=net.createConnection(net.TCP, 0)"); wifi.println("conn:on(\"receive\", function(conn, payload) print(payload) end)"); wifi.println("conn:connect(8080, \"192.168.0.101\")"); wifi.println(cmd);

Can I read iBeacon data using Arduino?

旧街凉风 提交于 2019-12-24 15:03:30
问题 I am using an HM-10 module and Arduino UNO. My requirement is to read data from ibeacons near me using Arduino. Is it possible? I have not been able to find any articles on this. All articles talk about connecting your android phone with arduino. Any idea? 回答1: Yes, it is possible. I'm using an HM-10 as an iBeacon detector (linksprite.com BLE 4.0 shield), and it is successfully detecting a RadBeacon running in iBeacon mode. Firmware on my HM-10 is version 540. Before it would detect the