#help-with-arduino

1 messages · Page 19 of 1

tepid crow
#

Can someone please help with the second question?

north stream
#

Chances are, they published both libraries

tepid crow
#

Can you please show me where did they publish the other library?

sage lichen
tepid crow
#

I don't think that's what they do in the demonstration video. UPDI must use hardware serial. And Arduino Uno only has 1 Serial interface so I agree that the only way to read serial message in Arduino IDE is using another software serial interface. However, how can they wire this software serial back to the USB cable so that IDE can read? I don't think the shield in the video can do that

#

Also, from the source code, they use Serial for serial monitor, and Serial1 for UPDI, and the Arduino Uno is used in the video. I'm really confused like how can they make it work unless they secretly modified the code from the library and didn't even publish that code after all

sage lichen
tepid crow
#

But in Arduino, when I compile it doesn't recognize Serial1

sage lichen
#

All that SoftwareSerial allows you to do is turn any pair of pins into a serial port

tepid crow
#

I'm using Arduino Uno the official board

sage lichen
#

So really SoftwareSerial is probably just the simplest way to go

tepid crow
#

I'm trying to make their original code work with minimal modification first

#

Or the board in the video isn't an Arduino Uno after all?

sage lichen
#

Can you link me to the video?

tepid crow
#

I wish they can give more detail about the hardware and the schematic

sage lichen
#

I may be wrong but I think thats a mega

tepid crow
#

I actually having both Mega and Uno on my hand right now and the ratio between width and length makes me think it's Uno and not a Mega

#

Also the size compared to her finger

#

And usually the Mega has a third row of header on the opposite end of USB cable

sage lichen
#

Heres a minimal example of SoftwareSerial. It'll almost certainly fix what you're running into, you just need to add SoftwareSerial Serial1(RX_PIN, TX_PIN); to the top of your code to define Serial1

#include <SoftwareSerial.h>

// Define the RX and TX pins for SoftwareSerial
#define RX_PIN 10
#define TX_PIN 11

// Create a SoftwareSerial object
SoftwareSerial Serial1(RX_PIN, TX_PIN);

void setup() {
  // Start the hardware serial port (connected to USB)
  Serial.begin(9600);
  
  // Start the software serial port
  Serial1.begin(9600);

  // Print to the hardware serial port
  Serial.println("Hello from hardware serial!");

  // Print to the software serial port
  Serial1.println("Hello from software serial!");
}

void loop() {
  // Read from the hardware serial and send to the software serial
  if (Serial.available()) {
    char c = Serial.read();
    Serial1.write(c);
  }

  // Read from the software serial and send to the hardware serial
  if (Serial1.available()) {
    char c = Serial1.read();
    Serial.write(c);
  }
}
#

And then RX_PIN and TX_PIN are just the pins that you want to use serial on

#

Allows you to use pretty much any pins

tepid crow
#

Thank you but I still don't understand why they publish a code that doesn't work

sage lichen
#

Again, most likely just a slightly different processor which has multiple hardware serial ports or something. Very hard to publish something that works on multiple different embedded devices so its expected to run into issues like this sometimes

#

Welcome to embedded haha 🙂

tepid crow
#

Yeah I agree. I mean it was a bad job on the library owner to public any kind of library without specifying the board it is supposed to be used with, causing unneccessary confusion for user 🙂

eternal cloud
tepid crow
# eternal cloud Ladyada clearly specifies in the video that the code is running on a Metro M0 bo...

I didn't know about the existence of Metro M0 board, and she speaks that part too fast, so I don't think anyone without knowing about this board can understand what board she said. And if you said Adafruit publishes everything, then at least on the video page of Adafruit, or library owner must provide a link to the M0 board, or similar project, or the original project that use Arduino as AVR programmer

quick violet
#

😮

eternal cloud
tepid crow
#

Hmm, I thought this library belongs to Adafruit?

#

Just like any other Adafruit libraries, they were very well documented so I expect this is the same

eternal cloud
#

Again, this is not a library. It's the code they used to program a tester / flasher for their own hardware.

#

They give it away for free, because that's what they do.

tepid crow
#

My bad. I thought they sold the shield and the Metro M0, and this library is companion library

eternal cloud
#

The Metro M0 is for sale.
The shield used in the video is not for sale, it's a tester they use internally... but most likely the HW schematic is published somewhere, so you could make your own.

tepid crow
#

Yes. I indeed tried searching for the shield schematic but came to a dead end

eternal cloud
tepid crow
#

I actually can build my own PCB. I just want to know the schematic of everything used in the video but I guess it isn't available online

tepid crow
#

Can someone please help me understand how the programming fuse, normal fuse and fuse verify mask work? This snippet is from images.cpp of an example from the library Adafruit_AVRProg

    // zero are untouched.
    {0x00, 0x00, 0x00, 0x00}, // {lock, low, high, extended}
    
    // Normal fuses, written after writing to flash (but before
    // verifying). Fuses set to zero are untouched.
    {0x00, 0x0, 0x0, 0x0}, // {lock, low, high, extended}
    
    // Fuse verify mask. Any bits set to zero in these values are
    // ignored while verifying the fuses after writing them. All (and
    // only) bits that are unused for this atmega chip should be zero
    // here.
    {0x3F, 0xFF, 0xFF, 0x07}, // {lock, low, high, extended}```

When I checked in Microchip Studio, Attiny816 has 8 bytes of fuse, which are the same amount with programming fuse and normal fuse. But how do I know which one is programming fuse, which one is normal fuse?
north stream
#

That's a little confusing. Perhaps it's the same fuses, but some bits are written before programming (to set up the chip to make it programmable, for example), and some of them are written after programming (to configure features the software uses when it's running, security bits, etc.) So I'm guessing it writes them twice, with different values (fuses only go one way, you can set them to 1 but not back to 0 without erasing everything, so effectively the values are OR-ed)

tepid crow
#

Thank you. If I understand correctly, the definition of lock/low/high/extended fuse bit isn't applicable for ATtiny816. And since in the example code, they didn't modify the fuse so it was an issue. But I think the correct code should be 8 bytes for programming fuse, 8 bytes for normal fuses an 8 bytes for fuse mask?

#

And can I assume the programming order for these fuse is from low index to high index?

north stream
#

Doesn't look like it...

#

Er, programming order might be, but the list you posted above is not in order

tepid crow
#

So I think there are 9 bytes in total for fuse, including 1 byte for lockbit?

tepid crow
tepid sail
#

hello, Is it really possible to connect with 3.5 inch SPI TFT(ILI9488) with ESP8266 ?
i've searched and tries many way ... until i see SMOKE, i don't which part is smoking (either ESP8266 or the screen) but both at least still functioning (?). I panicked and quickly unplugged the power
I seem can't put a text and color to the screen
even, i dont know if it still usable just because it still turn on.
I've come here to search for rescue 😅

My Pinout From Screen -> ESP / Power Supply
VCC -> 5V
Gnd -> GND
CS -> D1
RST -> D2
DC -> D3
MOSI -> HMOSI (D7)
SCK -> HSCLK (D5)
LED -> 3.3 V
MISO -> HMISO (D6)

Any idea or help is very gratefull. Sincere from bottom of my heart 🥹

north stream
#

Some TFTs don't have a backlight current limiting resistor, so hooking the LED directly to power would be bad on those units.

obsidian knoll
#

c++ question

I have a class that controls a motor driver. it has a function TB6612FNG::SetSpeed that takes an int as input

#

I have another class that does closed loop control of a motorized potentiometer. you tell it an ADC pin and some other info and it calculates a speed

#

I want to pass that class a function when I set it up - so like

MotorizedPotentiometer motorPot(28, motorDriver.setSpeed(speed))
#

how I'm doing it right now is like this:

MotorizedPotentiometer::MotorizedPotentiometer(uint adcPin, std::function<void(int)> callback, int minSpeed, int maxSpeed)

and then I call the callback like

callback(speed);

here's where I set up the object in my main code:

    MotorizedPotentiometer motorPot(
        28, // ADC Pin
        [&](int speed)
        { motorDriver.setSpeed(speed); },
        -100, // Min Speed
        100   // Max Speed

This works, but I don't know why, or if it is a good solution. What is the "best" way to do this?

north stream
#

I suppose it depends on what you mean by "best". You could use PID, but that can be complicated.

clear spear
#

I am using an esp32-s3 Reverse TFT Feather and there is something wrong with the serial monitor. I get these messages: 
[0;32mI (612) esp_image: segment 0: paddr=00010020 vaddr=3c0a00I (650) esp_image: segment 3: paddr=00040020 vaddr=42000020 size=972f8h (619256) map
I (748) esp_image: segment 4: paddr=000d7320 vaddr=40379b60 size=0a878h ( 43128) load
I (764) boot: Loaded app from partition at offset 0x10000
I (764) boot: Disabling RNG early entropy source...
E (783) esp_core_dump_flash: No core dump partition found!
E (783) esp_core_dump_flash: No core dump partition found!

#

And then nothing else

stable forge
clear spear
#

im using the adafruitio_13_rgb.ino from the adafruit IO library. I want to change the screen color with the value i get from the feed:

...
Serial.println(data->value());
display.fillScreen(data->value());

Since i cant print out the received value in the serial monitor (see above) i cant see the format of what i receive; data->value()

must i do some conversion? like:

  
  uint16_t IOColor = strtol(data->value().c_str(), NULL, 16);

or

  uint16_t IOColor = (uint48_t)data->value();

?

stable forge
clear spear
timid helm
#

Hi guys, programming ESP32 C3 Supermini in Arduino IDE and getting a Guru Meditation Error: Core 0 Panic'ed (Interrupt wdt timeout on CPU0) error.
In general what should I be looking for?
The interrupt code is fairly short, around 10 lines, only calling Serial.println inside of it, other than that, just basic operations.

#

Other diagnostics writeouts suggest that the error occurs outside of the interrupt routine, because some serial text is interrupted by the error which is written outside the interrupt code.

north stream
#

I'd look for things the interrupt routine modifies that are not declared as volatile, wild pointers, divide by zero, etc.

timid helm
quartz furnace
#

looking for help with the RP2040 using Arduino …. i have a sketch that controls a SMS module to send text messages…. i’ve gotten it to work with an ESP32 .. just don’t understand the pins on RP2040 to connect to the module ?

https://github.com/adafruit/Adafruit-Feather-RP2040-RFM-PCB/blob/main/Adafruit Feather RP2040 RFM69 Pinout.pdf

GitHub

EagleCAD PCB files for the Adafruit Feather RP2040 RFM69 and RFM9x boards - adafruit/Adafruit-Feather-RP2040-RFM-PCB

#

and then the 2nd question is .. i need Serial for printing to the serial monitor .. would it be Serial1 or Serial2 for setting up pins for the module to get TX/RX ?

#

apparently there are three sets of TX/RX-1 ?

#

is there a default set?

modern dawn
quartz furnace
#

update —- i figured it out Serial1 prints to pins marked with tx/rx-0 was thinking it would be a matching “1”
assignment

north stream
#

Many chips have built-in USB serial, and Arduino maps that to Serial, so the first UART becomes Serial1

timid helm
#

Question:
I use two ESP32 C3 Superminis with ESP NOW, specifically one master and one slave.
When they're both connected to the PC with their respective USB cable, sending data works. When one is powered by a battery, it doesn't work (other code works ok tho).
I'm sure there's some analog wizardry or other error 40 reason for this, anyone got some ideas what might be up?

north stream
#

If the code tries to use the USB serial port, it can hang trying to open it when USB isn't connected.

timid helm
#

Is it necessary to force the WiFi channel to be the same on both boards?

tender wasp
#

could the battery be too small to supply the current spike on wifi transmit? does it work when one is battery-powered and one is on USB? or the reverse? or perhaps try connecting them to USB power without data, like a phone charger.

timid helm
timid helm
#

Hmm, when I connect the ground planes with a single wire, it works.

spiral carbon
drowsy ore
cloud rain
stable forge
drowsy ore
stable forge
golden gulch
#

Hello i joined this discord today, i need some help in Arduino and LCD, i have "DC 3.3V 1.28 Inch TFT LCD Display Module Round RGB 240 * 240 GC9A01 Driver 4 Wire SPI Interface 240x240 PCB for Arduino" and i want to code this with Arduino uno r3 or Arduino Mega , i found some library of adafruit and nothing worked for me. I need a round LCD that i can code with Arduino uno R3 and i also need a working library. pleaseany help is really appriciate. i can buy new LCD if the above LCD is not the coerrect choice

north stream
# golden gulch Hello i joined this discord today, i need some help in Arduino and LCD, i have "...

I'm not sure which display you're using (I see several round ones of 2.1, 2.8, and 4"), but I suspect that such displays don't work with an Arduino Uno. The product description points out "The SPI is only for configuring the display - you cannot draw pixels over SPI!", as well as "To make stuff light up you'll need a chip that can perform TTL RGB TFT driving, which means a powerful microcontroller such as the ESP32-S3 with octal PSRAM" and "You cannot use these with an every day microcontroller unless it specifically has support for RGB-666 displays"

golden gulch
north stream
#

Do you have a link to the specific display you have?

golden gulch
eternal cloud
golden gulch
#

i tried that and it did not work , please recommend something i can buy

north stream
#

When you say "it did not work", what happened? Did it compile? Did it run?

#

Note that many of those displays are 3.3V only, hooking them to a 5V Arduino could destroy them

golden gulch
#

so it complied but there was no display on the screen ,

#

we connect with 3.3 v

north stream
#

What did you get on the serial monitor?

#

Which code are you running? Graphicstest?

left mauve
#

what speaker amplifier does the adafruit pygamer use

#

I can't play sounds on it with arduino

#

and I'm trying to find another library

eternal cloud
left mauve
#

I know, but I just want to play audio samples, not from files

eternal cloud
left mauve
#

thanks

#

I also found something in the full boards test

#

it plays an audio file but the audio file is just a header file full of audio samples

#

maybe I can use that

left mauve
eternal cloud
left mauve
#

ok thanks

merry kettle
#

I have an esp32 that I want to use to control my usongshine tb6600 stepper driver, but the 3.3v gpio pins are inadequate to trigger the driver it seems. I was wondering if I could use my PCA9685 (which as far as I can tell, has 5v signal pins) as gpio pins to control the stepper?

sand escarp
#

Anyone have any advice for troubleshooting a failure to connect via SSL using wifi101? I'm on a Feather M0 and can't for the life of me get this thing to work. I updated root certificates and have gotten other websites to connect. Meanwhile I also tried using an old RootCertificates library to see if I could even download the certificate directly but even that wouldn't work. I'm assuming the site (https://bustime.norta.com) is just rejecting the connection outright for some reason?

sand escarp
#

Update: Nothing to do with SSL, everything to do with the fact that I can't even get the Arduino to ping the server. It seems like connecting to literally anything other than https://bustime.norta.com will not work. That includes the IP address.

#

Guess it's time to figure out a reverse proxy unless anyone else has any ideas

north stream
wintry tartan
#

Hey all, I'm trying to get blinkenlights working on my CH552 QT Py and I'm getting the following error when attempting to upload the sketch to the device:

Sketch uses 4838 bytes (33%) of program storage space. Maximum is 14336 bytes.
Global variables use 104 bytes (11%) of dynamic memory, leaving 772 bytes for local variables. Maximum is 876 bytes.
Cannot perform port reset: TOUCH: error during reset: setting DTR to OFF: cannot send after transport endpoint shutdown
------------------------------------------------------------------
CH55x Programmer by Deqing
Updated on: 2023/10/10
------------------------------------------------------------------
usbRertySeconds 2
target: CH552
config bytes: 3
Load file as hex
   Loaded 4760 bytes between: 0000 to 12E5
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
Found no CH55x USB
Time limit reached, exit process
Failed uploading: uploading error: exit status 1

I followed the instructions on the learn guide and my board is recognized by my PC

#

I tried uploading the code in bootloader mode as well, but the same error comes up.

#

I tried on my Windows laptop as well to the same results.

#

On Linux, I was able to fix the issue by performing the following steps:
1.) cd /etc/udev/rules.d
2.) sudo touch 99.ch55xbl.rules
3.) sudo vi 99.ch55xbl.rules
4.) copy and pasting the following into the file:

# CH55x bootloader
# copy to /etc/udev/rules.d/

SUBSYSTEM=="usb", ATTRS{idVendor}=="4348", ATTRS{idProduct}=="55e0", MODE="0666"

5.) save the changes and quit.
6.) reboot

