All Questions
Tagged with coding or programming
1,680 questions
1
vote
1
answer
104
views
Receiving incorrect Data through CANbus MCP2515, Nano to Nano - Data points 3, 5, and 7 only go to 7 bits instead of 8?
We are trying to get two Nanos to communicate via CANbus, using MCP2515 shields. I have decided to use the autowp/arduino-mcp2515 CAN interface library for the code. I've based my code off their ...
1
vote
1
answer
96
views
Reading JSON from Arduino via Serial Missing Parts of Message
I have a project (Digital Dashboard for a Motorhome) in Pi that reads JSON data from an Arduino board and sends it via Serial.
The Pi gets the JSON data, makes some adjustments and then sends it to an ...
0
votes
2
answers
190
views
How do I read data from a 32 bit I2C register address?
I'm having trouble reading the I2C data from the CPS8200, that has a 32 bit Register Address. Since I'm not too familiar with I2C register addresses more than 8 bits, and right now I'm not sure if I'm ...
1
vote
1
answer
57
views
When I run my for loop the serial monitor is giving very strange results
This is unfinished code for driving a 4 digit 7 segment display. When I run my data function that should output the data to send to the shift register, I get a very weird output.
0 00111111
1 00111111
...
0
votes
1
answer
90
views
`sprintf` of %04d and %03x at the same time on Arduino
I have this code, work fine!
uint32_t id , id2;
char s[64]; // Should be enough
...
id2 = id = CAN.getCanId();
sprintf (s, "%04d : ", id ); // !!! HERE !!!
Serial.print(s);
the ...
3
votes
1
answer
107
views
Using a while loop in setup function to read sensor data
I have an Arduino vehicle and I upload projects to it that I want them to function once I use a strong light on a light sensor attached to A4 analog pin. So far, I have used the following code:
void ...
0
votes
0
answers
147
views
Initializing both I2C devices of a RP2040 Rpi Pico with Earle Philhower Core
I'm using the Arduino IDE (v1.8.19) with the Earle Philhower core to program a Raspberry Pi Pico (RP2040) board.
I2C bus 0 of the Pico (pins 4 (SDA) and 5 (SCL) are coupled to a first MCP23017 port ...
0
votes
1
answer
265
views
Questions about ATMega8A including burning my hex files
I wrote a small blink program for an ATMega8U-DIP I bought recently. The source is this,
#ifndef F_CPU
#define F_CPU 16000000
#endif
#include <avr/io.h>
#include <util/delay.h>
int main(...
-1
votes
2
answers
508
views
Open drain without pull-up
Looks like I didn't make myself clear, sorry. Update to clarify things / TL;DR version:
4 Arduino UNO pins are connected to respective DE-9 pins, responsible for UP, DOWN, LEFT, RIGHT directions
...
-2
votes
1
answer
181
views
Controlling Vintage floppy drives
After researching a solution to a problem I want to solve, I'm hoping the third time posting is a charm. :)
I'd like to use an Arduino to control a vintage floppy disk drive. I'm looking to use it as ...
1
vote
2
answers
148
views
Multiple threshold crossings trigger multiple LEDs - but only one at a time
I'm calculating the acceleration magnitude vector from an accelerometer inside a thick PU mat. When the mat is hit, depending on the value I obtain, only one of two LEDs, later more, shall light up ...
2
votes
1
answer
115
views
Code for a load cycler seems to be stuck
I am trying to make a battery load cycler to charge and discharge a battery repeatedly for a certain amount of cycles and here is my code:
bool in_charge_mode;
int cycles = 0;
float cutoffvoltage = 2....
2
votes
0
answers
129
views
My code got my Nano ESP32 into a <500ms reboot loop
I have done a lot of reading and learning after previous help here and it has been great.
I have uploaded and tried many iterations of my code which all worked (Assuming my code was actually good) and ...
0
votes
1
answer
151
views
Programmer vs target clock frequency
I have a 16u2 programming a 1284P for a custom board I am building. The 16u2 converts USB to USART for programming the 1284P, however the 16u2 has a maximum frequency of 16MHZ while the 1284P has a ...
1
vote
0
answers
98
views
Weird issue with wire.requestfrom() and MailClient.sendMail() on ESP32- rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
Update_2: No change after Update_1, same error. I still have to comment either email, I2C, or Temperature out, that the other two can work.
Update_1: I'm also using a DS18B20 with #include <...
1
vote
3
answers
945
views
Serial.println printing just after the previous string in same line
I wrote serial.println in my code but the string was printed in same line on serial moniter.
#include <WiFi.h>//for connecting esp32 to a wifi
#include <TinyGPS++.h>//to obtain gps data ...
0
votes
1
answer
96
views
ATtiny25 - assembly - BOD disable for sleep mode - error [closed]
If I understood the AVR instruction manual correctly, the ATtiny 25 can disable the BODlevel2 fuse by software, but when compiling with Studio 7 (version 7.0.132), I get the error "Undefined ...
1
vote
1
answer
266
views
Make two LEDs fade in and out with with different PWM values
I have two UV leds, one Vf 3.3V @ 150 mA and the second one Vf 5V @ 150 mA. I need a circuit to make them fade in and out alternatively, i.e., as one goes dimmer the other goes brighter and vice versa....
4
votes
2
answers
351
views
"if" condition problem / question
I'm new to Arduino and my question is rather theoretical. I have an Arduino Nano board (Atmega168 processor), a button, a display. I have written a button handler that does not stop code execution. My ...
0
votes
0
answers
288
views
Unable to program with AVR ISP mkII under Linux
I just got an AVR ASP mkII external programmer and I am unsuccessfully trying to program my arduino with it.
All the settings in the IDE are correct. This is the error message that I am getting:
...
2
votes
1
answer
311
views
Read values from a txt file on an SD card
I'm trying to read a text file (has numeric values) from SD card. The values in the file like this
87 512
255
I need to read 87 in ch1 and 512 in ch2 and 255 in ch3.
Why did I get on 'SKIP_NONE' '...
1
vote
1
answer
308
views
ArduinoJson reading `null` from Serial
I have a setup that reads from serial when I sense that there is something to be read (and always assume that what is sent to the arduino is valid json):
void setup(){
Serial.begin(9600);
...
-1
votes
1
answer
559
views
SPI with DMA in a Arduino Due
I have a project where I need to store data (~16 Mo) on a memory and be able to fetch the data fast (<36000 bits/s) with DMA because I have other signals to take care of.
Currently I use an SD card ...
1
vote
1
answer
183
views
Programming barebones ATMega328 with external programmer and no bootloader
I have created a circuit with a barebones ATMega328.
I also have an external programmer (Sparkfun's Pocket AVR Programmer)...
Now I want to program a particular sketch... When uploading a sketch, do i ...
0
votes
2
answers
216
views
How much readable text can fit inside an ATTINY85? Feasibility of scrolling a booklet on a 0.91-inch OLED display
I'm a total beginner, so I've been talking with Chatgpt regarding the capabilities of the Attiny85 microcontroller. But the AI would hallucinate a lot and give only partially right answers (because it ...