Questions tagged [programming]

The process of designing and writing source code as part of a program (or sketch) for Arduino. For questions about uploading code to an Arduino board, use the [uploading] tag instead.

Filter by
Sorted by
Tagged with
0
votes
1answer
21 views

About ATTINY85 Development Board

I am thinking to buy one of "ATTINY85 Development Board"... Before buying I was checking details/Advantages of it. First I thought this is just a breakout board & USB for power. But, then found ...
-1
votes
0answers
13 views

Need support/help on writing a code for v1 adafruit board for 3 12 volt dc motors [duplicate]

My project is that I am building an animated (singing, dancing, head turning, and arm waving) snowman. I have 3 DC motors for individual functions that are to be run via Arduino Adafruit V1 card ...
-4
votes
0answers
40 views

How to program in a auino uno if buton presed then in werijable add one [closed]

How to program in a auino uno if buton presed or holding then in werijable add one.
0
votes
1answer
31 views

Matrix and State Space Arduino Implementation

I wrote an Arduino Matrix class. Then I used this class to implement State Space on Arduino. During tests I stomped upon a problem. After starting the program it stops at some point. I have no idea ...
1
vote
2answers
53 views

Bike Gear Indicator Coding Problem

Lack of practice I forgot many function of C & C++... Can anyone help me with this coding Please... I think this is The Main coding: Topic: Gear indicator I first found this, Gear_Indicator_Raw ...
0
votes
1answer
22 views

what is causing my esp8266 setup function to reinitialise?

Here is code I have written: #include <stdio.h> #include <ESP8266WebServer.h> #define MAX_WIFI_INIT_RETRY 50 #define WIFI_RETRY_DELAY 500 const char* wifi_ssid = "ssid"; const char* ...
0
votes
1answer
29 views

Getting error invalid conversion from 'const char*' to 'const uint8_t*

I have written this sketch, and I am trying to populate the array of wifi hotspots to set the value in html select using javascript dynamically. #include <Arduino.h> #include <Hash.h> #...
0
votes
1answer
24 views

trying to make wemos d1 code modular causes collect2: error: ld returned 1 exit status exit status 1

#include "connection.h" void setup() { Serial.begin(115200); Funcs::Connect conn; conn.connectWifi(); } void loop() { } then connection.h file: // connection.h namespace Funcs { class ...
0
votes
1answer
39 views

Arduino Project Interrupt Error?

I have a project to be made i.e. water Billing System using RFID(Mfrc522) on Arduino NANO. There is one difficulty that I haven't been able to overcome. I hope someone could help me out. Project flow: ...
0
votes
0answers
29 views

combinate two codes [duplicate]

i am trying to put these two codes together someone would be so kind to help me. ""#include const int photores = A0; // Photo resistor input const int pot = A1; // Potentiometer input const int led =...
0
votes
0answers
30 views

Need help Coding Adafruit v1 motor shield for 3 DC motors [duplicate]

My project is that I am building an animated (singing, dancing, head turning, and arm waving) snowman. I have 3 DC motors for individual functions that are to be run via Arduino Adafruit V1 card ...
0
votes
1answer
48 views

FC-16 led matrix module based on MAX7219

