arduino

Issue loading files w/SPIFFS (ERR_CONTENT_LENGTH_MISMATCH)

China☆狼群 提交于 2019-12-12 10:13:24
问题 Alright so I've been looking into this for the past two days and I still feel like I'm getting nowhere. I recently started using the SPIFFS File System for Arduino development on an HUZZAH ESP8266 like the FSBrowser.ino example, and while it's been great in terms of separating code, as my code continues to grow it has not been great in terms of stability. Ever since I began adding more and more javascript, I began to have errors pop up for various files, whether it's my HTML/CSS/JS, and the

How can Arduino detect the state of an LED?

不打扰是莪最后的温柔 提交于 2019-12-12 10:05:25
问题 I'm working on a blinking/fading lights program for Arduino. I'm trying to build in some interactivity that's based on LED state and certain switch combinations. Consider: When a button is pressed, if an LED is ON I want to turn it off and if an LED is OFF I want to turn it on. However, I've not been able to find any information about determining LED state. The closest was this question about Android, but I'm trying to find out if I can do this from the Arduino platform. Does anyone have any

COM port disappears when unplugging USB

余生颓废 提交于 2019-12-12 09:58:29
问题 I am prototyping a sort of Arduino-based docking station for a tablet, using the USB port as connector. This means I need to support to ability to plug/unplug the USB connector while the application on the tablet is running. The tablet runs a c# application (.net 4.5 on Win7 64 bit) in which I am connecting to the Arduino Uno. When the application is launched I loop all available COM ports using: var ports = SerialPort.GetPortNames(); // -> [COM3,COM4,COM8] foreach (var port in ports) { var

Java RXTX Library doesn't load native library

怎甘沉沦 提交于 2019-12-12 09:52:58
问题 Basically i wanted to write a simple communication tool for my Arduino using the RXTX Library for java and failed horribly when it came to loading the dynamic library. My system specs: OS: OS X Yosemite 10.10.3 Java: SDK 1.8.0_45 RXTX: 2.1-7r2 - modified version for intel mac running 64 bit java, which can be found here. IDE: NetBeans 8 I checked, that these files work by following the install instructions, which is simply copying these two files into the /Library/Java/Extensions directory.

Arduino - how to get serial data without IDE

时间秒杀一切 提交于 2019-12-12 09:27:03
问题 I am building a prototype drip monitor for a brain shunt. It will monitor the drips and report whatever data I need. The problem is I'm just building the device. A person who knows nothing about Arduinos or code is using it. Is there a way or program to display and/or save data to a file such that a person could just plug the Arduino in and not bother the the IDE or any code? Thanks for the help! 回答1: As noted in the comments, there are many ways to do this depending on budget and other

Kill process that raises Device or resource busy: '/dev/ttyUSB0'?

▼魔方 西西 提交于 2019-12-12 08:20:06
问题 I connect to my Arduino board with the following Python code. device=glob.glob("/dev/ttyUSB*")[0] time.sleep(1) arduino = serial.Serial(device, 115200, timeout=5) It generally works, but somehow some other process must be accessing the board after reboot giving me the error serial.serialutil.SerialException: could not open port /dev/ttyUSB0: [Errno 16] Device or resource busy: '/dev/ttyUSB0' When unplugging and replugging the USB-plug I can execute the Python code normally, without the error

arduino学习笔记二十二--模拟交通信号灯