quaint nebula
#

You guys know any good alternatives to the powerboost 500-1000 for arduino

#

Cause I need something to power my nano with a lithium battery

eternal cloud
quaint nebula
#

Adafruit stuff tends to be pricy for my liking and I need multiple

north stream
#

You may not need to boost the voltage to power the nano, as a lithium cell is generally enough voltage to supply a 3.3V LDO regulator.

quaint nebula
#

But there’s no ports to plug into the nano with a lithum cell

umbral depot
#

So, I'm trying to do some stuff with a random TFT/SPI board connected to a Pi Pico using the Arduino C++ environment and the Adafruit ILI9341 library.

I've got it working, as long as I initialize it using the full set of argument:
tft = new Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
I think this is using a bit-bang SPI implementation, instead of the onboard hardware. I'm not super concerned about that except that the refresh rate is super-duper slow. Like, takes a second or more to clear a 320x240 display.

I'm not sure if it is slow because of the SPI implementation or if that's a red herring. I've tried specifying just the CS and DC lines in the constructor, which I think is supposed to use hardware SPI, although I'm not sure if that's expected to work on the RP2040, although I'm pretty sure the pins I'm using correspond to the default SPI, and in that mode I can see MOSI doing stuff in my logic analyzer. I just see nothing coming back from the display during the initialization, and I don't see anything on the display.

So I guess my questions are:

  1. What kind of performance should I expect from this display, anyway. I didn't expect buttery-smooth 160fps, but this seems really slow.
  2. How likely is it that my slowness is caused by the SPI protocol, vs something else?
  3. Anything I can do to make things faster? Tunable parameters? Make hardware SPI work?
  4. Is it because I'm clearing the whole screen? Should I just bite the bullet and be smart enough to only clear and refresh the part of the screen containing new data? Any double-buffering libraries out there?
#

Hmm. Looks like a quick implementation of #4 was not so terrible and is super-faster, so maybe that's the way I should do things. Or find a higher-level graphics lib (or learn how to use the one I have, which I've spent like 20 minutes learning, I guess.)

eternal cloud
# umbral depot So, I'm trying to do some stuff with a random TFT/SPI board connected to a Pi Pi...

I'm pretty sure the pins I'm using correspond to the default SPI
You can check here if you do use the default SPI pins
https://github.com/earlephilhower/arduino-pico/blob/master/variants/rpipico/pins_arduino.h

The HW implementation call requires 3 parameters, CS, DC **and ** RST
https://github.com/adafruit/Adafruit_ILI9341/blob/master/Adafruit_ILI9341.cpp

/**************************************************************************/
/*!
    @brief  Instantiate Adafruit ILI9341 driver with hardware SPI using the
            default SPI peripheral.
    @param  cs   Chip select pin # (OK to pass -1 if CS tied to GND).
    @param  dc   Data/Command pin # (required).
    @param  rst  Reset pin # (optional, pass -1 if unused).
*/
/**************************************************************************/
Adafruit_ILI9341::Adafruit_ILI9341(int8_t cs, int8_t dc, int8_t rst)
    : Adafruit_SPITFT(ILI9341_TFTWIDTH, ILI9341_TFTHEIGHT, cs, dc, rst) {}

I just see nothing coming back from the display during the initialization
The display is write only, it doesn't send anything back to microcontroller

umbral depot
#

Huh, ok, I'll take a look at the instantiation, then, I don't think I was including RST -- thanks!

The demo/benchmark includes this code, which would seem to indicate that there's a way to read:

  Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
  x = tft->readcommand8(ILI9341_RDMADCTL);
  Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);
  x = tft->readcommand8(ILI9341_RDPIXFMT);
  Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);
  x = tft->readcommand8(ILI9341_RDIMGFMT);
  Serial.print("Image Format: 0x"); Serial.println(x, HEX);
  x = tft->readcommand8(ILI9341_RDSELFDIAG);
  Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX);

I also assume that the graphics libraries are finding the screen dimensions somehow because I'm not telling it. 🙂
(oh, nevermind, finally looked at the datasheet: the ILI9341 only supports 320x240)

#

Nice! Yeah, that seems to make it work in hardware mode, and also seems much faster for clearing the entire screen (although I should probably make the graphics bits more efficient). Thanks!

sand escarp
#

I was just able to connect to the site on a borrowed ESP32 board with a hardcoded cert.

north stream
livid osprey
#

If you don’t need the boost converter, https://www.adafruit.com/product/5397 might do the job. I’d personally pair them with some Schottky diodes to connect to the 5v bus and divide the clock by 2 to keep it within the 328p specification at the lower voltage.

spice jungle
#

Adafruit feather M0 bluefruit LE.. What a mouthfull. How does one specify serial in/out pins? I'd like to do IDE 11 - TX and IDE 10 - RX

#

S1.0 & S1.2 and I have no idea what this notation is trying to tell me.

#

Or how it would map to my c++ world.

woven lintel
north stream
north stream
woven lintel
#

My problem is getting output in minutes and seconds to display in print()

north stream
#

Ah, it's more of a formatting problem than a display problem. I guess with a 4-digit display, the maximum would be 59:59, which would be a count of 3599. To display the minutes digits, divide by 60, to display the seconds digits, modulo 60.

modern dawn
#

In python, divmod 60 give both minutes and seconds.
minutes, seconds = divmod(361,60)
print(f'{minutes:02}:{seconds:02}')
06:01

north stream
#

True, but since this is the Arduino channel, I was thinking C-like approaches

modern dawn
#

printf can do equivalent output after integer division and mod

#

maybe mix with sprintf to preformat

spice jungle
#

Does this look right? Is there an example I can look at? Do I need to check my wiring?

spice jungle
#

Wait, am I supposed to use IDE-pin0 & IDE-pin1? For a hardware serial that is NOT USB debugging?

bronze mica
#

Hopefully quick question for ya folks: I have a Grand Central Express board using the SAMD51P20. I would like to use a SAME54P20 for its ethernet capabilities. Will the arduino library for the D51 work for the E54? They have the same pinout, and even share a datasheet, with the difference seemingly coming down to the E54 having ethernet capabilities where the D51 doesn't

north stream
#

You could try compiling it and see if there are errors as a first test. If it won't even compile, you have some work ahead of you. If it compiles, it may work the way you want (but no guarantees)

bronze mica
#

Gotcha, thanks. I was hoping to see if someone knew before buying the chip, but what do ya do. Looks like I'd have to get another chip to make the ethernet work with the E54 anyway, so I'll probably just end up using something like a WIZ5500 breakout board and call it a day 😂

stable forge
terse smelt
#

Is there a library for the Feather RP2040 with USB Host board so I can read from a USB Xinput controller? I'm hoping to translate inputs from a logitech steering wheel to a nintendo controller.

lunar lintel
#

im having a little problem with a arduino uno rev 2 wifi and arduino io comunication, the arduino is reciving this response, can someone help? Conectando ao Wi-Fi... Conectado!
Status: 200
Response:C�/���:"0FPB9XMKVFMBXD4Q90DSFT86DF","value":"1013.25","feed_id":2
885374,"feed_key":"pressure","created_at":"2024-09-11T16:48:09Z"
,"created_epoch":1726073289,"expiration":"2024-10-11T16:48:09Z"}