EDIT: const char *pc[NUM_ZONES] = { "ROOM", //0 "SUBJECT", //1 "GRADE",//2 }; I did this and I can't get them to display every row simultaneously. void loop(void) { DateTime now = rtc....
0
votes
0answers
14 views

DS3231 clock module with cascaded FC-16 led matrix modules + Arduino Nano

I am using a DS3231 real time clock module and 4 cascaded FC-16 modules(they are basically MAX7219 led matrices based modules). My goal is to display a timetable, a schedule for a classroom on the ...
0
votes
1answer
60 views

Arduino Nano, DS3231 RTC clock module and 4 cascaded FC-16 led matrix modules

Like I said in the title, I am using a DS3231 real time clock module and 4 cascaded FC-16 modules(they are basically MAX7219 led matrices based modules). My goal is to display a timetable, a schedule ...
1
vote
3answers
77 views

Writing elegant applications for Arduino

Coming from a C background, I was taught that tight loops that just burn CPU aren't desirable. Is there any programming style guides on Arduino? Is it common practice to just let loop iterate as a ...
0
votes
0answers
24 views

Modbus programming

I have a Controllino Mega running a code that rotates a stepper one revolution CW, and one revoluction CCW. I need the program to run, just when a signal is received from an HMI that I have connected ...
-2
votes
1answer
97 views

Adafruit motor shield v1 Need help Running 3 DC motors simultaneously?

My project is that I am building an animated (singing, dancing, head turning, and arm waving) snowman. I have 3 DC motors for individual functions that are to be run via Arduino Adafruit V1 card ...
0
votes
1answer
47 views

Pulse generator with varying width

I am trying to generate a square pulse with a fixed delay of 5 second between pulses and varying width of the pulse. The code I wrote so far generates a sequence of pulses every 5 seconds. Is it ...
0
votes
2answers
37 views

Turn RGB blinker via serial

I have a BLUno bluetooth arduino based on uno. the logic kind of works, I am connecting ok to the phone, getting and sending messages via blue tooth but with the serial data, Im having problems ...
0
votes
1answer
27 views

Node.js cannot recognize characters from the serial port

The following script prints everything fine, it recognizes integers from the serial port, but cannot recognize characters. The if statement does not work with characters. I have tried both == and ===...
0
votes
0answers
29 views

hello,i have an problem with my arduino with an lcd

i've totally done everything i could,but when i run my arduino uno with my 16*2 lcd (with i2c) . it has a higher brightness on the top and a lower one in the bottom. ive even tried putting example ...
0
votes
0answers
18 views

Control of 3 LEDs over Bluetooth using MIT App Inventor

As per title, I have 3 LEDs connected to an Uno. Also connected is an HC-05. edit: forgot to add a question, my bad. Is there any glaring major issues in this code that I've overlooked? Not ...
0
votes
2answers
57 views

using different variables in a function

I have a function SetTFgr (float T, int FGr) to set the time and filtergrade of my LED enlarger. It works without a problem and changes the values of T or Fgr according to the buttons I press. Both T ...
0
votes
1answer
22 views

Do Loop query not stopping

I am new to Arduino programming and I would like to ask a question. Firstly apologies if this has been answered before and I understand if it gets locked if this has been answered elsewhere. I am ...
0
votes
1answer
27 views

I keep getting this error exit status 1 expected ';' before 'DigiKeyboard'

\ here is my code include "DigiKeyboard.h" void setup() { DigiKeyboard.sendKeyStroke(0); DigiKeyboard.delay(100); DigiKeyboard.sendKeyStroke(MOD_GUI_LEFT); DigiKeyboard.delay(100); DigiKeyboard....
0
votes
1answer
26 views

Why when I pull an EEPROM index the value returned is garbage?

I have an array of colors for my tft screen: const uint16_t colorTheme [] PROGMEM = {BLACK, WHITE, NAVY, CYAN, RED, GREEN, VERDEAQ, PINK, ORANGE, PURPLE, GRAY, YELLOW}; When I try to use colorTheme [...
0
votes
1answer
26 views

How to code an arduino to execute a particular code using a slide switch

I’m pretty new to arduino. I need help concerning a project I’m making. I’m using a SPDT slide switch to switch between what code(method) should be executed.i.e when I shift the switch to the left, ...
0
votes
0answers
20 views

Simulate MPU6050

I’m not able to occur myself an MPU6050 on these circumstances, so is it possible to simulate the MPU6050 on Proteus or a similar software ?!
-1
votes
1answer
22 views

acelermetor count goes down after 1 peak

I am using a Wemos D1 Mini and an mpu 6050 accelerametor. I managed to get the acceleratmetor to work and have 1 value come out of movements. So when a peak it hit (aka, the threshold of 1.00 is hit) ...
0
votes
1answer
31 views

No Websockets Server for Arduino mkr1010?

I've seen some interesting explanations on using websocket comms on mkr 1010 but it's always handling the mkr 1010 as the client and the server being always a computer or some other "non-arduino" ...
0
votes
2answers
41 views

Possibly fried a new atmega328p?

I have a new atmega328p IC that I wanted to program. To do so I placed it into the socket of an arduino uno. I accidentally placed it the wrong way around (180° rotated), and powered it via USB and ...
0
votes
1answer
68 views

How to add a yield before else if?

So I am running my project on a NodeMCU, but I don't know how to let it add a yield in front of an else if. It will give me an error like this: Arduino:1.8.12 (Windows 10), 開發板:"NodeMCU 1.0 (ESP-...
0
votes
1answer
132 views

OTA-program SPIFFS on the ESP8266

Something I'd like information on is whether it is possible to upload a SPIFFS filesystem image to the ESP8266. In theory it might work: It can be uploaded over USB, and according to the logs the ...
0
votes
0answers
18 views

Error compile board LOLIN(WEMOS) D1 R2 & mini

I have a wemos d1 mini and a mpu 6060 sensor. I am trying to send the data from the sensor to Firebase. However i have come across a hurdle which i cant seem to solve. This is my error, can you help ...
0
votes
1answer
16 views

Update class attribute with attachInterrupt

I want to refactor this code /* YF‐ S201 Water Flow Sensor Water Flow Sensor output processed to read in litres/hour Adaptation Courtesy: www.hobbytronics.co.uk */ volatile int flow_frequency; // ...
0
votes
2answers
65 views

Programming Servo How To Get -90 Degrees

as the question title states, how will I go about turning the servo opposite of 90 degrees? I have written my code as such; // Turn servo to the right if(x > 520 && y < 510 &&...
0
votes
1answer
40 views

Why are begin() functions needed to initialize hardware (if they are)?

I'm writing a program for an ATmega microcontroller using the Arduino framework. While implementing an hardware-related class (one to manage LEDs), I put some hardware initialization code such as ...
0
votes
0answers
32 views

I'm coding 3 DC Motors to a Mega2560 Arduino (With motor sheild) and an error popped up saying DC_Motor.h:NO file or dictionary,even tho its correct? [duplicate]

heres my code reduced to minimum */ #include <DC_Motor.h> void setup() { } void loop() { } heres the error- /tmp/982713958/Animated_snowman_M1_M2_Arduino/Animated_snowman_M1_M2_Arduino.ino:...
0
votes
1answer
44 views

I have a question,an error occured in my code saying TIMSK was not declared in the scope(There are no errors)

#include <SmartInventor.h> void setup() { SmartInventor.DCMotorUse(); } void loop() { // M1, M2, M3 // CW, CCW, STOP // 0-100 // 0-360 SmartInventor.DCMotor(M1, CW, 10); delay(...
1
vote
4answers
62 views

char to String conversion in Arduino program

I have started learning about Arduino and am well versed in Java and Python. In an Arduino program, I need a character input via Serial to be stored in a String variable. From my previous programming ...
0
votes
1answer
36 views

Problem with if condition

So my project is including detecting the temperature in the room by using dth11 sensor. my idea is to add 3 LED lights were each light represent the temperature if its cold or hot or perfect. the ...
-2
votes
1answer
43 views

the boxservo works contrary to the code

i want to make a uselessbox .i connected the circuit correctly,i checked every thing several times and every thing is in right place[ based on descriptions and pattern],but when i turn it on,the ...
0
votes
2answers
41 views

Programming pic microchip

I have a few pic chips, mainly pic16f72 and pic16f73 on old ups circuits, realized they are not that bad. Their adc capabilities are my point of focus. I have an esp32 (my first mcu) and i am very ...
0
votes
1answer
70 views

when i finished coding my 3 dc motors, all these errors accrued one said stray '/302' in the program [closed]

/* #include <SmartInventor.h> */ void setup() { SmartInventor.DCMotor(); } void loop() { // M1, M2, M3 // CW, CCW, STOP // 0-100 // 0-360 SmartInventor.DCMotor(M1, CW, 10, 45°);...
1
vote
0answers
48 views

How to get my LCD contentiously updating with data from sensor?

EDIT DOWNSTAIRS: Hello beautiful people of the internet! How are you smart people doing with all that's going on these days. Okay so the title says it pretty much. I've got a code and inside of my if'...
0
votes
1answer
40 views

Interrupts inside a class attaching to the function of the class

Hello i have a class and i would like to attach an interrupt inside the class and attach it to a function of the class. class counter{ public: counter(int pin){ Ipin=pin; } void ...
0
votes
1answer
124 views

Binary to decimal using bitwise operators

I am trying to convert some binary data to decimal numbers. I succeeded to convert binary to hex, but now I want to do the same with binary to decimal. I want to use bitwise operators and NO array. ...
0
votes
1answer
45 views

connected between 2 arduino

i want to connect SPI 2 arduino master and slave through the MUX , to write and read in external memory , when the master write in memory slave read . pls help . code to master #include <SPI.h&...
0
votes
0answers
67 views

With what can I replace this for loop so my Arduino doesn't spit jibberish?

I have this: for (int i = 0; i < (DELAY_SIZE - 1); i++) { if (check_tag_in_char(delay_chars[i], BOOK_UPLOAD_END_TAG)) { tag_pos = 0; Serial.println("Uploaded"); ...
-1
votes
1answer
40 views

Serial.print array displays nothing

I tried Serial.print an array I had made, but the Arduino displays nothing in the monitor. I tried doing Serial.print("Hehehe"); as a test, but it just displayed "h?h?h?". The monitor works fine ...

1
2 3 4 5
29