arduino-ide

Getting a value from a Struct Array ARDUINO

允我心安 提交于 2020-01-06 05:46:26
问题 I am having an issue retrieving the values stored in a Struct and have no idea why. I am working on the Arduino IDE 1.8.7 In h file // structure to hold each "display unit" settings typedef struct { int displayState; int pixelState[]; int startLed; // the first LED number EG: 8 if the previous display used 0-7 int endLed; int brightness; int saturation; } struct_displayType;` In setup // display[0] is all leds displayUnit[0].displayState=5; displayUnit[0].brightness=255; displayUnit[0]

AT Commands fail to Execute in a program

泪湿孤枕 提交于 2019-12-25 12:53:52
问题 The Program is shown below: #include <SoftwareSerial.h> SoftwareSerial gprsSerial(7, 8); byte sensorInterrupt = 0; // 0 = digital pin 2 byte sensorPin = 2; // The hall-effect flow sensor outputs approximately 4.5 pulses per second per // litre/minute of flow. float calibrationFactor = 4.5; volatile byte pulseCount; float flowRate; unsigned int flowMilliLitres; unsigned long totalMilliLitres; unsigned long oldTime; void setup() { gprsSerial.begin(19200); Serial.begin(19200); pinMode(sensorPin,

Arduino wifi shield cannot find IP address

谁都会走 提交于 2019-12-25 02:48:13
问题 Hi i'm trying to access my wifi shield's ip address on the browser but I keep getting Oops! Google Chrome could not connect to "IP ADDRESS". Things I've done: 1.)Updated firmware on wifi shield using this link http://ohmyfarads.com/2013/11/11/updating-firmware-on-arduino-wifi-shield-for-dummies/ 2.) uploaded the wifi WPA sketch from arduino site. My connection is WPA2 3.) I switched between arduino IDE 1.02 and 1.05 but no luck with either 4.) I'm using an arduino uno board that is attached

Adafruit NeoPixel library doesn't work when addressing more than 7 LED strips

风流意气都作罢 提交于 2019-12-25 00:07:42
问题 As of my last question on SO I'm working on an interactive 14x14 LED table which is being controlled by an Arduino Mega (for further information about the setup and code have a look here. After fixing the problem with data arriving at the Arduino in the wrong order I'm now facing this problem: In order to control the colours of each pixel on the LED table using Adafruit's NeoPixel library I read in an array of the form int[14][14][3]. This works fine now, but when I try to set the RGB values

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

correct way to include .cpp and .h files in an Arduino sketch

*爱你&永不变心* 提交于 2019-12-22 02:04:07
问题 First, the problem: main sketch file: char foo; // required to clean up some other problems #include <Arduino.h> // tried it in desperation, no help #include "a.h" void setup(){ Serial.begin(9600); Serial.println("\nTest begins"); for (int num = -1; num < 1; num++){ Serial.print(num); if (isNegative(num)){ Serial.println(" is negative"); } else { Serial.println(" is NOT negative"); } } } void loop(){} // a.h #ifndef H_A #define H_A boolean isNegative(int x); // Err#1 int anotherOdity();

Why does the Arduino IDE work with NodeMCU? [closed]

痴心易碎 提交于 2019-12-13 07:46:26
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I know when we buy a NodeMCU, we get the NodeMCU firmware already installed in it. But how come we are able to use the Arduino IDE (used for C++ programming) with this dev kit? How can we use a C++ IDE to work with a Lua-based firmware? What's wrong with my concepts here? 回答1: "Lua based firmware" is a bit

Integrating Arduino and Processing - button counter

僤鯓⒐⒋嵵緔 提交于 2019-12-13 07:16:32
问题 I am looking to integrate Arduino controls and Processing Interface. In my Arduino code, there are three buttons attached to pin a1, a0 and d0 (all digitalRead). int x;// assigned to A0 input int y;// assigned to A1 input int z; //assigned to D0 input int votes[3]={0,0,0}; void setup() { // initialize the serial communication Serial.begin(9600); while(!Serial); } void loop() { // first we need to read the values from the BUTTONS x = digitalRead(A0); y = digitalRead(A1); z = digitalRead(0); if

Connecting Sparkfun ESP8266 Thing to Azure IoT Hub

不想你离开。 提交于 2019-12-13 02:47:06
问题 I am currently trying to connect my Sparkfun ESP8266 Thing to my Azure IoT Hub. I have successfully set up my hub, and am following this tutorial on how to connect the Thing to my Azure IoT Hub: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-sparkfun-esp8266-thing-dev-get-started Unfortunately I keep getting the error: 'StaticJsonBuffer' was not declared in this scope Arduino: 1.8.5 (Windows 10), Board: "SparkFun ESP8266 Thing, 80 MHz, 512K (no SPIFFS), v2 Lower Memory, Disabled, None