Response Body (raw):
{"id":"0FPB9XMKVFMBXD4Q90DSFT86��b���Օ�:"1013.25","feed_id":2885374,"feed_key":"pressure","created_at":"2024-09-11T16:48:09Z","created_epoch":1726073289,"expiration":"2024-10-11T16:48:09Z"}

eternal cloud
lunar lintel
#

i was testing the comunication betwen arduino and adafruit io and the response from the server is corrupted

bronze mica
north stream
lunar lintel
north stream
#

Hmm, how did you get that text?

lunar lintel
lunar lintel
# north stream Hmm, how did you get that text?

void sendDataToAdafruitIO(float value) {
String path = "/api/v2/" + String(ioUsername) + "/feeds/pressure/data?x-aio-key=" + String(ioKey);
String jsonPayload = "{"value": " + String(value) + "}";

client.beginRequest();
client.post(path);
client.sendHeader("Content-Type", "application/json");
client.sendHeader("Content-Length", jsonPayload.length());
client.beginBody();
client.print(jsonPayload);
client.endRequest();

int statusCode = client.responseStatusCode();
String response = client.responseBody();

Serial.print("Status: ");
Serial.println(statusCode);

// Imprimir resposta em partes
Serial.println("Response:");
for (int i = 0; i < response.length(); i++) {
Serial.print(response[i]);
if (i % 64 == 63) { // Ajuste o número conforme necessário para o seu monitor serial
Serial.println();
}
}

// Exibir a resposta completa para diagnóstico
Serial.println("\nResponse Body (raw):");
Serial.println(response);
}

livid osprey
woven lintel
#

btw am I the only person that uses chat gpt to help write arduino code.

#

it's so amazing. It almost feels wrong.

north kelp
#

@woven lintel Ladyada did a video on this a while back. There are some really good tips in it.
https://www.youtube.com/watch?v=mQwZTo6c_yU

One of the big tasks that Ladyada still has to spend a lot of time on is writing Arduino libraries for all our devices and sensors, particularly all the I2C & SPI chips out there! These ICs use register maps and sub-byte addressing to set dozens of configurable knobs and switches, and a good driver lets folks set and get all of the noodly bits. ...

▶ Play video
livid osprey
north kelp
long fractal
#

Hi, im making a robot with the help of adafruit PCA9685 board (actually two of them with 25 servo motors in the entire body) i connected the VCC to the 3.3v and V+ to 5v of the arduino (i cannot use the extra two socket pins used to supply the servo motors because i have no access to them due to tight space, and i dont want to remove/disconnect all the pins i spent hours connecting) So my question is can i supply the servo voltage from the V+ pin using an arduino?

#

and also im trying to get it to work using the code i wrote but doesnt work at all

#
#include <Adafruit_PWMServoDriver.h>
#include <Wire.h>
Adafruit_PWMServoDriver rightpwm = Adafruit_PWMServoDriver(0x40);
Adafruit_PWMServoDriver leftpwm = Adafruit_PWMServoDriver(0x41);

void setup() {
  Serial.begin(9600);
  rightpwm.begin();
  rightpwm.setPWMFreq(50);
  leftpwm.begin();
  leftpwm.setPWMFreq(50);
}

void MoveServo(Adafruit_PWMServoDriver pwm, int channel, int startAngle, int endAngle, int duration) {
  // Define min and max pulse lengths for the servo (based on 50Hz)
  int pulseMin = 150;  // Pulse length for 30 degrees
  int pulseMax = 600;  // Pulse length for 150 degrees

  // Calculate the pulse lengths for the start and end angles
  int startPulse = map(startAngle, 30, 150, pulseMin, pulseMax);
  int endPulse = map(endAngle, 30, 150, pulseMin, pulseMax);

  // Calculate the number of steps for smooth movement
  int steps = abs(endPulse - startPulse);  // Number of steps from start to end
  int stepDelay = duration / steps;        // Delay between each step

  // Move the servo incrementally
  for (int pulse = startPulse; pulse != endPulse; pulse += (endPulse > startPulse ? 1 : -1)) {
    pwm.setPWM(channel, 0, pulse);
    delay(stepDelay);  // Wait before the next step to create smooth movement
  }
}

// Function to move servos on the right board (rightpwm) to 90 degrees with smooth motion
void position_rest() {
  int duration = 1750;  // Set duration between 1500ms to 2000ms (1.5 to 2 seconds)
  
  // Smoothly move servos on channels 1 and 2 to 90 degrees over the defined duration
  MoveServo(rightpwm, 0, 90, 90, duration);  // Move channel 1 to 90 degrees
}

This is my code that im trying to work with, i call the position_rest using a serial.readString function but the servo never moves, i see the lights glowing on the two boards, and i know they both work due to the test i did before putting them all together. Is it the power problem or the code?

eternal cloud
long fractal
eternal cloud
#

You can connect the power supply to the V+ , you don't need to use the terminal blocks

#

Just remember to also connect the ground from the power supply

long fractal
#

okay since the V+ pin can accept 5-6V max can i power that through an external powersupply (5V 2Amps)

#

sure, what about the code, is that alright?

eternal cloud
long fractal
#

oh its okay 😅 i have some doubts on my code too so i had to confirm that

eternal cloud
#

Did you try the code with just one servo?

long fractal
#

no i didnt unfortunately i forgot about that, but i did try the default example code on either of the boards before i mounted them

eternal cloud
#

It should work from the 5V pin

long fractal
#

okay ill try it from a 5V 2A power supply

eternal cloud
#

if you test with less servos, it will tell you if it's a power problem

long fractal
#

i really dont want to get myself in the pain of connecting each of the servos back again in a tight space

eternal cloud
#

you don't have to disconnect them

long fractal
#

test with less servos from the code?

#

im just trying to move channel 0 which is the first servo motor connected to the right board

eternal cloud
#

ah, gotcha

#

then try changing Vcc to 5V (that's your logic lvl on arduino, might be issues on I2C )

long fractal
#

but since all servos are connected (even tho not used in the code) wont they still draw the power just without the signal

eternal cloud
#

and the external power

long fractal
#

sure i will give it a try now

#

still nothing

#

says this but nothing actually moves

#

let me try some other code to check if its working or not

#

for some reason @eternal cloud when i connect the SCL and SDA pins to the arduino board's pin A4 and A5 it freezes my board

#

and the TX pin goes off

#

when i remove the pins it comes back to normal

eternal cloud
long fractal
#

analog pins

#

thats what im supposed to do right?

#

no?

eternal cloud
#

SCL and SDA are the I2C pins ... they need to be connected to the I2C pins on the arduino

long fractal
#

but every tutorial on youtube tells me to connect them to the A4 and A5 pins

#

look at this

#

now im trying to figure out where are the I2C pins

#

this says SDA and SCL are pins A4 and A5 tho

eternal cloud
long fractal
#

it Arduino UNO R3

#

from official arduino its not a clone or anything

eternal cloud
long fractal
#

let me try that

#

there are literally no pin out images on the R3 board, i have an old model of arduino (its a clone but its just UNO) ill try on that

eternal cloud
long fractal
#

okay wait let me try that then

#

it dims all the lights on the arduino board

#

and it freezes it

#

if i remove the SCL and SDA pins out it starts working normally

eternal cloud
#

When did it start doing this?

long fractal
#

i have no idea

#

when i tried it before it seem to work fine

#

but now

eternal cloud
#

May i please see some pics of your wiring? both the uno and the PCA9685

long fractal
#

sure hold on

#

This is frozen at the moment

#

But if I remove the SDA SCL pins

#

Starts working back

#

I can see the outputs showing up on the serial monitor with the pins removed

#

(i have removed the V+ connection to first figure out this issue, but even when that is connected the same thing happens)

#

GND -> GND
OC -> NONE (not connected)
SCL -> SCL
SDA -> SDA
VCC -> 5v
V+ -> external

i have also bridged the two boards as shown in the learn.adafruit website, with the I2C solder joints connected

eternal cloud
#

can you not take pics of the PCA9685 boards ?

long fractal
#

oh not sure u can see them in the hips of the robot fully mounted inside a 3D printed case

eternal cloud
#

Not the best idea to fully assemble a project before fully testing it 😆

#

Did you connect the ground from the external power supply?

long fractal
long fractal
#

Those two white boxes

#

Inside the joints

#

Are the two boards

#

when i reset the board it says this and stops

#

this with the pins removed

#

it starts working

long fractal
#

@eternal cloud i dismanteled everything, now its the moment i connect SCL it stops responding

surreal mist
#

Does anyone know if the neopixel lib can work with esp32s3?

north stream
long fractal
#

i removed everything

#

tried again with only one servo connected, doesnt work

#

tried with a single board (without the other one connected) that doesnt work either

north stream
#

This seems like a pretty basic problem. So you have an Arduino, and a servo board, and nothing else?

lunar lintel
red dove
#

hello guys

#

need help

#

can i use Arduino PRO-MICRO for LED

#

my LED is 5v

#

and im not sure which hole to connect to battery 5v

lunar lintel
red dove
#

im not sure which hole can i solder with 5v battery

lunar lintel
#

hmm i never worked with one of that but i will try to serch on web

pliant vale
#

I have several adafruit esp32s3 reverse tft feather boards. Things seem to work ok with the board until I plug in a SPI device into the QT port, in this case a SHT41 temp/rh sensor. Then the display backlight never turns on during a boot, it seems to boot loop 10 times, then go to safe mode. Does anyone have suggestions on what I'm doing wrong?

lunar lintel
# red dove im not sure which hole can i solder with 5v battery

Gemini told me this:To connect an Arduino Micro to a 5V battery, you'll need a few components:

1. Arduino Micro: This is the microcontroller board you'll be using.

2. 5V Battery: This is the power source for your Arduino.

3. Battery Holder: This will securely hold the battery in place.

4. Wires: These will connect the battery to the Arduino.

5. Resistor (optional): If your battery voltage is higher than 5V, you'll need a resistor to regulate the voltage to 5V.

Steps:

  1. Connect the Battery:

    • Place the battery in the battery holder.
    • Connect the positive terminal of the battery to the positive terminal of the Arduino (labeled "VIN" or "5V").
    • Connect the negative terminal of the battery to the ground terminal of the Arduino (labeled "GND").
  2. Add a Resistor (if necessary):

    • If your battery voltage is higher than 5V, calculate the appropriate resistor value using Ohm's Law: R = (Vin - Vout) / I.
    • Connect the resistor between the positive terminal of the battery and the "VIN" or "5V" pin on the Arduino.
  3. Check Power:

    • Connect a LED to the Arduino's digital pin and ground.
    • If the LED lights up, the Arduino is receiving power from the battery.

Note:

  • Ensure that the battery you're using can provide enough current to power the Arduino and any connected devices.
  • If you're using a rechargeable battery, make sure to use a suitable charger.
  • For safety reasons, it's recommended to use a battery holder and wires that can handle the current of your battery.

By following these steps, you should be able to successfully connect your Arduino Micro to a 5V battery.

red dove
red dove
lunar lintel
red dove
#

....

#

so ....

#

the positive battery connect to the "VNN"

#

and the negative to the "GND"

#

?

#

is it correct?

lunar lintel
eternal cloud
red dove
#

trying to program a LED prop.

using 5v LED strip , light up with a battery 5v using Arduino pro micro

#

now i cant find the port to connect with the 5v battery positive

eternal cloud
red dove
#

So this is the led strip, that can program each per-led

eternal cloud
#

yes, we call these "neopixels", you control them with 1 pin of data.

#

and the battery ?

livid osprey
#

Unless you can personally verify the contents, please do not share chatbot results as technical advice, either.

north stream
livid osprey
eternal cloud
#

This seems to be a clone of the Sparkfun pro micro, i hope it can take 12V in RAW

gilded swift
#

I'd hope so too

red dove
#

Turns out I only have 9v battery 😭

livid osprey
#

I wouldn’t use a 9V battery as a power source due to its high ESR, aka low current capability.

red dove
gilded swift
#

9V battery isn't a great option for powering outside of things designed to run using micro amps of current. Low power capacity, low max current delivery make it a bad choice for anything power heavy like running LEDs.

livid osprey
#

Several AA batteries in series would work best, if you have a battery holder for them.

red dove
#

How about a power bank?

livid osprey
#

Power bank via USB works great.

red dove
livid osprey
#

No soldering required.

red dove
#

The output and in put is 5v

red dove
#

Just connect ???

livid osprey
#

With a USB cable, yes. USB carries 5V power.

red dove
#

Hrmmm alright

#

And where to place a switch?

#

On and off?

livid osprey
#

You can solder a switch to RST and GND. Connect the two to power off, disconnect to power back on.

#

If you really want to cut all power though, it’ll have to be inline to the cable.

red dove
#

😵

#

I'm a bit confused and don't understand.

#

But somehow I will experiment it.

red dove
# red dove

And how do I connect my Arduino pro micro with the neopixel strip?

#

Which cable to which port?

#

So sorry asking to much question and advice, this is my 1st time 🙇‍♀️

#

Trying to learn

#

Weird, it's not lighting up

eternal cloud
#

And is the power bank charged?

red dove
red dove
#

The Arduino only light 1 red. The back it doesn't

eternal cloud
#

That red LED should be on if you plug it in the power bank too. Probably the power bank doesn't start yet, since the current consumption is too low -- some power banks do that, they turn off when there is no charge on them

red dove
#

hrmmm i would charge my power bank longer

eternal cloud
#

It should work fine when you connect the neopixel strip

livid osprey
#

If your power bank can charge a phone, it should work fine once you add the lights.

red dove
#

so which ardunio port need to connect to thje neopixel wire?

eternal cloud
#

I see that your board doesn't have any headers, so you will need to solder the wires, or some headers to the board.

red dove
#

The one +5v?

eternal cloud
#

Oh, yea, it's labeled +5V on this strip

#

yep, that's the one

#

It can be labeled differently, sometimes it's VIN or smth

#

same thing 🙂

eternal cloud
#

watch the colors, cos you seem to have many wires there

red dove
#

i will test it on a breadboard

eternal cloud
#

2 reds, 2 whites, and a green?

red dove
#

I think the green is for the DIN

eternal cloud
#

yea, there are 2 red for power, 2 white for ground and the green one for data

the extra power and ground are if you want to use a separate battery for the LED strip -- if there are too many of them, they cannot be powered directly from an Arduino

#

but you can ignore them

red dove
#

ah i see thanks

#

i will experiment them now

surreal kayak
#

Can someone help me? i have been trying to do an rc car code

which uses a NRF24 module ,a tb6612fng driver and a servomotor to control the direction

and for the controller im just using 2 joystick module one to make it advance forward and backward an the other one to control de servo

surreal kayak
north stream
#

Is the microcontroller starting up?

hallow fog
#

does anyone know how to get the arduino protomaker working with a 64x64 screen? having issues with same sample code

#

i've set the address lines variable to 5

#

but it's all glitched

red dove
#

Hello again

#

morning\

#

my ardunio app have error about adafruit

north stream
#

I think you need to install the NeoPixel library

red dove
hallow fog
#

had to cross reference between programs that did and didn't worked

north stream
hallow fog
#

is it possible to get the matrix portal m4 to work over bluetooth in arduino? it theoretically should be possible given that it's possible with circuitpython and it's an esp32 chip, just not sure how to do it/where to start

timid helm
#

Are any of you guys familiar with a service like Fiverr or similar small task marketplace for getting help with coding tasks?
Specifically ESP32 / Arduino IDE?
I'm working on a project which needs to transfer a small amount of data over ESP NOW and I have some trouble which might take me a long time to figure out by myself (even with the wonderful advice often available online), so I'm trying to find a quick way to implement this functionality so I can finish my work in a reasonable amount of time.
It's hobby, by the way, not school or work 🙂

red dove
#

hello guys

#

so about yesterday LED

#

ya its workes

#

yahhhh!

eternal cloud
#

But there is a RST pin that says:

RST can be used to restart the Pro Micro. This pin is pulled high by a 10k&Ohm; resistor on the board, and is active-low, so it must be connected to ground to initiate a reset. The Pro Micro will remain "off" until the reset line is pulled back to high.

So if you connect an on/off switch between RST and GND, it should work to power the board off when the connection is closed, and back on when the connection is open (it's the opposite way an on/off button usually works, but it will work)

lapis spade
#

Has anyone worked with the MPR121's interrupt pin? I am trying to know when to get a reading from the chip, and am seeing it trigger when it detects a change, but I can't figure out how to get it to reset. All the documentation I have found says it should rest after the data is read, but I am receiving the data and the interrupt pin is not resetting itself. I am struggling to find exmplaes online of anyone using the interrupt pin.

livid osprey
lapis spade
# livid osprey It should reset after sending a read command over i2c. How are you receiving the...

Like this

    if(cap.touched() == 1){
        //code goes here
    }

This is my complete code

#include <Wire.h>
#include "Adafruit_MPR121.h"

//Set interupt pin
int irqpin = 5;

//Create MPR121 Device
Adafruit_MPR121 cap = Adafruit_MPR121();

void setup() {
  Serial.begin(115200);
  Serial.println("Starting.....");

  //Setup interupt pin
  pinMode(irqpin, INPUT);
  digitalWrite(irqpin, HIGH);

  while (!Serial) {
    delay(10);
  }

  Serial.println("Adafruit MPR121 Capacitive Touch sensor test"); 
  
  // Default address is 0x5A, if tied to 3.3V its 0x5B
  // If tied to SDA its 0x5C and if SCL then 0x5D
  if (!cap.begin(0x5A)) {
    Serial.println("MPR121 not found, check wiring?");
    while (1);
  }
  Serial.println("MPR121 found!");
}

void loop() {
  Serial.println("Starting Loop");
  delay(1000);
  if(!(digitalRead(irqpin))){
    
    Serial.println(cap.touched());
    if(cap.touched() == 1){
        Serial.println("Starting Audio");
  }
  }

}

north stream
#

Try adding something like cap.readRegister8(0); in your touched block

static sinew
#

hey all - I'm using AccelStepper in a project and just realized I should probably use a timer to call stepper.run() on a regular basis while movement is in progress.

#

So I made a volatile Boolean to tell the timer handler whether it was necessary or not (it's set in the code which also determines direction and target). Then I thought, should I disableTimer when it's not moving? And then...

#

I realized, I don't need the Boolean flag, just enable and disable the timer. Then - hey, why not make the timer handler the stepper.run() command itself, rather than some IRAM_ATTR function?

#

Suggestions? Maybe I can't reliably call stepper.run right from the timer constructor, I dunno. But this is a project that will typically be idle for hours if not days at a stretch, no need to keep the timer running every ~5ms at any rate....

lapis spade
dim junco
#

I am using a pico as a usb mouse for a project, I want to quickly make it wireless. Is there any adapter that can act as a USB reciever/tranciever that is relatively small and cheap

north stream
#

There are inexpensive USB Bluetooth adapters, but I don't know if a Pico can talk to one. However, a Pico W can support Bluetooth so that might be a way forward.

dim junco
#

I was trying to use bluetooth but I haphazardly wrote most of my code in CircuitPython before checking how well it can handle bluetooth, and turns out adafruits official ble library doesnt support the pico w

eternal cloud
dim junco
#

yeahhh I couldnt find a better channel for it so opened saying pico both times. (the closest is linux-sbcs but the pico fits best under arduino imo)

hollow crescent
#

I'm not able to connect to my feather rp2040 via the arduino IDE except when it's in bootselect mode.

I can put the board in bootselect and see the drive appear in my OS, then in the IDE under Tools > Port: I can select 'UF2 Board', and then uploading a sketch works fine.

But after that I don't see any connection to the board, and I don't seem to be able to upload another sketch. There aren't any selections available in Tools > Port: anymore, and trying to upload sketch fails with Scanning for RP2040 devices No drive to deploy.

Am I right to think I shouldn't need to manually put the board in bootselect mode every time I want to upload a sketch?

I'm using the Arduino IDE v 1.8.19, on Linux Mint 21.3, to program my Feather RP2040 (id: 4884). I was following this guide [https://learn.adafruit.com/rp2040-arduino-with-the-earlephilhower-core/overview] at first but I've looked at a few others trying to figure this out.

livid osprey
hollow crescent
#

I installed Arduino as a system package, not as a flatpak.

sinful dragon
#

Hey folks,

I purchased 2 Adafruit OV5640 breakout boards.

Im having a hard time finding a wiring diagram that shows how to wire it up to a ESP32 Dev Kit V1 (WROOM) chip.

Does anyone have any insight on this?

eternal cloud
sinful dragon
# eternal cloud There aren't wiring diagrams for all the possible boards out there, but this is ...

I got the camera wired up and connected, however, I'm unable to capture an image.

It seems to not be getting the frame buffer

If fails in this condition

camera_fb_t* fb = esp_camera_fb_get();

if (!fb) {
Serial.println("Camera capture failed");
esp_camera_fb_return(fb);
return;
}

I was originally using a ESP32-WROOM chip and figured it could be a memory issue.
Now I'm trying a WROVER chip and enabled PSRAM, but still no luck.

Could it be a wiring issue even though the camera is being detected successfully?

sinful dragon
# eternal cloud There aren't wiring diagrams for all the possible boards out there, but this is ...

After a lot of time spent, i found the issue.

pixel_format = PIXFORMAT_JPEG

The format does not seem to work.

Seems like it's a known issue based on Github

https://github.com/espressif/esp32-camera/issues/43#issuecomment-808745113

GitHub

Hi : I try to use esp_camera_fb_get() to get camera buffer, but it stops. I find the camera driver, it stops here. "xQueueReceive(s_state->fb_out, &fb, portMAX_DELAY);" I think cam...

north stream
#

Good catch

violet oak
#

@worthy thistle if you can get the xbox 360 host working. can you add the ability to turn the HID out, into a nintendo switch wired pro controller please?

worthy thistle
#

Good question, @violet oak I know the GP2040-CE firmware can output Switch control, just not sure about the host side of it as input from Xbox 360

terse smelt
#

I'm trying to get a TinyUSB example that lists my device info to work with the RP2040 USB Host feather and a Logitech steering wheel, but for some reason it's just not displaying the information. I got it to display information about a USB receiver and an SD card adapter but not the wheel. How can I get the steering wheel to connect with the feather? I think the wheel model is a Logitech G920.

#

On my PC, it displays as an Xbox peripheral:

violet oak
next glade
#

hey all im making a rocket and need to select a breakout 9-DOF Orientation IMU board but cant find one that has a accelerometer rating of 32g, could yall help me pick a board out

runic vault
#

hi, can please seomeone help me use arduino uno r4 with l293d motor driver?

eternal cloud
# next glade hey all im making a rocket and need to select a breakout 9-DOF Orientation IMU b...
north stream
runic vault
#

so i am controlling 4 dc motors, i also have this driver, i tried controlling it with arduino uno and it works but it doesnt work with arduino uno r4 as i see that the afmotor library isnt compatible

north stream
#

Hmm, that shield uses a shift register, so you'd presumably use the shiftout library to send data to that

north stream
#

Ah, didn't know that, that's a much better idea

runic vault
#

is this compatible?

#

i tried it, it didnt give me an error like the last one but it said in the serial monitor: "Could not find Motor Shield. Check wiring."

north stream
#

The DK motor shield is different from the AdaFruit one. The AdaFruit one uses an I2C chip to control the motor drivers. The DK one uses the aforementioned shift register.

eternal cloud
#

The DK motor shield seems to be a clone of the Adafruit's "now ancient V1 Motor shield"

runic vault
#

then what driver shield should i use that is compatible with the arduinouno r4?

eternal cloud
# runic vault then what driver shield should i use that is compatible with the arduinouno r4?

The library isn't compatible with R4, the shield itself is -- just not as easy to code as using the library. You can look into what madbodger said about the shiftout lib.

If you want a different shield, with library, this one https://www.adafruit.com/product/1438 uses different chips and communicates to the Arduino over I2C

runic vault
#

so that shield will work with my r4 and through that library?

#

isnt there a cheaper shield?

#

i just wanna make a simple wifi car

south garden
#

Does anyone know if there's a way for me to store data on internal flash memory using littleFS?

next glade
edgy ibex
#

I'm working with an esp32 WiFi airlift breakout: https://www.adafruit.com/product/4201 and note that while the WiFiServer class has a begin() method, there's no corresponding end() call to shut down the server. What options, if any, exist to close down the server so it's no longer listening.
One possibility I've considered is to make the WiFiServer a function scope variable, so that its dtor() gets called on return from the function that handles incoming connections. Would this work?

north stream
runic vault
#

ok i will try it but i have not done it before

#

i dont know if i will know how to do it

terse smelt
#

How can I send a raw report to an HID device from TinyUSB? tuh_hid_set_report() and tuh_hid_send_report() don't seem to send just raw data but rather HID specific data, I could be wrong though and my commands just aren't working.

stable forge
terse smelt
stable forge
#

so sending from a host to a device, via a feature or OUT report

#

"raw" HID is usually just 64-byte reports, without a report ID

#

how is tuh_hid_send_report() making the data HID specific?

terse smelt
#

I think so, but I can't figure out how I would do that with tinyusb.

stable forge
#

what is the host here?

#

and what is the device?

terse smelt
terse smelt
#

It has an Xinput mode, but also a HID++ mode which I am trying to use.

#

I'll see if I can find the PDF again with the command I need, but it said the command was 0x05 to disable the centering spring, combined with bits 11110000 which are mapped to each "slot" in the device.

terse smelt
#

If I want to send a custom HID command, would I do it like this?

const uint8_t autocenter_off[] = {0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
tuh_hid_send_report(dev_addr, instance, 0, &autocenter_off, sizeof(autocenter_off));
#

I'm not really sure what report_id is supposed to be

quaint nebula
#

Alrighty

#

Need some help with a Df player mini problem

#

I’m following this person guide in a Samus arm canon led/sound fx build

#

I followed the diagram but it seems like the Df player mini just turns off the entire circuit when I plug in the pins to the corresponding pins on the board

#

But it works with the led animations with the button presses work n everything when I exclude the Df player mini (ofc it won’t play the sound fx)

quaint nebula
north stream
quaint nebula
#

Gotcha

#

Already did

#

I’m just confused

#

Idk if the arduino needs more power or solder a capacitor to the 5V and grnd wires

north stream
#

Do you have a multimeter?

#

That makes it trickier. You can try powering the DF separately with something like a USB charger

quaint nebula
#

Eh I have beinf broke

#

$20 being the lowest

#

Eh I should probably just get it

north stream
#

You don't have a random USB charger around?

#

Note: the $5 multimeters at Harbor Fright are actually usable

quaint nebula
woven lintel
#

Anyone know what size these connectors are?

#

SH 1.0 is too small

woven lintel
#

I found these in pcb files. How can I find connectors for them?

eternal cloud
worldly kayak
#

Does anybody know if a fingerprint sensor (such as https://www.adafruit.com/product/751) which operates via UART and has libraries made for Arduino and CircuitPython, can be easily integrated to work on Raspberry PI 4/5? How much work would it be to rewrite the library from these two into RP?

eternal cloud
leaden walrus
woven lintel
terse smelt
#

I managed to recreate most of it, it's just the actual fuction for sending the report seems to be very different

#

Here's what I have so far:

#define HIDPP_FF_EFFECT_SPRING 0x06
#define HIDPP_FF_EFFECT_AUTOSTART 0x80

#define HIDPP_FF_EFFECTID_AUTOCENTER -2
#define HIDPP_FF_DOWNLOAD_EFFECT 0x21

static void set_autocenter(uint8_t dev_addr, uint8_t instance, uint16_t magnitude)
{
    uint8_t params[18];

    Serial.printf("Setting autocenter to %d.\n", magnitude);

    /* start a standard spring effect */
    params[1] = HIDPP_FF_EFFECT_SPRING | HIDPP_FF_EFFECT_AUTOSTART;
    /* zero delay and duration */
    params[2] = params[3] = params[4] = params[5] = 0;
    /* set coeff to 25% of saturation */
    params[8] = params[14] = magnitude >> 11;
    params[9] = params[15] = (magnitude >> 3) & 255;
    params[6] = params[16] = magnitude >> 9;
    params[7] = params[17] = (magnitude >> 1) & 255;
    /* zero deadband and center */
    params[10] = params[11] = params[12] = params[13] = 0;

  params[0] = HIDPP_FF_DOWNLOAD_EFFECT;

  tuh_hid_send_report(dev_addr, instance, HIDPP_FF_EFFECTID_AUTOCENTER, params, sizeof(params));
}
north stream
#

I don't know how to fix that but you could use bitfields to make the code a little more readable

supple egret
#

Context: Itsy Bitsy M0 onboard SPI Flash

I am attempting to use the Adafruit_SPIFlash arduino library with the Itsy Bitsy M0 board. When I check teh results of getJEDECID() it returns 0xFFFFFF indicating the flash interface did not initialize. Checking the reported flash size returns 0.

Below is the code snipet with configuration:

#define CUSTOM_MISO    PIN_PB03
#define CUSTOM_MOSI    PIN_PB22
#define CUSTOM_SCK    PIN_PB23
#define CUSTOM_CS    PIN_PA27
#define CUSTOM_SPI     SPI1

#include "SPI.h"
#include "Adafruit_SPIFlash.h"

Adafruit_FlashTransport_SPI _flash_transport(CUSTOM_CS, CUSTOM_SPI);
Adafruit_SPIFlash _flash_device(&_flash_transport);


static bool _flash_inited = false;
void flashInit() {
    if (_flash_inited) return;
    _flash_device.begin();
    DEBUG_PRINTF("flashInit():\n");
    DEBUG_PRINTF("    JEDEC ID: 0x%06X\n", _flash_device.getJEDECID());
    DEBUG_PRINTF("    Flash size: %d\n", _flash_device.size());
    _flash_inited = true;
}

The output is:

Unknown flash device 0x0
flashInit():
    JEDEC ID: 0xFFFFFF
    Flash size: 0

Suggestions, code changes, and advice is appreciated.

stable forge
supple egret
#

@stable forge - I have them for my own reference but there does not appear to be any way to specify them when configuring Adafruilt_SPIFlash().

stable forge
supple egret
#

@stable forge - I cound not find how to customing SPI other than what the Itsy Bitsy M0 example code does which is to use SPI1.

supple egret
#

Let me cross check teh datasheet with the pins used on the itsy bitsy m0 to determine which sercom it is attempting to use

supple egret
#

based on the itsy bitsy m0 schematic, the pins being used for the SPI flash all belong to SERCOM5. I will create an SPI interface on SERCOM5 with the given pins. 🤞

stable forge
#

there is an example program there

supple egret
#

yes, I was using that learning guide.

stable forge
#
#define FLASH_SS       SS1                    // Flash chip SS pin.
#define FLASH_SPI_PORT SPI1                   // What SPI port is Flash on?

Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT);     // Use hardware SPI 
#

note it is not using Flash_transport

#

did you try any of the example programs in the library?

supple egret
#

I did try several permutations from the exmples.

stable forge
#

did the examples work?

#

you should not need to edit them, I think, except maybe choosing SPI1

supple egret
#

no examples worked.

BTW: the constructor no longer takes a CS pin and SPI

#

so at least some of the content is out of date.

#

the examples use the transport to change configuration

#

so it's jsut the learning guide which is out of date.

stable forge
#

Could you open an issue and give guide feedback as appropriate? I'd have to start from scratch on debugging this then, sorry. But I think SPI1 out of the box should work for you.

supple egret
#

let me get things working first 🙂

stable forge
supple egret
#

I have been looking. I only came to this channel because - after 4 hours of reading and trial and error - I hoped someone had a lightbulb for me. I'll keep digging.

I suspect it is a configuration issue because I am having similar issues with other SPI flash libraries (although they are much older and may have other issues).

#

@stable forge - when I finally get to opening a ticket on the learning guides, it will likely hit most of the M0 boards as I am seeing the same cut/paste error on several.

stable forge
supple egret
#

there is a small amount of board-specific content on the pages which is why I was guessing a copy/paste scenario.

stable forge
supple egret
#

Well, first task is getting the onboard SPI flash working. Then I will have accurate data for any errata to the learning guides.

supple egret
#

@stable forge - the more I dig, the more confused I get ...

I looked at the variant.h file for the Itsy Bitsy M0. this is part of what gets loaded by the Arduino board manager.
In the file, it assigns the physical pins to teh definitions. Here is what it shows for SPI1:

#define PIN_SPI1_MISO         (36u)
#define PIN_SPI1_MOSI         (37u)
#define PIN_SPI1_SCK          (38u)
#define PERIPH_SPI1           sercom5
#define PAD_SPI1_TX           SPI_PAD_2_SCK_3
#define PAD_SPI1_RX           SERCOM_RX_PAD_1

static const uint8_t SS1   = 39 ;    // HW SS isn't used. Set here only for reference.
static const uint8_t MOSI1 = PIN_SPI_MOSI ;
static const uint8_t MISO1 = PIN_SPI_MISO ;
static const uint8_t SCK1  = PIN_SPI_SCK ;

The problem is the SAMD21G18 does not have a physical pin 36. Further, the Adafruit schematic shows the FLASH_MISO on physical pin 48.

#

So, I have no idea how the example(s) are working. (more digging will ensue)

#

... but to be clear, I can get example(s) to work ... hence my confusion 🙂

stable forge
#

so that, for instance, pin 13, which is very often the red LED blinky pin, is not necessarily PA13

supple egret
#

hence all of my confusion. the schematic is using physical pin 48, which on that picture is PB03. I have not idea what mapping is being used if it is not physical pins.

stable forge
#

yes, I'm saying that 36 is not the 36 in the Arduino code.

#

that's just counting the pins around the package.

#

look in the variant.cpp file. In there, there is a table of pin numbers to actual pins. For instance, the very first one, [0] in g_APinDescription[], is PORTA, 11, aka PA11. So on this board, pin 0 in Arduino code maps to PA11.

#
const PinDescription g_APinDescription[]=
{
  // 0..13 - Digital pins
  // ----------------------
  // 0/1 - SERCOM/UART (Serial1)
  { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // RX: SERCOM0/PAD[3]
  { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // TX: SERCOM0/PAD[2]
...`
supple egret
#

I am not looking at the high leverl "user" arduino code. I am looking at the board configuration which is the low level mapping of the chip to things the high leverl user code can reference.

stable forge
#

yes, you have to refer to the PAxx and PBxx pin numbers for that. And those numbers can be completely different from the integers used as Arduino pin numbers. And those numbers also have nothing to do with the physical pins on the chip.

supple egret
#

I think I just need to accept that I can get teh example to work, regardless of the confusion

stable forge
#

there are three different designations for a particular pin.

#

it's important to understand this

#
  1. The physical pin number on the chip, counting around the outside
  2. The PAxx or PBxx (or other) pin number that the physical pin is connected to
  3. The arduino pin number (an integer), which is yet another number.
supple egret
#

yes. tht is my understanding as well.

stable forge
#

here is part of the table in variant.cpp for the itsy m0 board:

  // 36..38 - Secondary SPI
  // ----------------------
  { PORTB, 03, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },  // SPI Flash MISO
  { PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },  // SPI FLash MOSI
  { PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },  // SPI FLash SCK
  // 39 Secondary SPI SS
  { PORTA, 27, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_15 }, // SPI Flash SS
supple egret
#

it is my understanding that each board configuration (it's variant.* files) map the physical pins to the arduino numbers.

stable forge
#

so 36 in Arduino is PB03, 37 is PB22, etc.

#

and that 36 has nothing to do with the white numbers in the screenshot above

supple egret
#

but "36" was not an arduino number. it was a physical number.

#

just as was 37 and 38 and 39 (which correspond to PB22, PB23, and PA27)

stable forge
#

No, the 36 .. 38 in the code I pasted above are the arduino pin numbers. Nobody is using the physical numbers in the arduino code

leaden walrus
#

36 etc. are just the index value of the table in variant.cpp

supple egret
#

sorry, I do not think I am being clear

#

I am not in the "user arduino code". I am looking at the board configuration "variant.h" file.

leaden walrus
#

that doesn't use physical pin number

#
#define PIN_SPI1_MISO         (36u)
#

look up the 36th entry in the table in variants

stable forge
#

variant.h also is arduino. It doesn't know anything about the metal pin number

leaden walrus
#

if you want physical pin number, you'd want to take the resulting port value and find it in the pinout diagram

supple egret
#

OK. that was my incorrect interpretation

leaden walrus
#
// 36..38 - Secondary SPI
  // ----------------------
  { PORTB, 03, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
stable forge
#

the purpose of variant.* is to map an arduino integer pin number to an actual PAxx or PBxx number

leaden walrus
#

so 36 would be whatever physical pin PORTB03 ends up on

#

which can vary depending on chip variant

stable forge
#

on the board, not the chip

supple egret
#

well, the good news is that (1) I have working code; and (2) I can now go look at the learning guides and see if there are any errata to submit.

stable forge
#

sorry, it is very confusing. There are pin numbers on the chip package, the chip itself (tiny wires internally from chip to package), and the board

supple egret
#

well, my confusion has been reduced by your patience 🤩

#

thanks for sticking with me

stable forge
#

you're welcome!

leaden walrus
#

pin nomenclature is a never ending source of confusion, unfortunately. for everyone.

supple egret
#

pin nomenclature gets even more confusion when a person is board developer and firmware developer ... which is where I sit most of the time.

stable forge
#

it was a mistake for Arduino to use integers instead of names for pins. They have A3 for an analog-capable pin, but 3 for a digital pin, and they are different! If the digital pins had been called Dx it would have helped a little.

north stream
#

It's even more confusing on a Pi where there are (at least) two different GPIO pin numbering schemes in use.

quaint nebula
#

Trying to upload a sketch and keep on getting this error

#

How can I fix this

tame topaz
north stream
#

The "OK" button will do this for you

quaint nebula
#

Ah Already figured it out

#

Thank you

wise barn
#

https://learn.adafruit.com/adafruit-128x64-oled-featherwing/arduino-code I'm using this guide for an OLED featherwing and I think I'm missing something simple about the SH110X library. display.clearDisplay() turns everything printed on the screen black but it doesn't return the cursor to the top left, so after printing out a few lines of data I can't see anything new on the screen unless I power the device off and start the program again. I want the screen to display a few data points and update them each time the program loops, is there a method that I'm missing?

Easily add a gorgeous 128x64 OLED to your Feather project!

eternal cloud
#

is there a method that I'm missing?

Yep, it's right there in the code example: display.setCursor(0,0); 🙂 @wise barn

wise barn
#

I swear that wasn't there 30 seconds ago. Thank you!!

quaint nebula
#

Welcome to the L298N Arduino tutorial. In this video, we are going to learn how to control a DC motor using an Arduino board. We are going to use a small and inexpensive module that features the L298N motor driver chip.

🛒 Arduino Uno ▶ http://educ8s.tv/part/ArduinoUno

🛒 L298N Driver ▶ http://educ8s.tv/part/L298N

🛒 2 DC Motors ▶ http://educ8s...

▶ Play video
#

Using this dc motor sample code but when I try to run it all I’m getting is redefinition errors

eternal cloud
strange loom
#

Hi everyone, I'm really struggling to get JTAG debugging working on the Qualia ESP32-S3 RGB666 with PlatformIO. https://forums.adafruit.com/viewtopic.php?t=213533
Does anyone know how to get it running. It is so difficult to develop on this board when there is no GDB available

stable forge
#

I tried it with a J-Link

spiral carbon
#

Hullo. Does anybody know whether its possible to use all of the 3 buttons on a ESP32 REV TFT to wake it up from deep sleep?

spiral carbon
# stable forge do you mean press any of the buttons, or must press all?

any. (will do different things depending on which was pressed). i forget, but they have to be listed in as RTC buttons in esp32 and then theres something about pullup or down (EXTernal wakeup). the reason i ask is that on the adafruit OLED (128x32) one button had a physical pullup to my memory.

stable forge
spiral carbon
spiral carbon
# stable forge do you mean ESP32-S3 reverse TFT?

These two pins are pulled LOW by default, e.g. when not pressed, the signal is low. When pressed, the signal goes HIGH. This is required to wake the ESP32-S3 from deep sleep.

which means you cant use D0 for weak up?

stable forge
#

D0 is also used to get into boot mode, so D1 or D2 are better choices

#

I don't remember if going high is required. I need to look

#

you may be able to use D0 as well, but it triggers going low rather than high

#

the code handles both cases. There are some restrictions: only one pin can go low to set off an alarm, but multiple pins can go high. There is a message in the code "Can only alarm on one low pin while others alarm high from deep sleep.". I wrote this code, but it was years ago.

#

ESP32 and ESP32-S2/S3 are different.

stable forge
#

you can use ESP_EXT1_WAKEUP_ANY_HIGH on D1 or D2.

#

is there an arduino library for this? I would think there would be

tawdry sluice
#

Trying to get an SSD1306 OLED screen working with an Arduino Opta via its expansion port using this adapter [https://www.tindie.com/products/35482] and the Adafruit_SSD1306 library [https://github.com/adafruit/Adafruit_SSD1306]. Works well (with different code) when it's just the Arduino Opta brick, but when I add the SSR expansion module via code listed below, it compiles, loads, then gives me a blinking red light which indicates a problem. Have tried different I2C addresses, and it still gives me this issue. Any ideas on how I can get around this would be appreciated.

#include <SPI.h> //needed??
#include <Wire.h>

// Took out display code per apparant I2C conflict
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET     -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

#include "OptaBlue.h"
using namespace Opta; //not sure what this is for, but in examples

DigitalStSolidExpansion stsolidExp;

void setup() {
  OptaController.begin(); //maybe needed for SSR expansion? Not sure.
  stsolidExp = OptaController.getExpansion(0); //expansion at index 0 is solid state relay needed???
  pinMode (LED_BUILTIN, OUTPUT); // Set Arduino board pin 13 to output
// Took out display code per apparant I2C conflict
  display.clearDisplay();
  display.setTextSize(1);      // Normal 1:1 pixel scale
  display.setTextColor(SSD1306_WHITE); // Draw white text
  display.setCursor(0, 0);     // Start at top-left corner
  display.cp437(true);         // Use full 256 char 'Code Page 437' fon
  display.setRotation(1); //rotates the screen 90 degrees
}

void loop() { // Main loop
}
tawdry sluice
# tawdry sluice Trying to get an SSD1306 OLED screen working with an Arduino Opta via its expans...

Looking at this a bit further, this sets things up to run, but doesn't actually do anything with the SSD1306 OLED:

#include <SPI.h> //needed??
#include <Wire.h>

// Took out display code per apparant I2C conflict
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET     LED_BUILTIN // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

#include "OptaBlue.h"
using namespace Opta; //not sure what this is for, but in examples

DigitalStSolidExpansion stsolidExp;

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  OptaController.begin(); //maybe needed for SSR expansion? Not sure.
  stsolidExp = OptaController.getExpansion(0); //expansion at index 0 is solid state relay needed???

  //display.clearDisplay(); //TAKE THIS OUT AND RUNS (BUT DOES NOTHING W/ SSD1306)
  display.setTextSize(1);      // Normal 1:1 pixel scale
  display.setTextColor(SSD1306_WHITE); // Draw white text
  display.setCursor(0, 0);     // Start at top-left corner
  display.cp437(false);         // Use full 256 char 'Code Page 437' fon
  display.setRotation(0); //rotates the screen 90 degrees

}

void loop() { // Main loop
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}
strange loom
green thunder
strange loom
# green thunder Having a similar problem myself with the Feather ESP32-S2 and PlatformIO. I'm no...

The UART serial COM port is different to the USB-CDC COM port. Now I don't quite remember what setting it is to see the COM port where the back trace occurs but you want to have some of these flags in platform.ini ```[env:adafruit_qualia_s3_rgb666]
platform = espressif32
board = adafruit_qualia_s3_rgb666
framework = arduino
build_flags = -O2 -DDEBUG -std=c++17 -DARDUINO_USB_MODE=1
upload_speed = 2000000
upload_port = COM8
monitor_port = COM10
monitor_filters = esp32_exception_decoder, log2file
monitor_speed = 115200
debug_tool = esp-builtin
debug_init_break = break setup
debug_load_mode = manual
build_type = debug

green thunder
#

(For what it's worth it also doesn't print the backtrace in Arduino IDE either, and again, from everything I see online it just...should?)

tawdry sluice
# tawdry sluice Looking at this a bit further, this sets things up to run, but doesn't actually ...

Apparently I didn't call display.begin() as shown in Adafruit's library example. Here's the fixed code for your edification: https://github.com/JeremySCook/arduino-experiments/blob/main/opta/opta-ssdexpansion-ssd1306.ino

GitHub

Experiments in Arduino C. Contribute to JeremySCook/arduino-experiments development by creating an account on GitHub.

strange loom
green thunder
# strange loom Not nessesarily, it depends which COM port

Hmm. I'm pretty much out of ideas sadly. I spent about 8 hours yesterday just trying to figure out how to print out a dang back trace with no luck. I literally don't see any other com ports available (using a Mac if it makes any difference) and of the scant few posts on the internet I've found of other people with this issue, nobody seems to have found a solution. And the rest of the posts are like "I keep getting this backtrace but I don't know what it means" and boy would I sure love to at least have that problem right now lol

strange loom
#

Hmmmm... sorry yeah. I use a windows machine and device manager usually lists a COM port for me. I have the S3 and I know the S2 has different behaviour. The S3 has thing thing where you have to hold the boot button and the power button to enter bootloader mode. Then it enters COM8 (on my machine)

#

I somehow set it up in a way (I think with the debug arduino flag) which allows my arduino to print to the UART for logging and print to the COM8 port the ESP32 backtrace and debugging dumps

#

It's a weird thing where the UART (COM11) is the USB to serial converter and the COM8 is the USB CDC connection

#

But again the S3 and S2 are different. Might have to look at ESP-IDF docs or the PlatformIO docs and see if there's anything of interest there.

green thunder
#

I've been trawling them and I haven't been able to find much helpful. The Espressif docs don't care about PlatformIO and the PlatformIO docs are...not helpful at best, and are incorrect at worst. I tried the ARDUINO_USB_MODE flag but that gave me a bunch of compiler errors related to Serial not being defined. I would gladly just use the ESP-IDF but I need several Arduino libraries.

strange loom
green thunder
#

I haven't, not sure how I would go about doing that

#

Nothing I put in sdkconfig.defaults (or any other variant) seems to do anything at all, and setting the appropriate build flags directly in platformio.ini produces loads of warnings about those particular flags already being defined in the baked-in sdkconfig.h included with the SDK. Only idea I have left to try is to see if I can use a USB to TTL serial cable to see if the "Debug TX" pin on the feather outputs anything useful, but I am skeptical. Also there is very little info about how to actually use that pin and what it actually outputs.

strange loom
green thunder
#

Sorry for the incoming wall of text...

I did not yet find a solution to the PlatformIO/ESP32-S2 traceback issue, but I seem to have solved the crash I originally needed the traceback for, before I even got a chance to try using the Feather's "Debug Tx" pin. It occurred to me that even though I wasn't able to get a trace, I could maybe use esp_reset_reason() to get a clue about why we were rebooting. It yielded the reason ESP_RST_INT_WDT, which apparently is the interrupt watchdog timer.

#

Log story short, I am using 3 SPI devices: a LoRa featherwing, an SD card reader, and a 320x240 TFT display. Also, I am using LVGL for my UI. The crash occurred whenever a device received a LoRa message right in the middle of LVGL re-drawing the screen when moving from screen to screen. I know that the Radiohead RFM95 driver uses interrupts when it receives a payload and when it finishes sending a payload. So, I poked around in RH_RF95.h source and lo and behold I find this comment:

/// The RH_RF95 driver uses interrupts to react to events in the RFM module,
/// such as the reception of a new packet, or the completion of transmission
/// of a packet. The driver configures the radio so the required interrupt is generated by the radio's DIO0 pin.
/// The RH_RF95 driver interrupt service routine reads status from
/// and writes data to the the RFM module via the SPI interface. It is very
/// important therefore, that if you are using the RH_RF95 driver with another
/// SPI based deviced, that you disable interrupts while you transfer data to
/// and from that other device.  Use cli() to disable interrupts and sei() to
/// reenable them.
#

So in my lvglFlushDisplay callback, I wrapped the line:

display.drawRGBBitmap(area->x1, area->y1, (uint16_t*)pixels, w, h);

with a cli() and an sei(). That seems to work around the crash. For whatever reason I guess there is some conflict when trying to receive data and draw at the same time that was causing one of those libraries/hardwares to hang, eventually tripping the interrupt watchdog timer.

Since I'm using the RHReliableDatagram I think (hope) it's okay to disable the interrupts for the few ms it takes to draw a batch of pixels, since the retry/timeout logic should be in effect, and the receiving device should be able to again receive once the screen finishes drawing. I also bumped up the SPI rate for the display to 80mhz which about halves the drawing time, hopefully further reducing the chances of missed transmissions.

quaint nebula
#

Having trouble with this Elegoo nano

#

Recognizes the board as arduino nano with its com port and uploads the led code successfully but it’s not really playing anything

#

My elegoo uno works in comparison

tawdry sluice
#

Using an SSD1306 OLED display with the Adafruit_SSD1306 and Adafruit_GFX.h libraries to display new lines of text that represent inputs from another device.

What I'd like to do is have the latest line on the top, and have every new line replace that with the previous line advancing one line down. So sort of a Twitter/blog (reverse?) chronological setup. I'm sure I can hack something out, but is there an easy/standard way to do this?

supple egret
tawdry sluice
#

Thanks @supple egret !

supple egret
#

No worries. Based on your goal, I think the code from the PortableISP is likely easier to follow.

tawdry sluice
#

Suggestions on where to look there?

supple egret
#

@tawdry sluice - look at oled.cpp and the oledPrint() function which adds lines to the text buffer. The refresh gets called periodically.

surreal kayak
#

can someoen help me to install esp now library

leaden walrus
#

@surreal kayak it looks like maybe you have a typo in the URL

surreal kayak
#

can you help me with the link

leaden walrus
#

are you following instruction from somewhere?

surreal kayak
leaden walrus
#

that looks like info for installing basic ESP32 support into arduino - aka the Board Support Package

surreal kayak
#

the boards are installed

#

but there isnt any examples for esp now

leaden walrus
#

they say to just clone the repo

#

but it might be available in library manager?

#

look for "WifiEspNow" in library manager

surreal kayak
leaden walrus
#

try an example from the library

safe shell
#

what does your board manager show?

leaden walrus
#

i think the base esp now stuff is meant to be used with esp idf (not arduino)

#

so for arduino, you'll need the library and code will need to be different

safe shell
#

Arduino can be mixed with esp-idf

leaden walrus
#

oh, ok, it works to make direct includes / calls?

leaden walrus
#

change board type to an ESP32 board

#

neat! yah, this complied fine for me:

#include <esp_now.h>

void setup() {
}

void loop() {
}

for board = ESP32 Dev Module

#

WifiEspNow is a simple wrapper of ESP-NOW functions in ESP-IDF.

#

and the library is just a wrapper

#

can use / not use depending on how you want to code things

north stream
# surreal kayak can you help me with the link

The %20 is a space, which should be a newline. The packages should be listed, one per line. You can click on the list to open it in a text area where it's easier to edit multiline input like that.

surreal kayak
#

fixed thanks guys

civic jungle
#

Hi guys, I'm currently trying to move an arduino project over to platformio in vscode, and it's having a problem finding Adafruit_DRV2605.h, which I had previously installed on the arduino ide. I thought platform.io was supposed to automatically find all the installed arduino headers, but it doesn't for this one. Does anyone have an idea of why this is or how to fix it?

supple egret
#

@civic jungle - I have not had much luck with VSCode+PlatformIO automatically setting up my Arduino projects.
I manually add libraries to my projects by:

  1. switching to the PlatformIO tab
  2. Selecting libraries
  3. Searching for the library
  4. Copying the recommended install line
  5. Adding the installation line to my lib_deps = of my platformio.ini
civic jungle
#

Thank you!

#

Huh, now it's giving this... some component of the library is missing?

civic jungle
#

Oh, it's built in, but not automatically included

stray sierra
#

Hello, I am trying to use free fonts, sans to display temperature, but I'm unable to get degree (º) sign

#

all fonts I checked only have 127 chars, and º sign is 176... where can I find full font to use the º sign?

#

I used u8g2 before and I'm porting my code, and I'm stuck on this...

#

only gets 7bit TTF

eternal cloud
stray sierra
#

Yes

eternal cloud
stray sierra
#

Thanks

plain iris
#

Pico Mouse/TinyUSB question:

I'm coding the pico in arduino ide. Please tell me if there is a more relevant place and/or platform and/or channel to ask this question.

My project requires mount output and I want to make my mouse output be 16 bit because 8 bit is simply not enough for what I'm doing.

I tried to do what this guy did on his teensy (with regards to changing mouse output to 16 bit): https://github.com/Trip93/teensy4_mouse/blob/main/teensy4_cores_patch.md

From what I could tell the code I changed was fine. The output still was limited at 127 tho. In the mouse library (which I downloaded from the library manager), there was some code that would clamp the range to 127 if it exceeded it. Removing this limit made the mouse output I was testing with become smaller.

I then saw that in the pico board libraries there is a hid_mouse, tinyusb and mouse library, which all have some mouse stuff so I'm not sure which to look at and what to change.

Any help is appreciated 👍

GitHub

Arduino code for a high speed 8000hz wired mouse using a teensy 4 MCU - Trip93/teensy4_mouse

merry cargo
# plain iris Pico Mouse/TinyUSB question: I'm coding the pico in arduino ide. Please tell me...

Not sure if this helps, but...
I used this source to make an arcade spinner. It uses mouse.move() to send +/- incremental movements to the connected computer. Since it's sending a relative movement, it's up to the computer to determine the absolute position, so 16 vs 8 bit shouldn't matter within the microcontroller code. https://github.com/jmtw000/Arcade-Spinner/blob/master/Arcade_Spinner.ino

GitHub

Arduino Micro Arcade Spinner. Contribute to jmtw000/Arcade-Spinner development by creating an account on GitHub.

plain iris
#

I edited the descriptor to be 16 bit and the code looked fine, but then I saw that in my board package, there was also a "mouse.h" library there, a "mouse.h" library built into the arduino ide itself alongside the mouse.h library I downloaded from the library manager. Then I saw the TinyUSB library as well and just got mega confused

#

I'll probably just need to make sure only 1 is there and only that one is being used to keep it simple

stable forge
#

And did you replace the code in usb_mouse.c as well?

sour tide
#

anyone know how to get the arduino ide v2 to see my git cloned arduino lib?

#

I've added a symlink to it into ~/Arduino/libraries

#

got it. had the symlink wrong

glacial light
#

hi everyone !
Being quite new to the RP2040, I recently started having fun with it, for a little project I have in mind ( driving two identical spi st7799 240x280 displays to show some images/animations ). after managing the setup of hw spi for the displays, I switched to using dma to go faster & sync the displays ( learning curve but it went well 🙂 ), and now I am digging how to add SD card storage ( to pick the pixels data from ). Since I wish to use SDIO to read-only data fast, I looked for a library supporting it on the RP2040 and found the following:
https://github.com/carlk3/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico
Now, since I am currently using Earl Philower’s Arduino Core, I am not quite sure how I should « tweak stuff » to be able to use that lib correctly within the Arduino IDE.
In the meantime, I had the chance to try using PIOs instead of hw spi peripherals ( to free at least one hw spi bus for the SD card while I don’t know yet how to use SDIO ) and had it working with my dma setup with only few tweaks and a globally defined flag, all working flawlessly 🙂
So, if anyone has knowledge regarding this, please let me know 😉
thanks in advance

GitHub

A FAT filesystem with SDIO and SPI drivers for SD card on Raspberry Pi Pico - carlk3/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico

onyx junco
#

So I have the Adafruit ESP32-S2 Feather with BME280 Sensor, I have a Adafruit 3.7V 420mAh battery connected to it. Following the code here: https://learn.adafruit.com/adafruit-esp32-s2-feather?view=all#using-with-arduino-ide I monitor the temp etc including battery %. In the code, I set the battery pack size to this LC709203F_APA_500MAH as that is the closest to my battery pack size. My issue is that the battery percentage is does not even come close to what it really is. At 4.2V 100% ... then 3.75V 25% but then at 3.6V 4.4%. I haven't fully tested the minimum yet but the ESP32 still runs at 2.6V. How can I ensure I get a better approximation of the battery percentage.

Make your IoT project fly!

onyx junco
#

I did not wait until there was no power left to run the ESP but my battery discharge graph looked like this. Last lowest reading was 3.42V

eternal cloud
onyx junco
safe sage
#

Hi - I am looking for a library, that would allow me to build a BLE Joystick on Xiao BLE Sense - I want to use it as a wireless headtracker for sim gamng, using onboard IMU sensor as input for joystick... Any pointers?

stable forge
safe sage
#

I need two analog axis...

safe sage
#

hm... actually - I need three axis ;]

stable forge
#

Axes movement (6 axes (configurable resolution up to 16 bit) (x, y, z, rZ, rX, rY) --> (Left Thumb X, Left Thumb Y, Right Thumb X, Right Thumb Y, Left Trigger, Right Trigger))

#

you can vary the number of axes, it looks like. It's settable.

trim cipher
#

hi, I use the Adafruit_SH110X display library. Is there a way to reverse the text contrast dynamically when a rectangle is over the text?

safe sage
neat steeple
stable forge
fresh thistle
#

Hi guys, I am new to arduino and really need some helo with a project. I am trying to create a simple device that reads VOCs from a Adafruit BME680 - Temperature, Humidity, Pressure and Gas Sensor and displays the information on a Adafruit FeatherWing OLED - 128x64 OLED Add-on For Feather connected to a Adafruit ESP32-S3 Feather with 4MB Flash 2MB PSRAM. Everything is connected in arduino IDE, and I can sucessfully get readings from the gas sensor, but whenever I attatch the OLED, the device seems to turn off completely. I have tried everything, I even switched to circuit python, and the same issue occurred.

#

If anyone has available time and knowledge would be happy to chat can send photos or share video of my wiring. Code doesn't seem to be an issue.

inland gorge
stable forge
chilly zenith
#

can anyone help me setup the pihole kit? the guide seems super outdated and mixed im kinda not getting it lol...
for ex rasbian is discontinued and the rasberry pi imager says the board only supports 32bit imaging but guide says 64..boot folder isnt being created

limber blaze
#

Hello! I'm having a weird issue. I'm using a NodeMCU-32S with Arduino. I'm trying to set a GPIO as output, and blink an LED.. pretty basic stuff.. I've also got the Serial port working. What's odd is that when my board resets, I get a message stating...
"00:54:43.338 -> E (25) gpio: GPIO can only be used as input mode"
Any help would be greatly appreciated!

civic jungle
#

Does anyone know how to use adafruit libraries (specifically the DRV2605) with soft I2C? I want to run multiple independent slaves but can't figure out how to get the adafruit driver class to target different output pins. I'm using SlowSoftI2CMaster but if something else would work better I would be open to it.
Mainboard is an Arduino Nano 33 Sense Rev2

rich coral
#

can you programm a MCU into ICP debugger?

restive roost
#

Heyy, I'm working on a big led matrix project 192x16 for my school and I'm having trouble addressing the matrix as a whole
It's made up of a total of 12 32x8 matrices and I'm using Arduino Due
the LEDs in each matrix are lined up in a serpentine zigzag way (up to bottom then bottom to up from left to right, individually I had no trouble initializing them with these parameters : NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG)
and the matrices are physically lined up and connected like this (left bottom then up then it goes right bottom then up and so on) so like serpentine zigzag from bottom to up with no rotation
I wanna initialize the matrix as a whole in a way that I can use .print to print out string on the matrix
I've tried the tiled matrices initialization but that didn't produce a readable result
how can I do this thing?

north stream
limber blaze
errant geode
#

Hello. I want to make keyboard with Arduino Pro Micro, but for some reason it has wrong HID Key Codes and I don't know how to fix. For example, Backspace is 8, Tab is 9, Enter is 10 instead of 40 (code 40 is bracket). Some keys have multiple codes, and some are completely missing. I tested 0-255 and not found keys like ESC, SHIFT, ALT, CTRL. It looks like it is writing ASCII characters, instead of real key presses. Issue exists on both windows and linux, both Keyboard library and HID Project library, tried also some different keyboard layouts, but still nothing changes. Anyone knows what can cause this issue? Here is my code:

#include "Keyboard.h"
void setup()
{
  Serial.begin(9600);
  Keyboard.begin();
}
void loop()
{
  if (Serial.available() > 0)
  {
    String inputString = Serial.readStringUntil('\n');
    inputString.trim();
    if (inputString.length() > 0)
    {
      delay(1000); Keyboard.press(inputString.toInt());
      delay(100); Keyboard.releaseAll();
    }
  }
}```
inland gorge
errant geode
#

I tried it now and it prints exactly what i am typing, so it must be something else...

errant geode
#

As i see, Keyboard.press(); and Keyboard.write(); gives the same result for the same code, which is wrong i thing, because ASCII table is not the same as KEY CODES. I cant' use any key outside ASCII table, no matter if i use write or press.

stable forge
#

they correspond more or less to physical locations on a US standard keyboard

errant geode
#

Yes, so why Keyboard.write() and Keyboard.press() gives me ALWAYS the same result for EVERY key i tried? Something must be wrong...

merry cargo
stable forge
#
size_t Keyboard_::write(uint8_t c)
{
    uint8_t p = press(c);    // Keydown
    release(c);        // Keyup
    return p;        // just return the result of press() since release() almost always returns 1
}
errant geode
#

Ok, so, how can i press a key by its HID KEY CODE instead of ASCII?

stable forge
#

like for example, what key?

#

what language are you using?

errant geode
#

For example ESC, SHIFT, ALT, CTRL

stable forge
stable forge
errant geode
#

Ok, so i basically need to chenge the library function to remove ascii conversion and treat all keys like 'special characters', meybe this will help. I am trying to create language specific keyboard, so i guess this is the case. Anyway, thaks for help, now i know where the problem is.

stable forge
errant geode
stable forge
#

well, that would do it too 🙂

river pulsar
#

I'm using Mac OS X 15.0.1 on an M1 MacBook. When I connect my Macropad to the USB-C port nothing happens. ArduinoIDE does not show the new port I'm expecting to see for Macropad. I'm almost certain, the issue is caused by the OS but I'm not sure how to make it work. What am I missing?

river pulsar
#

I think I fixed my problem - at least for now - by launching the IDE from Terminal.

civic jungle
#

I have a question about the DRV2605 library- is it possible to use it to control I2C output on pins that aren't designated for I2C? I want to control multiple drivers independently from the same board. I imagine the setup would start something like this but I don't know where to go from here or if it is even feasible.

#include <Wire.h>
#include <SPI.h>
#include <Adafruit_DRV2605.h>
Adafruit_DRV2605 drv1;
Adafruit_DRV2605 drv2;
TwoWire DRV1wire(D1,D2);
TwoWire DRV2wire(D3,D4);
void setup() {
drv1.begin(&DRV1wire);
drv2.begin(&DRV2wire);
}```
north stream
#

If so, an ordinary Arduino only implements one hardware I2C bus, on a fixed set of pins. If you wanted to use that, it would be one of your I2C buses. Then you'd need a software I2C implementation for your other bus(es). Additionally that software I2C would need to be compatible with the DRV2605 driver (I expect this is possible but I haven't investigated it). Assuming all that is true, your code might look something like this: ```arduino
#include <Wire.h>
#include <SoftWire.h>
#include "Adafruit_DRV2605.h"

#define SOFT_SDA D3
#define SOFT_SCL D4

static Adafruit_DRV2605 drv1;
static Adafruit_DRV2605 drv2;
static sw1(SOFT_SDA, SOFT_SCL);

void setup(void)
{
Serial.begin(9600);

if (!drv1.begin()) {
Serial.println("DRV2605 #1 not found");
for (;;) {}
}

if (!drv2.begin(&sw1)) {
Serial.println("DRV2605 #2 not found");
for(;;) {}
}
}

civic jungle
#

Yeah something like that would be perfect. I'm running the Nano 33 BLE Sense Rev2 and tried the SlowSoftI2CMaster library that's recommended for it, but the way it sets up the twowire pointers isn't the right type to feed into to the DRV2605 functions. So what I wanted to know was whether the DRV2605 library running on the arduino is capable of handling the communication itself without another soft I2C library

#

The .begin() function only accepts pointers to TwoWire but the softI2C implementations I've seen all create their own special types

north stream
civic jungle
#

Do you think there would be an easier way to run multiple drivers than this?

north stream
#

It depends on your definition of "easier". One approach would be to use an I2C multiplexor and just have each DRV2605 on its own sub-bus.

civic jungle
#

One that doesn't require additional hardware (beyond wires and such basics)

north stream
#

What I'd probably do is copy the entire AdaFruit driver, and modify it to accept and use the objects that SlowSoftI2CMaster creates. I'm guessing it would only involve changing a few lines of code since the AdaFruit driver already abstracts the communication into two routines that actually do the I2C reading and writing.

civic jungle
#

I'll try that, thanks

civic jungle
#

Do you think it would work if I just created a TwoWire that points to the same pins as the SoftI2C object?

#

Rather than go all the way down to change it in the class

civic jungle
#

I wonder if slowsoftI2C will even pick up the commands from the drv... really not sure how that lib even works

jolly cloak
#

Project description: I watched a video [YouTube link: https://youtu.be/Bicjxl4EcJg?si=mHz] anhttps://github.com/chromalock/TI--32/].

I want to create a similar project but with lower costs. It's about bringing ChatGPT to a handheld calculator like the TI-84.

I want the calculator to have features like

Color
Animated
Multi-page responses
Chat history from
A larger menu (only 320x240 resolution
Support for lowercase characters and "Vietnamese" language
Documentation
Basic
HTTPS
Sending and reading emails
Wi
Video play
I need your advice to help me complete this project, specifically on programming and the electronic components that need to be purchased. I'll exch Gmail

Can you help me? I beg you, if you can, I will pay you.

don't let any of your teachers see this.

Keith Sachs: @KeithSachs
github: https://github.com/chromalock/TI-32/
patreon: https://patreon.com/ChromaLock

:)

▶ Play video
north stream
north stream
north stream
civic jungle
#

TwoWire is a type from the arduino core <Wire.h> to specify a pair of pins for communication. The adafruit drv2605 lib is built to use it specifically, but I'm not sure if that's just an easy way to pass a reference to a pair of pins, or if the drv2605 lib actually needs some specific function of TwoWire to work

north stream
quaint nebula
#

Idk what’s happening

#

Arduino was working just fine last night till like an hour later and it recognizes my ports n such but like

#

Nothings happening

#

It goes for both the nano and uno

#

Anyway to fix this

civic jungle
#

Did you change the wiring at all?

quaint nebula
#

Yeah

#

And purchase new nano’s

#

I’ll try changing the wiring again

limber blaze
#

So I'm having a weird problem with Arduino (1.8.19) and my QTPY ESP32-S2. I plug it in, and I get the Windows tone indicating a device has been discovered. I then select the port (COM9) inside Arduino. If I open Serial Monitor, I can see the output which the Sketch is generating, so that seems right. I then go to upload the code (by simply hitting CTRL-U or Sketch->Upload). After compiling (which seems like it takes FOR-EV-AR), the output window displays an error stating that "A fata error occurred: Could not open COM9, the port doesn't exist". If I try to open Serial Monitor again, I get a new error stating "Error while setting serial port parameters: 115,200 N 8 1". If I press the RST button on the board, I get the Windows chime for device disconnected, then a few seconds later the Windows chime for device connected. Sometimes after that point, the device will shift down to COM 7, but the same behavior happens again. Any ideas?

#

Occaisionally, it will actually complete the upload (I haven't figure out yet what "state" to leave the board in such that it actually works when I try.. But upon completing the uplload I AGAIN get an error when it tries to "Hard resetting via RTS pin...", of "Board at COM9 is not available."

north stream
#

Windows will reassign ports every time a device re-enumerates.

leaden walrus
#

which, for the ESP32-S2, will happen with every new sketch upload, since that board has native usb

limber blaze
#

Awesome, thank you very much @cater!

#

But it doesn't specifically call them, for example, "D3".

#

So if I'm trying to do a digitalRead from GPIO 18 on the QT PY, would that be "D18" in Arduino?

leaden walrus
#

@limber blaze just 18 in arduino, no leading D

limber blaze
#

That worked perfectly! Thank you!!

limber blaze
#

If I need to use ADC1_CH6 as an analog input, how would I refer to that in Arduino? ADC1_CH8 is "A2" in Arduino, as is shown on the image, but I don't see what I'd call CH6?

leaden walrus
#

@limber blaze ADC1_CH6 = A4

limber blaze
normal goblet
#

Hello, I have a question regarding the DS3231 RTC (ADA3013). I have this module connected to Arduino Uno R3 as documented on the product page. The temperature reading seems off. I test this with the provided Arduino example code, and compare to thermocouple measurement. The difference is 6 degC. I understand that a difference is expected, but this seems a bit excessive. How can I verify proper workings of RTC? Thanks.

inland gorge
normal goblet
inland gorge
# normal goblet Hi, am I mistaken that the DS3231 contains a temperature sensor? See line 114 h...

My apologies, you are correct. I just verified from the DS3231 datasheet that it has the those registers. It also says it’s accurate to 0.25 degrees C and measures the temperature every 64 seconds.

How close is your DS3231 board to other devices? Things like microcontrollers, voltage regulators, & LEDs can produce local heating that will be higher than ambient. Perhaps that’s what you’re seeing? But I agree that 6 degrees higher is strange

normal goblet
#

It is at approx. 50 cm of an active Arduino, and so is the thermocouple (via MAX31855) I used to compare readings. Apart from that, only an SD module (breakout, ADA254) is connected to the Arduino. Hence I am confused.

Again, I would find a temp. difference of 1-2 degC understandable, but not 6 degC. I will test again by moving the arduino further away.

Update: issue persists.

tardy iron
tardy iron
normal goblet
#

I have checked this just now. Temp.diff. is now a bit smaller, but still 4 degC. This is stretching the expected combined accuracy of RTC and thermocouple.

Could it be that the RTC chip just gets very hot? If so, what would cause this? Possible defect, or something else?

eternal cloud
tardy iron
eternal cloud
#

Between +- 3C accuracy of the ds3231 temp sensor and whatever accuracy your thermocouple has, the difference makes sense. Better to get a separate high accuracy temp sensor if needed.

normal goblet
#

Thanks all. I guess it is not a big deal as long as the time is kept properly. I have the thermocouples anyway.

Thanks again 👍

oblique nova
#

(Just in case anyone stumbles on this in future) amazingly, just adding the .fuse section to the generated hex file does the trick.

obj-copy -j .text -j .data -j .fuse -O ihex file.elf file.hex
pymcuprog -t uart -u /dev/ttyUSB0 -c 230400 -d attiny412 --verify write --erase  file.hex
leaden walrus
#

i think so. was doing something like that a few days ago.

#

in the context of a bootloader, but can ignore that part, the info about hex/fuses is generic.

oblique nova
#

Makes sense. I was able to get the info into the elf file, but missing the (in hindsight) simple way to flash the device with pymcuprog

leaden walrus
#

can also set them specifically

#

ex:

pymcuprog write -t uart -u /dev/ttyUSB0 -d attiny1616 -m fuses -o 8 -l 8
#

-o = offset (fuse of interest) -l = literal (the value to set fuse)

oblique nova
#

Ack - I was trying to avoid doing this, and the fuse.h trick looks perfect

leaden walrus
#

yep. if you want it to be in the hex, then ignore.

#

but useful to know for lower level troubleshooting, etc.

#

can also read them

upper wraith
#

Using PID_v1_bc lib to control 12 VC motor with Hall_Effect/Encoder. Not used to PID. Try to control rotational speed and positions. I want to just go from current position to another location, slowly, delay some then go to another position, slowly --- as an example. Any ideas?

short kraken
#

Hi I am trying to make my bmp280 work with Arduino Uno, through I2C possibly. Unfortunately it never detects the sensor. I am using the newest version of the library but I also tried older versions. Searching online I tried to change the address from (0x77) to (0x76) but it still won't work at all. As anyone succeded in working with it? Did you have the same problem?

upper wraith
short kraken
#

Yeah I have run an I2C scan and it won't find any device either... I changed all the wires and tried with another sensor which works fine

restive roost
# restive roost Heyy, I'm working on a big led matrix project 192x16 for my school and I'm havin...

Fixed.
In case anyone faces the same issue
Solution was initializing the matrix using simple parameters (I used NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE), then I made a 192x16 array and I manually rewrote each index in that array (basically dealing with it as a strip from 0 to 3071) to match the parameters I used then I wrote a function that takes XY cords, puts them into the array and gives back the correct index and used that function on my matrix with .setRemapFunction().

livid osprey
short kraken
#

This is my wiring:
GND-GND
5V-Vin
SCK-A5
SDI-A4

livid osprey
# short kraken

The header pins need to be soldered to the breakout board to ensure a stable electrical connection. Simply placing them in the rings is not sufficient.

short kraken
#

Thank you so much for the answer ☺️, I’ll try the cables and then I’ll try soldering them

leaden walrus
#

yep. that stemma qt cable will give you a solderless option.

wet drift
upper wraith
#

Found a really cool tutorial on PWM/PID DC motor control and modified it with an H-298 Bridge!

stable forge
#

D1 and D2 should have identical functionality.

#

Make sure you have set the Arduino board to the Reverse TFT S3 Feather

wet drift
#

I tried checking the voltage but am not seeing anything. Probably doing it wrong. First off should I need to press the button to check? Hard to do with only two hands. Second can I check the two legs on the screen side or do I need to check across? I can see a little voltage in the D0 but nothing in D1 or D2

Ive test D1/D2 with other things and they do work identically which is why this is very confusing.

Yes my board is correct.

@stable forge

ivory ridge
#

looks good

stable forge
frosty swan
#

Hello, everyone. I have a problem with the sensors BME280 and SHT31.

Why does SHT31 have so different results than BME280 according to RH?

The gap is within 10RH. In addition, I'm using a extractor with both sensors, so both have a good airflow, they are in the same environmental conditions.

I've checked the encapsuled and it says SHT31 DIEF2s.

Help me please, I have three sensors of each (3 of SHT31 and 3 of BME280) and all of them have the same results.

Also I've tried with different libraries I've tried with the Adafruit library ( <Adafruit_Sensor.h>
<Adafruit_BME280.h> and "Adafruit_SHT31.h")for both and SensirionI2cSht3x.h for just STH31, and with the last one I've tried with all the types of SHT3x, because you know with unofficial sensors you never know. Even though, I've tried in both Arduino and RaspberryPi2, both have the same results, the same gap.

Here you are, all SHT3x sensors that SensirionI2cSht32.h supports, I've tried all and all have the same results.

I'll give you some images of the sensors.

As you can see the temperature, it is not a problem but humidity is.

Just I want to know why this is happening.

#

BME280Results.

#

SHT31Results.

#

Both are within a carton box and a extractor (a fan).

stable forge
# frosty swan Hello, everyone. I have a problem with the sensors BME280 and SHT31. Why does S...

Here are six humidity sensors at once:

ahtx0.temperature=23.2973, ahtx0.relative_humidity=44.8426
bme680.temperature=22.9093, bme680.relative_humidity=50.1364
htu21d.temperature=22.1982, htu21d.relative_humidity=47.3485
htu31d.temperature=22.3342, htu31d.relative_humidity=50.3777
sht31d.temperature=22.3403, sht31d.relative_humidity=56.9253

I couldn't use the SHT31D and SHT4x together (they share an I2C address)

ahtx0.temperature=23.6088, ahtx0.relative_humidity=44.2345
bme680.temperature=23.0068, bme680.relative_humidity=49.6986
htu21d.temperature=22.1982, htu21d.relative_humidity=47.257
htu31d.temperature=22.3342, htu31d.relative_humidity=50.4341
sht4x.temperature=22.6714, sht4x.relative_humidity=53.5369
#

but these readings are within a minute of each other. As you can see the SHTxx sensors tend to read higher than the other, but even, so there is a wide range

#

This is in CircuitPython but the Arduino results you are seeing are similar.

#

The differences are probably due to the sensors not being conditioned to be more accurate. I gave links to multiple forums threads that talk about that.

frosty swan
#

Okay.

#

Thanks.

low gate
#

If I wanted to basically replace (what is currently) serial communications on an arduino (RP2040 Connect) with a websocket, how would you do it? Is there a way to just redirect / overload existing serial functions or do I need to replace everything?

north stream
low gate
quick hill
#

Hello there,
I need some help with flashing an SAMD21G18A board.
I am unable to connect to the board with my dapl-ink usb programmer.
Can someone help me debug this issue?

limber blaze
#

Has anyone ever tried connecting a QT PY ESP32-S2 to a RFM69 radio via SPI? I'm attempting to do so, and when I try to compile the RadioHead rf69_client example, I get errors regarding timers. I've got MOSI, MISO, and SCK connected as required; G0 is connected to A2, CS to A3, and RST to A4(SDA).

errant locust
#

Having trouble with the Adafruit seesaw library. Working in VSCode with PlatformIO. Have tried 3 different boards - qtpy2040 (my actual target), pico, and esp32s2 feather. With all of them, if I just install the seesaw lib, I get an error that it can't find Adafruit_I2CDevice.h. Which is of course in Busio, which gets installed as a dependency, but doesn't seem to be on the search path. If I manually install Adafruit Busio in the platformio.ini, it finds the above, but then can't find both SPI.h and Wire.h, both of which would seem to be located in the Arduino core from what I can tell. Any ideas what I'm doing wrong? I'm relatively new to Arduino, but the loop timing in CircuitPython is too coarse for accurately driving a 2208 stepper driver, so I'm biting the bullet and trying to learn something new. 🙂 edit: I moved to the Arduino IDE instead of PIO, and everything works as expected. I'd still like to understand what was going on, so please do answer if you can.

errant locust
#

Next question: in CircuitPython I used microcontroller.nvm to store small configuration values in order to persist current settings after reboot. Is there a similar method in Arduino for the 2040? Google is being strangely silent on the topic.

north stream
errant locust
north stream
#

I'd guess so too, but I haven't looked at the source code

upbeat cairn
#

I have an Ada fruit itsybitsy here that never once illuminated any LEDs from the moment we pulled it out of the box. We’ve tried different cords, different ports, different computers. Same outcome every time:

#

The drivers for this device are not installed. (Code 28)

There are no compatible drivers for this device.

To find a driver for this device, click Update Driver.

#

I asked chat gpt about it and it said that clicking the button on the board twice should force bootloader mode, however nothing happens except abrief disconnect from the pc

north stream
#

DFU looks like it's in device firmware upgrade mode. You may want to email support@adafruit.com as the chip may not be flashed with a bootloader.

upbeat cairn
#

And that would have no leds?

#

I assume that means yes. Thank you!

stable forge
upbeat cairn
#

@stable forge Could I use a spare arduino uno I have laying around to install the bootloader? If I open a form post will I be distributed a bootloader to install?

#

I'd prefer to just fix this myself in a timely manner instead of begging adafruit to issue me a new board.

tardy iron
upbeat cairn
#

I definitely don’t have experience and would need a walkthrough. Any YouTube videos you might suggest?

#

I can take the risk, the board is cheap. There’s only one way to learn these things and that is to just do it.

tardy iron
upbeat cairn
#

Can you define logic levels?

tardy iron
#

from the photo, it looks like you have the 5V ItsyBitsy32u4, so you're probably OK with an Arduino Uno, but it's good to double check

stable forge
upbeat cairn
#

If you could help me resolve the issue tonight that would be best

stable forge
#

you can use Arduino IDE to install the bootloader

upbeat cairn
#

Ok I'll give that link a go

#

The ISCP pins on the uno are obvious, but I can't find what pins to use on the itsybitsy

upbeat cairn
#

Would I have to send the old board to request a replacement? What does that process look like? It would be nice to have a spare for my trouble even if I can somehow fix this one. We are building a melty brain battlebot based on the openmelt V2 project on github.

#

I have an exam to study for, so I think I'm gonna have to give it up for tonight... 😔

#

Thank you so much for your help

tardy iron
stable forge
mental adder
# upbeat cairn If you could help me resolve the issue tonight that would be best

If you'd rather not wait for shipping, and happen to have a Micro Center nearby, you can also purchase a replacement from them. They're an Adafruit distributor with brick-and-mortar retail locations.

upbeat cairn
#

Hmm nearest one is 2h... I'll think about it.

stable forge
#

no charge to you

mental adder
stable forge
#

could pay for fast shipping

stable forge
upbeat cairn
#

My teamate ordered it, so I will have to reach out to them to post in forms i think

stable forge
#

post now and I'll authorize it and you can start corresponding with support about it

#

If it were a gift, for instance, we'd still replace it, and if we have the teammate's email, we could look it up

#

but it's not that hard to reprogram yourself if you want to start working on it while waiting for the new one

upbeat cairn
#

Ok posted

stable forge
upbeat cairn
#

Email sent. Tysm

tardy iron
upbeat cairn
#

I sent a follow-up email

onyx junco
#

So I have Adafruit ESP32-S2 Feather with BME280 Sensor I have code running on it that takes the sensor readings and sends it up to the cloud and then goes into a deep sleep for 30 minutes. I want to make some changes to the code but I unable to get connected to the ESP32 with the Arduino IDE before it goes to sleep again. Any way I can make it stay awake for me to connect to it?

leaden walrus
#

comment out the sleep part of the code while adding in the new stuff

onyx junco
#

lol ... Yeah that's what I wanna do but I can't get into upload the new code ... It's like whack a mole

#

Hmmm .... Is there a way to put it into a boot loader mode?

#

@leaden walrus Any ideas?

leaden walrus
#

yep. try double pressing reset.

#

or can hold BOOT button for ROM bootloader.

#

double press if UF2 bootloader installed

onyx junco
#

UF2 is not there as I'm using Arduino code

leaden walrus
#

UF2 is a secondary bootloader

#

it's there even if arduino

onyx junco
leaden walrus
#

yah, i think so. arduino will add the bootloader with each upload.

#

it's even one of the ways to "repair" the bootloader

#

(the UF2 bootloader)

#

ROM bootloader = the one baked into the ESP32-S2, should always work

#

UF2 bootloader = just firmware, so needs to be loaded

onyx junco
leaden walrus
#

either bootloader mode should work

#

to force a new sketch upload

onyx junco
leaden walrus
#

try ROM boot then

#

ROM boot only provides a serial interface

#

so there will be no folder that shows up

#

so will need to look for a COM port

onyx junco
# leaden walrus try ROM boot then

Thanks - I got it into ROM bot and was able to get the code uploaded.

Hash of data verified.

Leaving...
WARNING: ESP32-S2FNR2 (revision v0.0) chip was placed into download mode using GPIO0.
esptool.py can not exit the download mode over USB. To run the app, reset the chip manually.
To suppress this note, set --after option to 'no_reset'.```
#

But now I cant get the code to work/run ? I've unplugged it and tried resseting it no nothing seems to work

leaden walrus
#

may need to hit the reset button to get code to run

#

that's what the warn is about

onyx junco
onyx junco
onyx junco
#

All working fine now - Thanks for help @leaden walrus

wild hinge
#

Hello, I need your help. I recently ordered a batch of stepper motors (42BYGH23-A-21DH) that I want to control with an Arduino Uno. I have a stepper motor driver A4988. When I make the connections and use code from the AccelStepper library, the motor barely turns or doesn’t turn at all.

I tested the connections by finding the coils using the resistance function of the multimeter. I tried adjusting the potentiometer on the driver board, but I always get a reading of 0.6V, whether I turn it or not.

Do you have any suggestions for me?

eternal cloud
wild hinge
#

It’s a 12V 1A power supply

north stream
#

Are these 4 or 6 lead motors? How is your A4988 connected? Is it on a carrier board? Note that the SLEEP, ROSC, RESET, ENABLE, and VREF connections all need to be configured correctly. If it's not on a carrier board, you also need to hook up the various other pins for power, current sensing, etc.

urban tapir
#

I have a project using a Feather M4 with CAN. I use arduino-cli. I have been using the "CAN Adafruit Fork" library, and it works fine. But when I go to the support web page and click on the repo, it says:

This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

I am trying to figure out what is the main/best version of this library (with the same API, where I #include <CAN.h>, etc.) that I can download with arduino-cli lib install.

"Adafruit CAN" isn't the same API. the library just called CAN, aka github.com/sandeepmistry/arduino-CAN (I think)
works for me and isn't read-only or called "fork."
But I think both are old. Does anyone know which is better, or whether there is a third one that is more mainstream or maintained?

#

Oh, the lib just calledCAN compiles my sketch, but doesn't run (I haven't checked for diffs yet), so I'm back to "CAN Adafruit Fork." Is there a repo that's not archived?

icy dome
#

hey there! nice to meet you guys 🙂
I've a question about neopixel library. I soldered my sk6812 on my pcb and just want to make them light. but this doesn't happen.

my code is this:

#include <Adafruit_NeoPixel.h>
#define PIN 5
#define NUMPIXELS 18
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRBW + NEO_KHZ800);

pixels.begin();
pixels.setPixelColor(0, pixels.Color(255,0,0)); //RGB
pixels.setPixelColor(1, pixels.Color(255,0,0));
pixels.setPixelColor(2, pixels.Color(0,0,0)); //off
pixels.setPixelColor(3, pixels.Color(255,255,0));
pixels.setPixelColor(4, pixels.Color(0,0,0)); //off
pixels.setPixelColor(5, pixels.Color(255,255,0));
pixels.setPixelColor(6, pixels.Color(255,255,0));
pixels.setPixelColor(7, pixels.Color(255,255,0));
pixels.setPixelColor(8, pixels.Color(255,255,0));
pixels.setPixelColor(9, pixels.Color(255,255,0));
pixels.setPixelColor(10, pixels.Color(255,255,0));
pixels.setPixelColor(10, pixels.Color(255,255,0));
pixels.setPixelColor(11, pixels.Color(255,255,0));
pixels.setPixelColor(12, pixels.Color(255,255,0));
pixels.setPixelColor(13, pixels.Color(255,255,0));
pixels.setPixelColor(14, pixels.Color(255,255,0));
pixels.setPixelColor(15, pixels.Color(255,255,0));
pixels.setPixelColor(16, pixels.Color(255,255,0));
pixels.setPixelColor(17, pixels.Color(255,255,0));

for(int i=6;i<10;i++){
for(int i=10;i<14;i++){
for(int i=14;i<18;i++){
pixels.show(); }

#

I don't know where I'm wrong

#

thanks to who will reply 🙂

eternal cloud
icy dome
#

Thanks

limber blaze
#

Good day, friends! I'm trying to get an Adafruit QtPy working with the Audio BFF. I followed the directions here: https://learn.adafruit.com/adafruit-audio-bff/arduino ... when I try to compile the example sketch that's included in the library, I get an error stating that the I2S.h file is missing. I looked in the entire Libraries folder, and indeed didn't see that header anywhere!

Pump up the jams with your new BFF

#

I even went back and verified that each and every library dependancy was installed. Red cross-lines indicate the library was already installed:

#

I also found a library I thought might be the "missing link", "Adafruit Zero I2S Library", and installed that, but that didn't seem to fix anything.

limber blaze
stable forge
eternal cloud
stable forge
#

It will compile with QT Py RP2040 (as mentioned in the guide), but not with ESP32-S2.

#

i was looking at the same thing. but the API is different

#

(I2S.h vs ESP_I2S.h)

eternal cloud
#

So, different example code needed? for bff with the esp32 qt py boards

stable forge
limber blaze
#

Hm. I changed the include, but now it's having an error at:
I2S i2s(OUTPUT);

qtpy_audio_bff_example:10:1: error: 'I2S' does not name a type
10 | I2S i2s(OUTPUT); // I2S peripheral is...
| ^~~

stable forge
limber blaze
#

That's not simple! lol

sullen loom
#

Hello everyone, I'm working with an Adafruit TRRS Jack Breakout Board (https://learn.adafruit.com/trrs-jack-breakout/pinouts) and need to detect when a plug is inserted. For testing, I’m trying to turn on the ESP32’s internal LED when the plug is connected and turn it off when it’s removed.

The breakout board has RSw and LSw pins, which are described as floating when the plug is inserted. I’m unsure if I need to use both of these pins for reliable detection. I’ve experimented with connecting the Left and Right pins through two 10K resistors, followed by a 100nF capacitor to block DC. However, I’m experiencing inconsistent results; the LED sometimes stays on even after removing the plug.

Any suggestions for improving detection accuracy would be much appreciated. I attache the code I'm using when I use the Left and Right pins.

`const int ledPin = 2; // Built-in LED on ESP32
const int trrsPin = 34; // TRRS pin to detect connection

void setup() {
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
pinMode(trrsPin, INPUT_PULLUP);
}

void loop() {
// Check the state of the TRRS pin
if (digitalRead(trrsPin) == LOW) {
digitalWrite(ledPin, HIGH); // Turn the LED on
Serial.println("Aux cable connected");
} else {
digitalWrite(ledPin, LOW); // Turn the LED off
Serial.println("Aux cable disconnected");
}

delay(100);
}`

Add a modern stereo + mic plug to your project!

north stream
sullen loom
rich cove
#

Hi everyone!
I'm trying to light a single SK6812 RGBW https://www.adafruit.com/product/2760, using an NodeMcu Wemos ESP32 D1 Mini on GPIO16.
I've sucessfully lid a WS2812B RGB using GPIO16 inbetween testing, and this works every time.

But I've tried 6 different SK6812 now, and none of them will react in the slightest. (3x https://www.adafruit.com/product/2760, 3x https://www.adafruit.com/product/2758 )

Right now I'm trying through WLED, where I've selected "SK6812/WS2814 RGBW" and GPIO:16, but still nothing.

ESP32 and LED have shared ground.
I've tried both stable and newest versions of WLED.
I've tried the RGBWstandtest through Arduino IDE.

Any help is appriciated ❤️

north stream
north stream
icy dome
#

hey there!
I've a question: I've a 18 Sk6812 leds chain and 18 momentary pushbuttons, I created an animation for the chain and I would like that for every button I press, it will change the color of the animation or the animation type
I'm using arduino leonardo (pro micro) and FastLED library

#

thanks to everyone who would answer to this! I can post the code if needed 🙂

north stream
#

Do you want each button to change a specific thing, or any button press to just choose a new animation?

icy dome
#

each button change the animation

#

or simply the led color

#

thinking better, I would change the leds color

north stream
#

You may be able to hook all 18 buttons in parallel, then connect them to a single GPIO pin

icy dome
#

they are already connected to a single pin