痞子三分冷 提交于 2019-12-12 07:35:02
交通信号灯是交通信号中的重要组成部分,是道路交通的基本语言。交通信号灯由红灯(表示禁止通行)、绿灯(表示允许通行)、黄灯(表示警示)组成。分为:机动车信号灯、非机动车信号灯、人行横道信号灯、车道信号灯、方向指示信号灯、闪光警告信号灯、道路与铁路平面交叉道口信号灯。 道路交通信号灯是交通安全产品中的一个类别,是为了加强道路交通管理,减少交通事故的发生,提高道路使用效率,改善交通状况的一种重要工具。适用于十字、丁字等交叉路口,由道路交通信号控制机控制,指导车辆和行人安全有序地通行。 交通信号灯的种类有:机动车道信号灯,人行横道信号灯,非机动车道信号灯,方向指示信号灯,移动式交通信号灯,太阳能闪光警告信号灯,收费站天棚信号灯. 交通信号灯是交通信号指挥中的重要组成部分,是道路交通的基本语言。交通信号灯由红灯(表示禁止通行)、绿灯(表示允许通行)、黄灯(表示警示)组成。分为:机动车信号灯、非机动车信号灯、人行横道信号灯、车道信号灯、方向指示信号灯、闪光警告信号灯、道路与铁路平面交叉道口信号灯。广泛用于公路交叉路口,弯道、桥梁等存有安全隐患的危险路段,指挥司机或行人交通,促进交通畅通,避免交通事故和意外事故发生。 实验用到的元件 红‘绿’黄 LED各一个 , 3个470欧姆的电阻, 1个10K欧姆电阻, 1个轻触, 6根杜邦线, 一块实验板。 原理图 3个LED自由闪烁 当 按住轻触开关

arduino学习笔记二十三--模拟输入5V数字电压表

狂风中的少年 提交于 2019-12-12 07:25:40
电压表是测量电压的一种仪器,常用电压表——伏特表符号:V 数字电压表利用ARDUINO开发板的模拟输入口制作 5V数字电压表 这里用的是电位器 模拟电源输入,实际大家实验时候可以直接测量电池的电压,只要测量的电源不超过5V就可以了。(超过5V是会烧ARDUINO 板的哦!!!!) 实验用到的元件 一个单联电位器,3根杜邦线,一块实验板。 原理图 电位器的一脚接地 GND 三脚接电源VCC 二脚接arduino板上 A0口 连接ARDINO开发板,下载程序,打开串口助手,这时可以看到串口读出的电压值 可以转动电位器来模拟输入电压, 这时可以看到,串口显示的电压开始变化, 也可以自己动手测量,下电池的电压,(注意电压一定不可以超过5V 想要测量更高的电源需要加分压电阻) 代码: void setup() { Serial.begin(9600); // 打开串口,设置波特率为9600 bps } void loop() { int V; V=analogRead(0);//传感器接到模拟口0 Serial.println(V/215.9,DEC);//从串口发送字符串并换行 delay(100); } 来源: CSDN 作者: 甜航一直在 链接: https://blog.csdn.net/qq_37631068/article/details/103447729

Subtracting two time interval

半世苍凉 提交于 2019-12-12 06:38:35
问题 I wanted to subtract two time interval. here one time interval is 5hour 30 minute and other is current time.the code is written as follow. main() { int Time1; int Time2; int hour=10; int minute=5; int second=13; int h; int m; int Ntime; Time1=(60*5)+(30); Time2=60*hour+minute; Ntime=Time2-Time1; m=(Ntime%60); Ntime=Ntime/60; h=(int)(Ntime); printf("hour after subtraction is : %d hour %d min",h,m) } 回答1: I have not looked at any logical errors in your program but the error you post is due to

arduino学习笔记二十五--LED闪光灯 电位器控制闪烁速度

大城市里の小女人 提交于 2019-12-12 05:58:57
实验用到的元件 1个LED(颜色个人喜好), 1个470欧姆电阻(想要亮点可以用100欧姆的电阻), 一个10K电位器, 5根杜邦线, 一块实验板。 原理图 通过电位器 改变LED的闪烁速度 代码: int ledPin = 11; int analogPin = A0; void setup() { pinMode(ledPin, OUTPUT); } void loop() { int period = (1023 - analogRead(analogPin)) / 2 + 25; digitalWrite(ledPin, HIGH); delay(period); digitalWrite(ledPin, LOW); delay(period); } 来源: CSDN 作者: 甜航一直在 链接: https://blog.csdn.net/qq_37631068/article/details/103447812