#help-with-arduino

1 messages · Page 18 of 1

eternal cloud
#

@ornate dust Since this is arduino talk, better moved here I guess

How are you getting nowhere? What happens? What doesn't happen? What errors do you get in serial?

ornate dust
#

so i have the device pluged into the computer. Arduino IDE sees the device after going throught the steps to add it for devices. When i upload the code i change my parameters for my display, which by my understanding is changing two numbers, but then i get an error with 'arduino_GFX_library.h' is missing. I dont know how to resolve this since it is my very first use with circuit.py and displays. the only code i have been able to write was a modification of blink.

eternal cloud
ornate dust
#

okay

#

just did that it is patching

eternal cloud
#

and then you need to install the other library by hand, ESP32_JPEG

ornate dust
#

okay would u walk me through that pls

eternal cloud
#

green "Code" button on the main page, and do download zip

ornate dust
#

alright

eternal cloud
#

in arduino ide do this, and it should install it

ornate dust
#

okay done

#

done indexing

eternal cloud
ornate dust
#

okay

eternal cloud
#

I didn't actually work with the Qualia displays, so I'm not sure, but I think you only need to change the display resolution to your own ... i'll look into it a bit more

ornate dust
#

alright

eternal cloud
#

meanwhile, did you create your video file like the guide says, and placed it in a /videos folder on the sd card ?

ornate dust
#

yes

#

where can i see the file location for my .ino file to add the .h file to the same location

eternal cloud
#

You can download both files from github somewhere, and then open that .ino in the ide
Or create a new sketch, copy paste the code, and do "save as"

Location of the project doesn't matter, so you can make a folder on desktop if you want

ornate dust
#

alright now the .h file is in the same location as the .ino file

eternal cloud
#

ok

#

so looking at the code, it seems like you need to change MJPEG_OUTPUT_SIZE

ornate dust
#

nvm i have changed that to my display resolution

#

and when i verify i am still geting this error.

eternal cloud
ornate dust
#

alright

#

i have add those and it still has the same error

inland gorge
#

I think it wants the Arduino GFX Library (known frustratingly as GFX Library for Arduino in the Library Manager)

ornate dust
#

ran into another error but add the according library for it and now it is verifying

eternal cloud
#

Where it does new Arduino_RGB_Display in the code, you need to change the parameters there to

    720 /* width */, 720 /* height */, rgbpanel, 0 /* rotation */, true /* auto_flush */,
    expander, GFX_NOT_DEFINED /* RST */, hd40015c40_init_operations, sizeof(hd40015c40_init_operations));

and for new Arduino_ESP32RGBPanel( you need to change some parameters to

    1 /* hync_polarity */, 46 /* hsync_front_porch */, 2 /* hsync_pulse_width */, 44 /* hsync_back_porch */,
    1 /* vsync_polarity */, 50 /* vsync_front_porch */, 16 /* vsync_pulse_width */, 16 /* vsync_back_porch */

see https://learn.adafruit.com/adafruit-qualia-esp32-s3-for-rgb666-displays/arduino-rainbow-demo and look for 4.0" 720x720 round display

ornate dust
#

okay

eternal cloud
#

This should get it to work, if the GFX is sorted 🙂

ornate dust
#

alright it completed verification but i will make those changes now

#

changes complete and it didnt break now i just need to wait for it to reset and try it

eternal cloud
#

Alright, fingers crossed!

ornate dust
#

how long does it take for it to reset via usb

eternal cloud
#

it's an esp32 s3, the chips have some issues with resetting ... you need to manually press reset after you upload your code

ornate dust
#

IT WORKS!!!!!

#

thank u so much for your help

eternal cloud
#

yes! 🎉 awesome! 🙂

covert lintel
#

back with more metro questions... my project gets a lot simpler if I can run the metro 328 off of 12v power. The Adafruit website says 7-9v power, so I guess not. But then the fact sheet lists 12v as the max power for its power jack. Any chance I can power this off 12v without lighting it on fire?

eternal cloud
#

How would the project get simpler to power from 12V tho ?

covert lintel
#

o7

covert lintel
#

I'll just use the second battery like in my original layout

eternal cloud
#

and the logic output from the pwm pin would still be the same

#

so separate power supply / battery is needed anyway

covert lintel
#

hmm. Yeah I'm still trying to wrap my head around this whole thing before I plug any power supplies in lol

#

trying not to fry my board

#

the MOSFETs connect the gate pin to a microcontroller input, but then... does that connection need a grounding wire to run current? Will it work with just the normal 3.7v microcontroller power and ground?

eternal cloud
covert lintel
#

The problem is that it's running off 9v power through the microcontroller, but the Metro can't handle the 9-12v my lights need to work

#

So instead of running that top power line from my microcontroller to the LED power input, I'm running power directly from a 12v battery to the LED

#

except that means there's no loop from the MOSFET gate pins to the microcontroller to a ground

#

do MOSFET gate pins output a full 12v?

#

AI assistant says they're outputting less, but that guy hallucinates all the time so I usually want a second opinion

#

wait this is something I can just measure with my multimeter, maybe

#

Hmm, not getting anything...

tardy iron
covert lintel
tardy iron
covert lintel
#

the only thing that 12v battery is powering right now is the lights. It's not running power to anything else

#

would the gate input to the MOSFET work without it? Or do I need to find a way to run a 12v ground through my Metro?

tardy iron
covert lintel
#

I think I might understand - it needs to be grounded, but if I run a ground from the Metro to the 12v battery, with only the MOSFET gate channel connecting it to the positive of that 12v circuit, it can run the gate without taking 12v of current?

tardy iron
#

you can hook multiple power supplies to this sort of circuit as long as they share a ground (caveat for supplies that are grounded in unusual ways, but most DV supplies you’re likely to use are either floating or grounded to earth)

tardy iron
tardy iron
#

you should have a pulldown resistor between the gate and source to keep voltage from building up on the gate due to leakage when the Metro is off, but it’s often omitted in prototypes

covert lintel
covert lintel
tardy iron
tardy iron
# covert lintel ...huh

if it’s always connected to a GPIO, maybe the pin protection diodes will take care of that well enough

covert lintel
#

where would the resistor go here

#

the only connection between those circuits is... the microcontroller ground? And the MOSFET itself

#

uC is the microcontroller in the bottom left, don't know if that's legible

tardy iron
# covert lintel

can you label the terminals? i have no idea what the pinout of your FET is

covert lintel
tardy iron
# covert lintel

also your battery terminals: which one is positive? and what MOSFET are you using?

covert lintel
#

The positive one is the one running from the battery to the LED. The MOSFET I'm using is.. one sec

tardy iron
# covert lintel

i think you have drain and source hooked up bakcwards in that diagram

covert lintel
#

ah, you're right

#

there we go, thank you

#

where would the resistor go, then? The one between gate and source

tardy iron
covert lintel
#

I just plug one in there, like this?

tardy iron
covert lintel
#

oh right I forgot I swapped them

tardy iron
#

i think some sources recommend 1M?

covert lintel
#

like so?

#

gotcha

#

thanks for the tip

#

and now I know I can ground my metro off the gate pin without lighting any electric fires

spice jungle
#

Using the trinket MO can the c++ from the IDE "talk" to a python program that's saved in the Python space?

vital lodge
#

This looks like more detailed build instructions.

#

(looking at this more, there's got to be a better, more compact project.)

north stream
north stream
vital lodge
#

Thank you!

stray narwhal
#

Hi, I got an ESP32 NodeMCU board with an ESP32-WROOM-32 from a workshop but didn't manage to get to the sessions. I couldn't find a bin file for this specific board to setup circuit python. I am trying to install circuit python so that I can use my adafruit SCD40 sensor. I haven't done microcontroller projects in ages. Can anyone lead me to the correct bin file and any examples or guide to do this? I guess I will need to use arduino instead of circuit python for this board.. but how can i connect to my adafruit scd-40?

#

Thank you!

eternal cloud
spice jungle
eternal cloud
spice jungle
#

I'm running c++ code.

eternal cloud
spice jungle
#

It doesn't exist yet. It may not be possible to do this. Why I'm asking.

#

Just looking for out of the box solution to saving parameters in c++.

#

And how in the world does one "build" a cat?

eternal cloud
# spice jungle It doesn't exist yet. It may not be possible to do this. Why I'm asking.

It's not possible.

And I'm assuming what you mean is that CircuitPython running on a Trinket M0 creates a USB mass storage device and uses a flash file system.
That is not available in Arduino, but there are various libraries that do flash storage, look into that.

If you are not using Arduino, but bare metal C++, you need to look in your SDK manual.

spice jungle
#

There is no flash storage one can use on a trinket MO

eternal cloud
fluid wagon
#

Good evening all! I received my ESP32-S3 feather today...assembled it, and now I am trying to figure out how to get the blink sketch working on it. These things have so many upload parameters so I am a bit confused.

#

Can anyone help me out with what the settings should be in the arduino app to get this going? Thanks

eternal cloud
fluid wagon
#

I have done that,

#

I am trying to do the original blink sketch, and well...having issues

eternal cloud
#

What issues ?

fluid wagon
#

I upload it, and the MCU keeps rebooting

eternal cloud
#

oh, the S3 issue

#

A lot of ppl have it, I think it's a bug in the last board package

#

Change it to a previous version

fluid wagon
#

This is the backtrace I get from the ddebug port

#

(Using the exception decoder)

eternal cloud
#

Try changing to 2.0.17

fluid wagon
#

So this is a known issue? I am not an idiot? 🙂

eternal cloud
#

I've seen it before a few times since they updated to 3 x x

fluid wagon
#

Yeah, went to the mailbox today "oooh, new shiny feather"...and tripped face first loading blink. Thought I was doing something wrong

eternal cloud
#

Hey, worst case scenario, shiny new feather works great with CircuitPython 😆

fluid wagon
#

I dunno, running an interpreted language on an MCU just...strikes me as odd 🙂

#

I havent looked deeply, but the interpeter itself has to have some level of overhead no?

eternal cloud
#

Doesn't have the performance of baremetal C for sure, but it's loads of fun

fluid wagon
#

Hooray! I can blink an led again!

eternal cloud
#

Awesome!

#

I dunno what espressif did in the latest arduino core, but a lot of people have this issue lately

fluid wagon
#

I have a huzzah32, and I am loving the debug port on this S3 feather...Was a great addition

#

My FTDI friend (with the mini usb port :P) works great for it

#

Ok, so I guess we wait for a new version of the board core and see if it works better 😛 Thank you for your assistance, I was getting pretty frustrated with myself that I couldnt get a "hello world" working properly.

eternal cloud
fluid wagon
#

One more question. Why does it keep changing its COM port?

north stream
#

It's not doing it, your OS is every time it enumerates

fluid wagon
#

Thanks winblows...is there a way to pin it?

north stream
#

There is, in Linux (udev)

fluid wagon
#

nods Why is linux better at everything, but we need to run windows for games? 🙂

north stream
#

Not for long, MICROS~1 is quietly replacing the underpinnings of windoze with Linux, so soon "windoze" games can run natively on Linux.

fluid wagon
#

I look forward to the day

deep lark
#

but also i think m$ and the oem got a cut so

north stream
#

MICROS~1 also went to a lot of effort to make their system advertiser-friendly, ensuring wide adoption

deep lark
#

they've been doing that since 1995

#

so eh

#

not to mention

#

many programs uses mfc which theres currently no linux adaptation for it

#

which means

#

these will have to be completely rewritten

lethal yarrow
#

And yes, Windows hotplugging has always been broken.

static sinew
#

hey all - working on some simple(ish) projects using ESP8266 and steppers. When the A4988 driver worked but resulted in LOUD movement, I ugpraded to TMC2208 drivers. And they're silent, all right - but 1/4th the speed??

#

from my read of the data sheet, leaving all the mode pins unattached (floating) should leave it at the default of full steps. I'm not trying to quarterstep or anything. And I've tried both driving it directly from a sketch with a loop, and using hte AccelStepper library. Either way, the A4988 drives the motors a lot faster, all else equal.

#

is there some kind of happy medium between a sound that travels through the house (conduction from being in direct contact with a wall) and operation so slow I may as well be using a wind-up key?

static sinew
#

OK upon checking another reference, looks like default is 1/8 step and we can get to 1/2 step by setting MS1 high. So that's a start, but still... do you have to use I2C to get it to full step mode?

north stream
#

It might be easier to modify the control circuitry to send steps faster.

static sinew
#

well there appears to be a limit on how fast the ESP8266 can send steps...

lethal yarrow
static sinew
#

OK, so how do I go about setting up a hardware timer without using software? I may be misunderstanding you of course. But a simple While loop compiles down pretty well, as I understand it, and my While loop only checks to see if a button (digitalRead) is still being pressed

#

I have one of those like $20 "oscilloscopes" I should maybe try and hook up to see what really happens as I crank the delayMicroSeconds value down but at a certain point the motors go all wiggy...

lethal yarrow
fluid wagon
#

When using "Arduino", you can switch back and forth between the underlying SDK and using the Arduino "shell" right? So if you were doing pin manipulation, you could use like the ESP-IDF or Pico SDK's methods inside an arduino sketch. Am I understanding that correctly?

#

Aside from how confusing that might get, of course.

lethal yarrow
#

Usually. You just have to be careful the the hardware you configure doesn't get changed by calling some random arduino API function.

#

A simple example would be where you reconfigure the timer used for millis(), and then calling millis() later on in your code.

fluid wagon
#

Right, I get it. Once I manipulate something "below" the Arduino API, I could no longer use Arduino APIs to touch that item.

lethal yarrow
#

Basically, yeah.

fluid wagon
#

That must get awkward when using Arduino libraries though...some rando library using millis() after you have changed something would be a pain to track down.

lethal yarrow
#

<-- has done this before

#

I've had to reimplement adafruit libraries before because they were either blocking my critical path or utilizing hardware that I needed for other purposes.

fluid wagon
#

I am just trying to work out in my head how to slowly take off the "training wheels" that Arduino API provides, without diving head first into a particular SDK.

lethal yarrow
#

Personally, I've found that full SDKs tend to be painful. I'd rather just have convenient register definitions and then implement my own abstractions to manage everything.

fluid wagon
#

Like, I've seen videos explaining how and why Arduino pin manipulation adds a bunch of overhead, and I understand the how and the why of it, but I also get how having arduino and the SDK fight would be terrible to keep track of.

lethal yarrow
#

Yep. Thankfully, GPIOs usually just have a small handfull of configuration registers, so those aren't hard to manage. Things get messy once you involve more complex peripherals such as serial ports, timers, and/or DMA channels.

static sinew
#

Well I finally got AccelStepper working, at least close enough for now - and it runs the servo more than fast enough, once you do some testing to determine what your max speed should be given the application.

#

It's clearly intended for slightly different use cases, given how the methods are laid out, but it does what I need it to for the current stage of the project.

humble anchor
#

Is this the way to use the two hardware SPI busses on the esp32s3?

#include <SPI.h>

SPIClass vspi = SPIClass(VSPI);
SPIClass hspi = SPIClass(HSPI);

// ... define MOSI, MISO, SCK pins for each bus
// ... define CS pins for each SPI device

void setup() {
  // Initialize SPI buses with specific pin configurations
  vspi.begin(vspi_sclk, vspi_miso, vspi_mosi, vspi_cs);
  hspi.begin(hspi_sclk, hspi_miso, hspi_mosi, hspi_cs);
  
  // ... other setup code
}

void loop() {
  // Communicate with device on VSPI bus
  vspi.transfer(...);
  
  // Deselect VSPI device and select HSPI device
  digitalWrite(vspi_cs, HIGH);
  digitalWrite(hspi_cs, LOW);
  
  // Communicate with device on HSPI bus
  hspi.transfer(...);
  
  // Deselect HSPI device (if needed)
  digitalWrite(hspi_cs, HIGH);  
  // ... loop continues
}```
rocky jay
#

Hello, I'm trying to get the following example code https://github.com/adafruit/Adafruit_SSD1306/blob/master/examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino working with a Adafruit ESP32 Feather V2
https://www.adafruit.com/product/5400 and Monochrome 0.91" 128x32 I2C OLED Display - STEMMA QT / Qwiic https://www.adafruit.com/product/4440 using the STEMMA QT / Qwiic connector. Nothing is showing up on the oled. The green power light on the OLED board is lit up. Any ideas as to why nothing is showing up?

GitHub

Arduino library for SSD1306 monochrome 128x64 and 128x32 OLEDs - adafruit/Adafruit_SSD1306

#

I'm also using the latest board packages and libraries. Nothing else is connected to the feather besides the usb c power from my desktop

eternal cloud
rocky jay
#

I can give that a try

lavish quiver
#
void playnote(float length, float freq)
{
  stepper.setSpeed(freq / 3.33333333333);
  stepper.step(???);
}```
I can't figure out the equation for the thing here. I need it to rotate for a specific amount of steps at a specific frequency. For example, if the frequency was 1000 hz and the length was 1000 ms, it would step 1000 times, as its a frequency of 1000, which is 1000 times per second. But I am incredibly tired, and I cannot think. Somebody please replace the `???` with an equation.
north stream
#

For length in ms and frequency in hz? 1000 / (freq * length)

lavish quiver
#

thank you

#

you have saved my neurons from imploding

#

wait no

lavish quiver
#

the length is 500 and the frequency is 164.81

north stream
#

Ah, I had it backward. freq * length / 1000

stray narwhal
#

hello, i am trying to use both dht11 and scd40 using one arduino one r3 board. The default serial port baud rate is 9600. The sample code for dht11 uses 9600 baud and 1000 delay while the sample code for scd40 uses 115200 baud and 100 delay. Can I just use just 115200 baud and 100 delay for both? The sampling rate of dht11 is 1hz though. In terms of display and saving data the delay can be virtually done. Is this good to do?

#

would it be better if i just use circuitpython for both and use different baud and delay?

#

i dont know if that is even possible. I am still testing out circuitpython

rocky jay
lavish quiver
#

does anybody know of a library I can use that lets me play (at least) 4 channel midi files? it can be anything, as long as it doesn’t require an sd card slot of some sort, because i don’t want to buy anything else unless absolutely necessary

#

As in, it separates the 4 channels and sends out signals at specific times so the separate outputs output at the same time but asynchronously, letting music be played in real time

#

If anybody’s thinking that a pi pico (running arduino) wouldn’t have enough power, I did originally use circuit python - but that didn’t have enough precision for perfect frequencies.

lavish quiver
#

scratch that - i think i found one (PlayTune), but its better suited to playing with speakers and not motors. what i will need is some sort of parser, that can turn the raw byte data from miditones into something like [C4, 500] with C4 being the note/octave and 500 being the sustain/note length. at the moment, its all in byte data and numbers that I can't figure out how to read

north stream
#

It sounds like you're trying to build something like a Floppotron?

lavish quiver
north stream
#

As floppy drives use stepper motors internally, a lot of the concepts would transfer

lavish quiver
north stream
lavish quiver
# north stream There are several helpful writeups in the AdaFruit learn guides, here's one to g...

this is pretty useful, but not really what I need. the pico needs to be able to read a midi file somehow, and then output the correct note. i've already set up the actual note playing, i just need to get a midi file into that code, in any possible way. i already tried with chatGPT but that ended badly and the midi isn't playing correctly. its not outputting any midi signal, and i don't want to have to input it with a keyboard/usb connector

north stream
#

You might have to hack up an Arduino MIDI file library slightly to read your file from wherever you're storing it.

#

But most of the code is already there

lavish quiver
north stream
#

Ah, I figured you had already decided where to store it. The flash memory on the Pico should be suitable.

lavish quiver
#

would i have to switch to a different code (again)? i can't go back to circuitpython, its not precise enough for playing certain notes.

north stream
#

No, you'd do it with Arduino. There are three major approaches. One is to embed the MIDI data with your sketch and upload it in a single operation. The second is to block out part of the flash and just store the data there directly. The third is to set up a filesystem in the flash and store data as files within that.

lavish quiver
north stream
#

You can look at the projects (search for "pico fatfs", it brings up a couple of repositories)

lavish quiver
north stream
#

I didn't realize that. Again, you might have to modify the library to read/write from flash, at which point it may be easier to just store the file on flash yourself.

lavish quiver
#

There's also a constant error sound, and the computer lags

north stream
#

I know nothing about windows so I'm no help there.

lavish quiver
#

Oh, i found the solution

#

I need to format it with some code from adafruit

lavish quiver
#

Ok, so this code here (https://github.com/adafruit/Adafruit_SPIFlash/tree/master/examples/SdFat_format) says that the pico (RP2040) is supported. An error is thrown when the code is ran, sent through the serial. "Error, f_mkfs failed with error code: 14". This happens when trying to format the on-board flash memory as FAT12

GitHub

Arduino library for external (Q)SPI flash device. Contribute to adafruit/Adafruit_SPIFlash development by creating an account on GitHub.

#

I need to either fix the issue, or find an alternative for making the flash memory writable.

lavish quiver
#

Does anyone have any idea yet? I still haven't been able to find a solution.

lavish quiver
#

Ok! Flash memory is working. But I still can't find something to parse the midi file. There is one library (MD_MIDIFile) but I can't find any good documentation and it doesn't support LittleFS.

#

(that is, without mods to the library that I can't easily do)

lavish quiver
#

Extensive use of ChatGPT reveals that ChatGPT is not smart, and will not produce working code.

#

Its code recognises all notes as invalid events, but I can see a pattern of the correct events within the incorrect events.

lavish quiver
#

Ok, I'm switching back to Circuitpython. It has easier PIO, and also is easier to code in general with a better set of libraries in my opinion

#

Not trying to slander Arduino, but it's not a good fit for this project

static sinew
#

Having trouble searching up an example for this specific situation - I'm using a TMC2208 with an ESP8266, I want to enable the passive braking mode, which evidently requires serial communication on startup. But there are no SCA/SCL pins labeled, just two UARTs. I guess I use the Wire.h library somehow, but I'm unable to find any good wiring diagrams which are relevant...

#

THis is in the datasheet - suggesting I hook up BOTH TX and RX to one (which?) UART pin?

#

I keep running into the same explanation - set IHOLD to zero and you can select passive braking or freewheeling mode. But nowhere (that I've found so far) does it explain how to do the latter!

ivory silo
#

`` if (timeStatus() != timeSet)
Serial.println("Unable to sync with the RTC"); // Print error message if unable to sync with RTC
else

Serial.println("RTC has set the system time");  // Print success message if RTC has set the system time
while (!Serial)
;

{
;
} `` I know the RTC is connecting because I have tested to see if the Ardiuno has the correct time after a full power cycle and yet I get the "Unable to sync with the RTC"

#

so what is wroung here

static sinew
#

are you sure timeStatus() and timeSet are the same data type? (just a guess)

static sinew
#

Or could it be present with a 0-ohm black resistor? That little bugger between pins 3-4 (counting from top) on the yellow side?

#

I should order some different 2208 boards I guess. if only to have them en route while I keep futzing around wiht these...

#

hmm I've found a few places via Google Image Search with that photo, places advertising boards looking VERY similar to mine which say UART is enabled by default?!

north stream
fluid wagon
#

Good morning. Silly question. Which is the SS pin on an ESP32-S3 feather?

static sinew
#

the problem is when you're fiddling around with USB-Serial FTDI boards and wiring and so forth, when (not if) it doesn't work the first time, troubleshooting is a nightmare... I'll try to dig out something that also needs to be programmed via FTDI so I can at least verify my board still works, for one thing!

stable forge
fluid wagon
#

Yes, I mean chip select. The reason I ask is I am using the SD card test from the Arduino-ESP32 core, and I cannot figure out what pin it wants to use as CS

#

So I am assuming there is a "default" CS pin for when you dont redefine it

#

It is SD_Test under SD in the examples for the board

eternal cloud
#

you have this in code at the beginning:

The SPI pins can be manually configured by using SPI.begin(sck, miso, mosi, cs).
Alternatively, you can change the CS pin and use the other default settings by using SD.begin(cs)

fluid wagon
#

Thank you

stable forge
#

thanks @eternal cloud

fluid wagon
#

Yes, I was wondering if there was a default pin for it though in general?

#

Is it defined in the feather board layout spec or something like?

#

I imagine it would be needed in the spec for something like the datalogger wing to work?

eternal cloud
#

GPIO10 is default for ESP32 S3 in the arduino core, that's pin 10 on the feather

eternal cloud
fluid wagon
#

Ah, fair enough. I had assumed (we all know how that goes), that the MCUs would be broken out in a consitent pattern, suppose part of that is true with MOSI/MISO/SCK always being in the same location and such

#

I would also guess that SDA/SCL are always in the same spot as well.

eternal cloud
#

yes, those are part of feather spec

static sinew
#

different boards and different form factors often have differing pin assignments though. Example, the various micro ESP32-C3 boards vs. the Seeed Studio one have different power pins, despite having similar appearances and the same footprint

static sinew
static sinew
#

now I'll have to figure out how to talk to it from an ESP8266, sending the right voodoo codes upon each powerup... but that seems tractable now compared to figuring out UART communication on a board without pin markings.

north stream
#

That's the way I like to attack problems like that: instead of figuring the whole thing out at once, divide and conquer by figuring out a piece at a time.

real swan
#
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1448
load:0x40078000,len:14828
ho 0 tail 12 room 4
load:0x40080400,len:4
load:0x40080404,len:3356
entry 0x4008059c

I keep going into this reset loop on ESP32S,
I tried a multitude of fixes, i tried esptool.py erase_flash, tried checking if ESP32 is receiving enough voltage/current, tried checking connections to FT232 and ESP32 connections (using dupont jumper wires), tried different power source, tried securing connections, tried different ways of wiring FT232 to ESP32.

The only thing i suspect in this case is watchdog timer? but in this case, I don't know what causes watchdog to go into a reset loop, is there any guidance on what to look out for that might be causing watchdog to reset, or if you think the issue is not watchdog, please do tell.

I only have a multimeter, no oscilioscope, so there is that.

I'm using Arduino IDE, example codes don't send the esp into a reset loop.

stable forge
#

you could upload a .zip of all your code

#

which board is it?

real swan
stable forge
#

i can't read which ESP-WROOM that is due to the shadow

gilded swift
#

Looks like just a Wroom 32

#

It also says ESP-32S in the corner of the PCB

real swan
stable forge
# real swan

that is a lot of code. To debug I'd suggest disabling chunks of the code and see whether you get the boot loop. Do a divide and conquer to establish exactly which section is crashing.

real swan
stable forge
#

esp32s is a module name, confusingly

real swan
#

It's a brownout issue, idk how to solve it

#

That's what ESP reset reason is saying

stable forge
real swan
#

FT232 is connected to PC

stable forge
#

you may have fighting 5v supplies

#

are the connections soldered, or do you have soldered headers on the boards and you are using a breadboard?

#

ok, FT232 is only using 5v from USB, it looks like

real swan
stable forge
#

i don't see any specifc problems. What is the 5V supply?

real swan
#

I'm using a modified PC power supply

stable forge
#

i'd say monitor the 3.3V output and see if it's erratic.

#

but I don't have any other ideas, sorry

real swan
#

well

#

if have the esp by itself

#

it won't brownout

#

but as soon as i add something like an SD card reader

#

it will brown out

stable forge
#

the AMS1117 board is supposed to supply 1 amp, but maybe it's not working well. check the voltage when you add something else

real swan
#

ah, no, i'm not adding sd card reader to AMS1117, i'm just hooking it in parallel with AMS1117 (sd card reader needs 5V)

stable forge
#

still, measure the 5v line and 3.3v line and see what happens

real swan
#

Ok

#

5.12V across power supply
3.12V across ESP32 Terminals

stable forge
#

now add something

real swan
stable forge
#

3.12 is already a little low

real swan
#

and a logic level shifter

real swan
#

because i added capactiors in parallel the equivalent of 2510uF

stable forge
#

an ESP32 can draw a few hundred mA when wifi is in use

real swan
stable forge
#

you could measure the current with the ammeter on your multimeter

real swan
#

sure

stable forge
#

i am out to take a walk for a while

real swan
#

yeah it's late for me, i will also go, i really appreciate your help! maybe we can discuss this later?

stable forge
#

sure, but check your soldering, wiring, etc. too

#

good luck!

real swan
#

of course, cheers mate.

north stream
#

Normally this is done with LEDs, but since you're talking about adjusting the size, this is some sort of graphic render?

crisp crag
#

Hey sorry i wanted to have a few questions as i recently purchased a few Itsybitys, specifically the 'Adafruit ItsyBitsy 32u4 - 5V 16MHz' i bought one previously as a test that worked fine same model n everyting, recently ive been getting errors when uploading the code to the board and it seems to flag when uploading. im not exactly sure where im going wrong?

#

All my other boards work fine, i use a feather M0 Express and Basic Proto it states its not connected on COM3 and the driver and disconnects and reconnects when hitting the reset key

#

Sketch uses 6884 bytes (24%) of program storage space. Maximum is 28672 bytes.
Global variables use 211 bytes of dynamic memory.

Found programmer: Id = "��d�o"; type = �
    Software Version = �.�; Hardware Version = �.�

avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?

avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: error: programmer did not respond to command: leave prog mode
avrdude: error: programmer did not respond to command: exit bootloader
avrdude: error: programmer did not respond to command: exit bootloader


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

ive tried several different usb's and uninstalled the driver directly multiple times and still cant figure out whats going on..

stable forge
crisp crag
#

Yeah cah do ill make a forum post now with everything i posted here with the photos also

crisp crag
stable forge
crisp crag
#

Same board

stable forge
#

could you point to the forum post you found?

crisp crag
#

yes

stable forge
#

we try not to piggy back on existing threads for replacment

crisp crag
#

Yeah i have a photo of the bags, one of them is a W17113B which is the one giving me issues and its been opened

#

give me 1 moment ill send you my forum post shortly! i spent almost 2 days troubleshooting haha

stable forge
#

do you have recent others that don't have the problem? What is their bag number?

crisp crag
#

All of the ones i have currently had this issue, its the 1st time i rebought i dont have the previous bag number annoyingly but i can see if i can find it in my garage if it hasnt been thrown yet

stable forge
#

ok, not a really big deal. The bag number helps us track the production problems but it sounds like this might have been a problem over more than one batch.

crisp crag
#

buti have x5 W22545 C and x1 W1711-B (which is the one from the errors above)

stable forge
#

Say how many need replacement.

crisp crag
#

will do just typing it up now!

stable forge
#

Are all the W22545C OK? Open them all to test as needed

#

it is our policy to do 100% testing but very very occasionally a step gets skipped on the production line

crisp crag
#

I can test them yes, ive only tested the W1711-B which isnt working ill open one by 1 and verify the same way

karmic owl
#

Hello! I'm experimenting with this tri-color e-ink display, it's connected to a ThinkInk Feather Friend and to a Huzzah ESP32 featherboard. I'm powering it with a usb cable, but also have a lipo battery I can use.

The problem is that nothing is shown in the display, even though I can see in the serial monitor of my Arduino IDE that the code is pushing and working. I'm using Adafruit's example code for my Tricolor display. Attached the code.

Any thoughts on why it's not working?

stable forge
karmic owl
stable forge
#

So in this code, comment out the SSD1680 choice, and uncomment the IL0373 choice:

/ 1.54" 152x152 Tricolor EPD with ILI0373 chipset
// ThinkInk_154_Tricolor_Z17 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
// EPD_BUSY, EPD_SPI);

// 1.54" 152x152 Tricolor EPD with SSD1680 chipset
// ThinkInk_154_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
// EPD_BUSY, EPD_SPI);

// 1.54" 200x200 Tricolor EPD with SSD1681 chipset
// ThinkInk_154_Tricolor_Z90 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS,
// EPD_BUSY, EPD_SPI);

// 2.13" Tricolor EPD with SSD1680 chipset
ThinkInk_213_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY,
                                 EPD_SPI);
crisp crag
#

Thank you again!

crisp crag
stable forge
#

np 🙂

violet oak
#

Hay is anyone familiar with the IR library called IRMP. I have a IR remote that this library recognizes the protocol, address, and commands from my remote and I want it to send those data out of my ir transmitter module. Any idea will help, because IR libraries have gotten more complicated than my brain can understand these days. I'm only 27 by the way.

#

By the way the IRremote library can't understand my remote but IRMP does.

static sinew
#

not familiar with it but have an IR remote high on my to-do list - father-in-law has a TV that's a lot more complicated than it ought to be...

#

and if you're like most people, 27 is already on the decline for learning speed and efficiency! Go back and try this 8-10 years ago, you'll be fine.

north stream
#

I say balderdash to that, I'm (way) past 27 and still learning new stuff fine.

vivid rock
static sinew
#

well if you still find learning new things as easy today as you did decades ago, my hat is off to you! Me, my brain feels more like something you could use to pack delicate objects for shipment... especially lately, I've been trying to wrap it around the datasheet for the TMC2208 so I can work out how to send the right bits to turn on Passive Braking. There's a configurator utility and I briefly had a setup working where I could "snoop" on the bits it would send, and I worked backwards with the datasheet to see how they checked out, but A: the setup no longer works for reasons I can't discern, and B: one of the commands I tested in the configurator turns out not to be the one I need to enable the mode!

#

And you'd think that there'd be the relevant CRC calulator SOMEWHERE online but apparently not, just dozens of calculators for slightly different flavors of CRC. My 50-something brain took one look at the ~15 lines of code required and just crumpled...

#

now if I was 19, I'd have done it in a few minutes.

static sinew
#

although to be fair electronics were in black and white back then, come to think of it

north stream
#

I learned on vacuum tubes, happily, the concepts transfer, although it took me a while to get the hang of bipolar transistors (FETs, on the other hand, work somewhat like vacuum tubes).

pale zodiac
#

ILI9341 maximum SPI clock frequency

pallid eagle
#

Anyone know of a WiFi library that will allow me to check the MAC address of a connected device/ip?

frozen crescent
#

Do you want to send raw ARP requests?

pallid eagle
pallid eagle
#

it prints the mac adress of a connection in serial whhen it connects but thats only with verbose enabled (i think its something in one of the libraries, but i cant find a "getConnectionMACaddr" function or anything

#

im trying to controll a prodject on the ESP from a webpage accsessed on my phone

modern dawn
# pallid eagle im trying to controll a prodject on the ESP from a webpage accsessed on my phone

By 'connected', you mean a browser connecting to the web pages? So you want the web page to know the MAC address of the device the browser (clien) is running on. I think that would (as a minimum) need to be handled by the web server on the ESP. Or more accurately, by a program running in the 'context' of the web server. Where it has access to the session connection details. I don't know if that is included in the standard packets or that function would need to do a query back to the client.
If the goal is authentication, be aware that the MAC can probably be spoofed.

pallid eagle
pallid eagle
#

all of that is in serial because its verbose output

#

im not worried about security

#

its for controlling a cosplay

#

but i want to kick other unknown MAC adresses off

pallid eagle
#

I forgot to mention but the access point isn’t connected to the actual WWW internet

modern dawn
# pallid eagle im not worried about security

A bit of quick research finds that web servers can not access client MAC address due to security and privacy restrictions. That path is blocked. Since you are working with your own local network other options like previously mention ARP are possible.
However, since the goal is to detect your phone, and you are controlling the AP, another option could get you there. The AP will (normally) include DHCP to assign IP addresses. Many DHCP servers can be configured to reserve a specific IP for a MAC. Which means you only need to check the IP address. If you do not want anyone else to even get on the AP (separate from accessing the web page), you might be able to configure DHCP to not provide an IP except for the specified MAC.

wise ridge
#

So far, I've done many LED patterns that I pass the GPIO pin (D1, D2 etc) and they are working great.

#

However, I also want the ability to use an I2C expander with the same library, so i'd like to be able to tell the object what the output is, and whether it's a pin or a global variable.

#

then in the constructor, configure the pin (pinMode type stuff) as needed.

#

would I simply write to the variable name?

#
  if (pinOrVariable == 1){
            digitalWrite(MotAOut, HIGH); 
            digitalWrite(MotBOut, LOW); 
            }
            else{
            //MotAOut = 1;
            }
#

(where MotAOut is what was passed in the consutrctor)

burnt isle
#

<@&617066238840930324> I'm currently working on a wind sensor project that requires cheap force sensors that can track force in two perpendicular directions. I know this is a weird analogy, but I'm looking like something in the sensor of a Lenovo Thinkpad's Trackpoint (the little red dot in the middle of the keyboard that you move to control the mouse). Does anyone have any thoughts on which sensors that would fit this description or advice on finding some?

north stream
north stream
#

The way those work is just a lever system and two linear sensors. The same arrangement should work for a wind sensor.

eternal cloud
civic arrow
#

@everone I need some help. can anyone join in vc

stable forge
#

just type your question

#

you may not get help immediately

civic arrow
#

i need some information about how to use arduino with python

eternal cloud
civic arrow
#

i am using arduino uno. I have heared about the we can also program the board in Python. So I need help in that , how to program it.

eternal cloud
wise ridge
# north stream Ought to work

I don';t think I asked my question very well. If MotAOut simply is a variable (not a pin name) can I just write 1 to it like that?

#

i'll handle it being passed to the i2c expander later.

civic arrow
eternal cloud
#

And if you're interested, you can ask to get recommendations for boards that could run python, since the Arduino Uno can't.

civic arrow
#

ok

north stream
wise ridge
#

excellent! thank you! I just released some factory installed smoke from my el-cheapo L9110 motor drivers, once I solder up a few more, I'll dive into the code! 🙂

wise ridge
#

boards are soldered up with repaired parts. @north stream I need a little advice on what to google (terminology etc). I'm doing the whole object oriented mulittasking stuff. I started with LED's, but i'm actually making tiny gravestones that wobble!
i can move the GPIO's on my Wemos D1 (esp8266 based) no problem, and I now have 2 gravestones wobbling back and forth randomly every few seconds, and simply running, just like the adafruit example a GraveA.Update() and a GraveB.Update() call.

#

but now, I want to take the same idea, and use a PCA9685 GPIO expander to do this. This is the bit that's cooking my noggin.

#

rather than talking directly to the GPIO (or ones that I passed in the constructor), i now need to send the results of each update to a buffer, so they can be tx'd all togehter ?!?!? My brain hurts.

#

I guess I could create an global array of values for the 16 outputs on the PCA9685 device and pass an index that points to which "channel" in that global array each instance of wobble state machine is run?
sigh I'm reading that paragraph and thinking "anyone who isn't in my head right now, has NO IDEA what I'm rambling about.

north stream
#

It looks like the library doesn't expose that directly, but we can look at the library source to see what it does under the hood

#

Looks like the library just does one at a time, so you'd have to write your own wrapper to do it. I might do the same in your position. First, I'd create a struct that mirrors the register structure of the PCA9685 chip itself, then write accessor functions that update the various individual channels as needed, then a routine to simply copy the bytes of the struct out to the chip via I2C in one go.

#

Wow, the chip has 256 registers, that's a lot of data. Maybe just the 64 bytes that control the outputs.

vivid rock
lethal yarrow
#

And this particular server has 38133 members.

burnt isle
burnt isle
north stream
unkempt wedge
#

I need help in connecting bme688 sensor with esp32. when I have connected the side pins which is working for my code but I need to connect it with the cable from where the wires are connected(you can see it in the image). When I am connecting it and uploading my code in ESP-32, the message is displayed in the serial monitor as " Communication failed". I am using it in I2C protocol.

eternal cloud
unkempt wedge
eternal cloud
eternal cloud
#

Then the code is not relevant, only the wiring

#

Are you using the same pins on the esp32 for the wires from the connector ?

#

The same ones like you used for the side pins ?

#

Do you have a link to the sensor board product page ?

unkempt wedge
eternal cloud
#

And to the same pins on the esp32?

unkempt wedge
#

Yes I did

#

and the LED in the sensor is also glowing

eternal cloud
#

Well, the side pins and the 4pin connector should work the same, just i2c communication.
So it's probably some hardware error ( on the data lines, since the LED is on) ... try using the connector on the other side, or using different wires.

cloud rain
sinful dragon
#

Hey folks,

I have an odd issue with my project.

I have 4 Adafruit arcade buttons connected to a PCF8574 GPIO expander, and that is connected to my ESP32 board.

The ESP32 sits on a breadboard, and I've connected the ground wires of the arcade buttons to the ground rail on the board (for both the switch and led).

The first time i press one of the buttons, the logs show that it is triggering a press on all 4 buttons.
However, the second time I press the button, it works as expected.

Here's the log output

12:43:51.489 -> Setup complete. Waiting for button presses...
12:43:56.166 -> Button pressed on board 0, button 0
12:43:56.198 -> SHAC:1
12:43:56.198 -> Button pressed on board 0, button 1
12:43:56.198 -> SHAC:2
12:43:56.198 -> Button pressed on board 0, button 2
12:43:56.198 -> SHAC:3
12:43:56.198 -> Button pressed on board 0, button 3
12:43:56.198 -> SHAC:4
12:43:56.395 -> Button released on board 0, button 0
12:45:30.067 -> Button pressed on board 0, button 0
12:45:30.067 -> SHAC:1

Code is attached in a file

eternal cloud
sinful dragon
wise ridge
#

my code will be open source, as are my schematics etc once the product is released.

dusk orchid
#

Anyone got experience with Adafruit NRF51/NRF52 neo pixel BLE examples or library usage? It looks like it uses 'C' to distinguish colour packets, similar to bluefruit connect colorPackets, but I thought all bluefruit packets had a ! Prefix, but I must be wrong about that. Also curious when the different values for "stride" would be used

sharp holly
#
#include <RadioLib.h>
#include <SPI.h>


// Custom SPI bus
#define SCK 19
#define MOSI 20
#define MISO 18

// SX1262 module pins
#define CS 10
#define IRQ 7
#define RST 9
#define BUSY 8


SX1262 radio = new Module(CS, IRQ, RST, BUSY);


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

  // change the SPI bus pins to what I have defined, not the default one.
  
  ///...
}

Does anyone know how I can tell radiolib to use a different SPI bus on custom pins? Or chang the default? I am new to arduino (Circuitpython experienced), and have been pulling my hair out about this. I need to change the pins, as I am using a custom PCB with the KB2040.

north stream
#

Might be worth looking at the source code to see what initializers are available

muted gyro
sharp holly
#

thanks! I didnt know there was separate docs for different ports. In hindsight that makes a lot of sense 🤦

tame dagger
#

Hi, how can I read a feed with arduino? or better how can I use 115200 baud as serial communication with arduino

north stream
#

The original Arduino only has one hardware serial port, which is shared with the USB adaptor. You can use that one, but you'll have to disconnect it to upload software. You can use SoftSerial to get more serial ports, but it may not be reliable at that speed. Some later chips offer more hardware serial ports, and might be a better bet.

tame dagger
#

baud is serial speed?

vivid rock
#

yes.
115200 baud = 115200 bits per second

tame dagger
ripe coral
#

hi everyone, I'm trying to connect an Adafruit SCP40 breakout board to a ESP32S3 Dev Module and I'm using the sample code provided in the tutorial. However, I keep on getting

Error trying to execute getDataReadyFlag(): Received NACK on transmit of address

The wiring is in the picture below.
Does anyone know how to fix this issue?

#

The GND/3V3/SDA/SCL are all connected in the same order

strange cradle
ripe coral
#

Oh welp that sounds painful

#

I'll try pullups thanks!

north stream
tame dagger
#

I mean, the code should work, ignoring that it don't has wifi, the other code that I putted should do something, cuz I use Serial.print and don't send anything

north stream
#

Serial.print (on an original Arduino or clone) sends the data to the D1 pin. That's connected via a 1k resistor to the USB serial interface as well. So data sent that way should show up on the D1 pin as well as the USB virtual serial port.

tame dagger
#

is not showing in the ide

north stream
#

Do you have the IDE's serial monitor running and set to 115200/8N1?

#

Is anything else connected to D1?

tame dagger
#

in d1 nop, is nothing connected to the arduino and how can I set it to 115200? I tried but it just let me use the presets, I changed it to 9600 to try but still nope

storm pebble
#

Does anyone have experience with the USB Host Feather and the Arduino IDE? Been having a world of trouble getting it to run even the built in examples. Currently I can't get the serial port to work on the Adafruit TinyUSB USB Stack with any of the example code that I compile, but the factory reset .uf2 works fine.

tame dagger
north stream
#

Probably? SPI is SPI, and the other control pins are generally configurable.

dusk orchid
lilac sequoia
#

I've seen it, but don't remember where, and I can't put together a search query to save my life. I just need to use a clip, and arduino, to make an arduino into a dedicated SPI flash programmer

storm pebble
sinful saffron
#

I've been trying to convert an integer to a 4 char array (for use in an alphanumeric display) but don't seem to be having much luck. I've tried snprintf(displaybuffer, 5, "%4d",presetPosition); but for some reason it changes the initial variable. I wasn't able to get itoa to work either itoa(displaybuffer, presetPosition, 10);

inland gorge
sinful saffron
#
int presetPosition = 139;```
inland gorge
# sinful saffron ```char displaybuffer[4] = {' ', ' ', ' ', ' '}; int presetPosition = 139;```

I think your buffer is too small. Needs 4 chars for the actual chars and one for the null terminator. Usually I define a char buffer well above the necessary size in case I make a mistake with my printf args. I do stuff like this a lot and it works:

#define maxbuflen 10
char buf[maxbuflen];
int someval = 234;
snprintf(buf, maxbuflen, "%4d", someval);
Serial.printf("buf = '%s'\n", buf);
sinful saffron
#

just trying to get the functions working in the Arduino IDE

#

Compilation error: no matching function for call to 'print(const char [12], char [10])'

#

was trying to change it to serial.println. Let me try to use the larger buffer though

inland gorge
sinful saffron
#

gotcha gotcha, that works in the test program, let me see what happens when I put it into the main one

#

think the larger buffer is working so far, just running a bit more testing though

#

writing the part of the program that increases and decreases the number of presets hah. Thanks for the help

inland gorge
sinful saffron
wise ridge
#

Hi folks. I followed Adafruit’s excellent tutorial on object oriented programming and using state machines to generate a number of different objects/behaviours for led (eg flashing, candle flicker, lightening etc). Works great very happy.
However, the objects are created prior to setup(), which, as far as I understand, get compiled into the code.
How would I make the selection of led mode something that could be changed during run time?

#

This is an example of the code they use —

#

Could I write a conditional if statement in the loop() that’s says if a button is pressed:
Candle led1(12);

#

Assuming the only parameter needed for Candle is the pin. 🙂

wise ridge
#

So I could have all my LEDs created prior to the setup() as flashers, then when a button is pressed in loop(), redefine them as Candles?

#

That means that unused classes still get compiled and linked?

#

Prior to setup, I had:
Flasher led1(d1);
Then later in loop(), I’d have a conditional to at runs:
Candle led1(d1);

north stream
#

It depends on how you set up your code. You could instantiate classes on the fly when you need them (useful if you have large or many classes and limited memory), or just do what you described, instantiate all of them to start with and switch between them (easier to code and faster to run, but eats memory)

wise ridge
#

(I’m sat on a plane, doing mental workouts here, otherwise I’d just sit at the bench and try it!)

#

How do I kill instantiations then?

#

I’d like to kill Flasher Led1(d1) before creating a different one 🙂

#

My ultimate goal is to run a website on an esp8266 that lets you select from a dropdown which effect you want. 🙂

#

Ok - more frantic reading on my phone… by using the same name for the instance, it cleanly destroys the old one? (So the code and member used by Flasher is replaced by Candle)?

vivid rock
#

a cleaner solution would be to have a single class LedEffect which would take as input pin number, various on/off/times, and mode:

LedEffect led1(pin, ontime, offtime, MODE_FLASHER)
...
led1.mode = MODE_CANDLE

Of course, it means that led1.Update() should work differently depending on mode, so the definition of this class gets more complicated

wise ridge
#

@vivid rock I was thinking about that too…. But I was trying to avoid breaking code that currently works! 🙂

wise ridge
#

Not everyone needs to dynamically change their output behaviour.

north stream
#

I suspect I need to dynamically change my output behavior! 😆

wise ridge
#

I have a broad range of customers. Some are still attaching coin batteries to LEDs…. Others are asking for DMX lighting controls for tabletop gaming

#

Meeting the needs of both and making it accessible is HARD

north stream
#

Truth

vast kraken
#

Hello. So I've run into a problem with my Matrix Portal M4 module where it won't take in any other UF2 files. I wanted to try doing a factory reset but I have no clue how.

#

Most of the stuff I've been seeing is stuff related to the Portal S3 so I've been stuck for a long while

stable forge
vast kraken
#

ah i think this is supposed to be circuitpython

#

What i meant is that the UF2 files I add to the module kinda just make it crash and circuitpy wont pop up on my file explorer

stable forge
vast kraken
#

im still new to this stuff so i wasnt sure where to post TwT

lavish glen
#

Has anyone gotten the Adafruit VS1053 Module (non-feather) working with an Arduino Nano 33 (IoT) ? I've been trying to figure out why it won't connect, so not sure if it is the pins that are wrong (since the docs don't really convey what breakout pin is should be connect what kind of pin on the microcontroller.)

Kind of lost at the moment, but mostly wondering if I can get this to work? I've tried cross-referencing pins with stuff like ESP32 and then the Nano, but it didn't work, so either I'm doing something wrong, or its getting too late and am still doing something wrong

lavish glen
eternal cloud
tiny trout
#

hey guys i'm trying to use adafruit motor driver 2927 with a dc motor acutator PQ12-30-6-s and it says that the duty cycle is limited to 20 percent ant that's what i did, but the acutator isnt moving or moves just a little and very slow and there is hmming sonund like if you block a motor. can you guys tell me what's causing this? i checked with oscilloscope and i reverses the polarity but doesent move in other direction. and it's causing this block that i'm testing : driver.release(0); driver.move_fwd(0); driver.release(0); delay(3000); driver.release(0); driver.move_bwd(0); delay(3000);

north stream
#

Might be a power supply problem, what sort of supply are you using and how do you have it hooked up?

inland gorge
tiny trout
#

It was just blocked, it just needed some manual mouvement at first, but the speed I'm getting at 6V 20% dutycycle isn't the same as datasheet

#

It says 28 but I'm getting around 15

#

Mm/s

livid osprey
tiny trout
livid osprey
#

That means you can run the motor at 100%, as long as you don't have it running for more than 20% of the time.

livid osprey
#

Any time.

tiny trout
#

Well, I'll be using it to press buttons 1 button every second or smthg and there will be multiple and 1 for each button

tiny trout
#

What should I search for?

livid osprey
#

While these duty cycles aren't necessarily clearly defined in smaller hobby motors, the graphics explain the concept well

tiny trout
#

So if I use it for 2seconds at max and leave it for 10 is it ok?

#

Or if I use it with 50%pwm can I use it more often?

livid osprey
#

Duty cycle limits in this context is similar to pwm, except averaged over a much longer period. Continuous 20% pwm and 2s 100% 8s off would both be fine.

silver stirrup
#

I'm following the instructions on https://learn.adafruit.com/adafruit-feather-rp2040-with-usb-type-a-host/usb-host-device-info I set the CPU speed and the USB Stack as instructed.
When run in the Arduino IDE 2.3.2, the code only prints "TinyUSB Dual Device Info Example" on the Serial Monitor. It does nothing else.
However, the Factory Reset UF2 works correctly, displaying the device descriptor info for a USB mouse I have plugged into the USB Host feather board.
Any suggestions?

solemn mural
#

hello

wanton sedge
#

"random IPs" doesn't help much - what is the beginning octet of the IPs?

solemn mural
#

ok then @wanton sedge

#include "hidcustom.h"
#include <Ethernet.h>
#include <SPI.h>
#include <usbhub.h>

#define ETH_SS 5
#define USB_SS 10

int port = 62576;
int x = 0;
int y = 0;
char symbols[] = "-,0123456789";
const char code[] PROGMEM = "HAMODIISGAYS";
bool encrypt = true;

void decryptCommand(char *command) {
  if (encrypt) {
    for (int i = 0; command[i] != '\0'; i++) {
      for (int j = 0; j < sizeof(code) - 1; j++) {
        if (command[i] == pgm_read_byte_near(code + j)) {
          command[i] = symbols[j];
          break;
        }
      }
    }
  }
}

byte mac[] = {0x89, 0xF8, 0xB9, 0x3B, 0x46, 0xEA};
EthernetServer server(port);
EthernetClient client;

signed char delta[3] = {0, 0, 0};

void MouseRptParser::Parse(USBHID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) {
  MYMOUSEINFO *pmi = (MYMOUSEINFO *)buf;

  if (CHECK_BIT(prevState.mouseInfo.buttons, MOUSE_LEFT) != CHECK_BIT(pmi->buttons, MOUSE_LEFT)) {
    CHECK_BIT(pmi->buttons, MOUSE_LEFT) ? Mouse.press(MOUSE_LEFT) : Mouse.release(MOUSE_LEFT);
  }
  if (CHECK_BIT(prevState.mouseInfo.buttons, MOUSE_RIGHT) != CHECK_BIT(pmi->buttons, MOUSE_RIGHT)) {
    CHECK_BIT(pmi->buttons, MOUSE_RIGHT) ? Mouse.press(MOUSE_RIGHT) : Mouse.release(MOUSE_RIGHT);
  }
  if (CHECK_BIT(prevState.mouseInfo.buttons, MOUSE_MIDDLE) != CHECK_BIT(pmi->buttons, MOUSE_MIDDLE)) {
    CHECK_BIT(pmi->buttons, MOUSE_MIDDLE) ? Mouse.press(MOUSE_MIDDLE) : Mouse.release(MOUSE_MIDDLE);
  }
  if (CHECK_BIT(prevState.mouseInfo.buttons, MOUSE_PREV) != CHECK_BIT(pmi->buttons, MOUSE_PREV)) {
    CHECK_BIT(pmi->buttons, MOUSE_PREV) ? Mouse.press(MOUSE_PREV) : Mouse.release(MOUSE_PREV);
  }
  if (CHECK_BIT(prevState.mouseInfo.buttons, MOUSE_NEXT) != CHECK_BIT(pmi->buttons, MOUSE_NEXT)) {
    CHECK_BIT(pmi->buttons, MOUSE_NEXT) ? Mouse.press(MOUSE_NEXT) : Mouse.release(MOUSE_NEXT);
  }
  if (pmi->dX || pmi->dY) {
    OnMouseMove(pmi);
  }
  if (pmi->wheel) {
    OnWheelMove(pmi);
  }

  prevState.bInfo[0] = buf[0];
}

void MouseRptParser::OnMouseMove(MYMOUSEINFO *mi) {
  delta[0] = mi->dX;
  delta[1] = mi->dY;
}

void MouseRptParser::OnWheelMove(MYMOUSEINFO *mi) {
  delta[2] = mi->wheel;
}

USB Usb;
USBHub Hub(&Usb);
HIDBoot<USB_HID_PROTOCOL_MOUSE> HidMouse(&Usb);

MouseRptParser Prs;

void setup() {
  pinMode(ETH_SS, OUTPUT);
  pinMode(USB_SS, OUTPUT);
  digitalWrite(ETH_SS, HIGH);
  digitalWrite(USB_SS, HIGH);

  // Ethernet initialization
  SPI.begin();

  // USB initialization
  SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));
  digitalWrite(USB_SS, LOW);
  if (Usb.Init() == -1) {
    while (1);
  }
  HidMouse.SetReportParser(0, &Prs);
  digitalWrite(USB_SS, HIGH);
  SPI.endTransaction();

  Mouse.begin();

  delay(1000);  // Added delay for stabilization

  SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));
  digitalWrite(ETH_SS, LOW);
  Ethernet.begin(mac); // Use DHCP to obtain IP address
  digitalWrite(ETH_SS, HIGH);
  SPI.endTransaction();

  if (Ethernet.localIP() == 0) {
    while (true) {
      Serial.println(" and ip is wrong");
      delay(1000);
    }
  }

  server.begin();
  Serial.println(Ethernet.localIP());
}```
solemn mural
#

as in 412.xxxxx 952.xxxx 144.xxxxx

wanton sedge
#

huh, 412 and 952 aren't even possible IP addresses.. and you're sure you're reading the IP addresses and not something else?

solemn mural
dry galleon
#

Curiously does this code ever just freeze?

solemn mural
#

ive tried static

#

everything

#

this is how it looks

wanton sedge
#

what is your ethernet port plugged into? (on the other end)

solemn mural
#

my router

#

like ive tried checking the manual assignment ip for mac addresses nothing

dry galleon
#

  SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));
  digitalWrite(ETH_SS, LOW);
  Ethernet.begin(mac); // Use DHCP to obtain IP address
  digitalWrite(ETH_SS, HIGH);
  SPI.endTransaction();

  if (Ethernet.localIP() == 0) {
    while (true) {
      Serial.println(" and ip is wrong");
      delay(1000);
    }
  }

Is the code in question correct?

solemn mural
dry galleon
#

are you setting the spi device select pin high?

#

(I havent read through every line yet)

solemn mural
#

ive done the spi.begintransaction because i need to gain exclusive access to the ethernet module because the ethernet module and usb host shield share the spi bus/lane to the arduino leonardo

solemn mural
dry galleon
#

ok my bad

solemn mural
#

check the start of void setup

#

usb host shield works perfectly fine but i just cant establish an ip and ping it

wanton sedge
dry galleon
#
  // USB initialization
  SPI.beginTransaction(SPISettings(14000000, MSBFIRST, SPI_MODE0));
  digitalWrite(USB_SS, LOW);
  if (Usb.Init() == -1) {
    while (1);
  }

This going into a while(1) loop is weird to me but you seem to know whats going on there and its intentional.

I dont know the api well enough to just spot a problem

solemn mural
solemn mural
#

goes into a halt

solemn mural
#

ive tried default ethernet lib

#

but still same issue

dry galleon
#

ill do some reading and see if I manage to drum anything up for you

solemn mural
#

thx man <33

wanton sedge
#

I'm more familiar with the networking sides of things (IT person here ;D) haven't done much with SPI but definitely sounds like a "conflict" of sorts, although not sure that would explain the random IP addresses.. I would almsot expect it to just "not work".

solemn mural
#

like ive done everything ive couldve think of 1. making sure the spi does not crash with the usb host shield and ethernet module 2. ive made sure the cs_pin is selected properly

solemn mural
wanton sedge
solemn mural
#

<33

dry galleon
#

ok so I read through the docs

#

and honestly you seem to be doing everything right.

solemn mural
#

everytime when i buy the brand from keyestudio the arduino never worked

#

but a original arduino one worked

#

I bought another original one because the first original arduino I got I shorted it with a dc 90 W and 20 current flowing through to the port on the leonardo 😂

#

@dry galleon

dry galleon
#

awesome!

static sinew
#

Been looking around for a comprehensive how-to since yesterday - I'm trying to add the ability to do an HTTPS "post" to an ESP8266 sketch, so it can send Ntfy notifications.
This apparently involves running a Python script to gather up some security certificates, which I've done, and installing an uploader to put them onto a "LittleFS" filesystem, which I've done. But the sample code still can't find the certs.

#

I think I'm supposed to partition the Flash somehow, but I downloaded the tool to do that (a .jar, supposed to show up in the Tools folder) and can't seem to find the right place to install it.
Have tried a BUNCH of different locations in ~/Arduino, .arduino15, and various subfolders. FWIW I'm on Linux and using the .appimage, could that be the problem? Becuase at no point does anything appear in the Tools folder.

#

FWIW I can do ctrl-sshift-P and look up the "upload to LittleFS" entry in that long list of - tools? - but I read somewhere that I should make the partition on the flash first, THEN upload the certs, and then the sketch can be uploaded.

#

A lot of the how-tos seem outdated (for instance, the Python script to collect certs did not work, so I searched again and found a more recent Python script...) and/or only provide specifics for Windows installations.

static sinew
#

OK I think I've tracked the problem down - looks like I had the right tools, I just trimmed too much from a big example program to use for testing purposes... another test program DID work and I found out that just because a sketch still compiles without errors when you comment out a library-include, that doesn't mean you've still got a working bit of code

north stream
#

That's happened to me too.

static sinew
#

It's odd though, innit? You'd think if a library is #included then it would be referenced somewhere; and if it's commented out with no other changes, at LEAST a warning during compilation? Otherwise how can it even DO anything...

bold hemlock
#

hey are y'all familiar with the M5Stack Cardputer? I've got one, programming it with the Arduino IDE. I'm trying to read the keyboard, but best I can tell, every 2 cols are connected to the same pin, and I can't figure out what pins the rows are on

#

There's a diagram on the back of the device with pin numbers for the kb, I'll post that as well rq

#

I'm not entirely sure what that device labeled 74HC 138 is, I'm assuming some form of shift register, but I'm not sure how to communicate with it using only 3 pins

#

my current code that I'm using to figure out the pins. oddly, pin 3 is always high. I'm not certain that I'm indeed accessing the right pins, as they are all prefixed with G on the board. However, they are changing with key presses.

void setup() {
  Serial.begin(9600);
  pinMode(7, INPUT);
  pinMode(6, INPUT);
  pinMode(5, INPUT);
  pinMode(4, INPUT);
  pinMode(3, INPUT);
  pinMode(15, INPUT);
  pinMode(13, INPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(11, OUTPUT);
  }

void loop() {
  Serial.print("Pin 3: ");
  Serial.print(digitalRead(3));
  Serial.print("\n");
  Serial.print("Pin 4: ");
  Serial.print(digitalRead(4));
  Serial.print("\n");
  Serial.print("Pin 5: ");
  Serial.print(digitalRead(5));
  Serial.print("\n");
  Serial.print("Pin 6: ");
  Serial.print(digitalRead(6));
  Serial.print("\n");
  Serial.print("Pin 7: ");
  Serial.print(digitalRead(7));
  Serial.print("\n");
  Serial.print("Pin 13: ");
  Serial.print(digitalRead(13));
  Serial.print("\n");
  Serial.print("Pin 15: ");
  Serial.print(digitalRead(15));
  Serial.print("\n");
  delay(75);
}
#

The cardputer is running an M5 StampS3 for the MCU, which is an ESP32-S3

stable forge
bold hemlock
#

ahh hmm

stable forge
#

someone actually made an extension to circuitpython to handle this kind of matrix keyboard

#

I don't know of an Arduino library, but it's not so hard

bold hemlock
#

hmm currently trying to figure out how to interact with the 74hc138. Changing A0 or A1 doesn't seem to have an effect on the output when pressing keys on the keyboard. This prolly wont take much for me to write a library to handle it all, once I can figure out how to read the matrix keyboard, I just can't seem to do that rn

#

I can't evne tell where the 74hc138's outputs are, they seem to go into R0 through 7 on the keyboard matrix, but that doesn't make much sense tbh

inland gorge
bold hemlock
#

ahh ok, thanks! I had just found that library and was starting to install it, hopefully they have some decent docs

#

I vaguely remember trying to use this library, but struggling from lack of documentation, which seems to be a common theme for M5Stack

inland gorge
#

heh yeah and with most libraries

bold hemlock
#

luckily I know how to read C++ and header files lol, I'm determined to figure out how to use this thing

north stream
livid osprey
tender wasp
#

first time using an rp2040 board; I can't program it with the Arduino IDE or platformio without replugging it while holding the BOOTSEL button. is that common for this chip?

#

SparkFun Pro Micro RP2040 in linux.

I see both the IDE and platformio try flipping the board into programming mode by twiddling its USB serial port baud rate, but it doesn't seem to do the trick. the mass storage device doesn't show up & get mounted.

#

I've got all the common stuff done; udev rules installed, user has access to the serial device, ModemManager isn't running. both the Arduino IDE and platformio are humming along with some non-rp2040 boards.

tender wasp
#

same behavior with an adafruit QT Py RP2040, seems like, though easier since the QT Py has a reset button.

static sinew
#

Hey guys - this isn't really a question, but I've got an ESP8266 sketch which, among other things, has a button linked to a GPIO which has an interrupt handler that sets a global flag which a timer object will see and activate a countdown so that, when it hits 0, if the button is still down, it will set a different flag so that the loop() will do some stuff that's too time-consuming to do in a timer or an interrupt handler.

#

The logic is getting tangled, so my question is, what over-the-counter pain medication do you find is best for logic aches?

eternal cloud
#

Having a reset button is very helpful, and SparkFun Pro Micro should have one too, that's what it says in the docs

north stream
tender wasp
#

those adafruit docs do say you may need BOOTSEL for the first sketch upload, but they seem to imply that the first one does something that enables automatic uploads. in my case, I think it turned out to be a permissions issue.

#

in my case, the platformio rp2040 auto-upload failure turned out to be linux permissions. since IIRC it uses libusb to upload code, not the mounted filesystem, it's not enough that the mounted filesystem and serial device have the correct permissions, the underlying device needs them, too. in addition to the platformio udev rules, I needed the udev rules installed by this script, which fixed it:
https://github.com/arduino/ArduinoCore-mbed/blob/main/post_install.sh

tender wasp
#

though maybe what the script really did was reload my udev rules after I updated the platformio rules, heh. I do see my USB ID in the platformio rules. though, the script's rules list a couple extra boards that might be helpful for others.

and it still seems I have to use the BOOTSEL trick sometimes. maybe once each time I replug the board, and then auto mode works after that? but I can live with that.

eternal cloud
#

Different chips too, rp2040, esp32 ... sometimes arduino gets confused, lol

static sinew
# north stream I wonder if you could (ab)use a switch debouncer library to do it for you

Possibly, but bear in mind the switch can be turned on or off at any point. I want the user to be able to turn it on, and then if it's turned off within 5 seconds, no action is taken. After 5 seconds, a signal is sent. And if it remains on for a total of 30 seconds, then later on when it IS turned off, a different signal is sent. Oh but a status flag is always updated for every change in state. and sometimes that status flag is sent off, by a different means.
And the timing is done by a timer interrupt, while the switch sensing is attachInterrupt, neither of which can be used to send the (MQTT and HTTPS, plus Serial at least during development) signals. So there's this cascade of global Boolean flags that have got all tangled up in my head... but I'm simplifying it.

modern dawn
#

You are doing a state machine. If you can think in that mode, the flags should simplify drastically.

fiery zinc
#

hey, not sure this is the right channel but im currently working on an arduino program to get orientation from magnetometer, accel and gyro and im strugging with the magnetometer on the feather sense. I cant get it give a north south east west reading going around the z axis. going around the x axis works for some reason but thats not helpful. I am calibrating the magnetometer using Adafruit_Sensor_Calibration.h but im not sure how much its doing

fiery zinc
#

turns out i was being silly ignore me

pseudo estuary
#

Hello can someone when they are available help me turn on this Monochrome 2.42 128x64 OLED Graphic display. I have tried everything I can for hours to get it to respond and I am not sure if it's something wrong with the code or the wires or me.

vivid rock
tender wasp
vivid rock
pine bramble
#

Hey guys my Arduino r4 wifi is not showing up in the IDE any idea on why this is?

sand escarp
#

Trying to use I2S.h with other Adafruit libraries like Adafruit_GFX.h results in a compilation error due to "multiple definitions of DMAC_Handler" - anyone have any advice?

long kite
#

Hello everyone! (I'm not a native speaker, I hope my question makes sense)
I am working with a fingerprint sensor in a ESP32 using Adafruit's library. Is there any pre-built method to upload fingerprints to a place that's not the internal memory? Maybe a SD card or an external server. And then download them?

I implemented something to upload stuff to a server but I am not able to save it in the internal memory after download. My goal is use one fingerprint reader to register people and then another reader (or multiple) to install it near a door. This way, if I have, say, 5 readers distributed, I don't have to register in every one of them. Thank you in advance 🙏

dry galleon
#

@bold hemlock if the buttons are comming into a shift register then they wont be rows or colls (or the rows and colls are coming into a shift register)

Reading an input shift register is not hard lots of tutorials on it for code on how to do it.

The idea is that a shift register takes a bunch of analog things like buttons, and you wire them all into the shift register and it sends the entire state of all the analog stuff connected to it at once.

#

So lets say you have a shift register with 8 buttons. It willl send your microcontroller a 00000000 when no buttons are pressed an 11000000 when the first two are pressed and so forth. The reason this works good is cause you can use "byte shifting" on the binary string which works really fast and will let you scan the binary for the state of each button single

livid osprey
dry galleon
#

ahhh

#

I would assume thats for driving led and outputs.

livid osprey
#

Nah, it’s just a different method of using less pins to control outputs. The shift register uses fewer pins for more output combinations, but the demultiplexer doesn’t have any timing considerations to worry about.

dry galleon
#

ahhhh!

eternal cosmos
#

hello, i am trying to connect an MPU6050 GYRO SENSOR to an I2C multiplexer PCA9548A through arduino
i dont know how to write the program for this
im a beginner
can smone pls help me
with the program

raven wolf
#

HEy all, having a bit of a problem with my Adafruit music maker, following the tutorial on the site, but dosn't seem to be working

#

just using the straight code, and getting the error that the article mentioned, but doing the fix didn't help anything

eternal cloud
raven wolf
#

on the Play Music step, and the error is the one they mentoned, Adafruit VS1053 Simple Test
Couldn't find VS1053, do you have the right pins defined?

#

And I did change the code to what they said, but not sure what's up

eternal cloud
#

What board are you using this with ?

raven wolf
#

The Metro

eternal cloud
#

Could you please post pictures of your boards and wiring ?

raven wolf
#

sure one sec. This was part-way through the build of a Ghost Trap, but when the board didn't work, tried to test it with the test music player

eternal cloud
# raven wolf

I'm not sure how well those stranded wires are soldered, I'd need to see the other side too.
I'm assuming this gets stacked on top of the metro?
Did you cut the jumper for DREQ, since you rewired it to pin 2? Also, did you change it in the code you were testing with ?

raven wolf
#

I did cut the jumper, and I did change the code, I used the one the webpage gave me

eternal cloud
eternal cloud
# raven wolf

The picture is kinda blurry... did you cut all 4 of those jumpers, or just the one for pin 3?

#

That error indicates a wiring problem, so that's what you need to double check

raven wolf
#

Just the one for pin 3

#

OPk, I'll change that over, hopefully that's what's wrong with this! Heh, course, the actual ghost trap isn't quite working, but we shall fix that later

raven wolf
#

Drat, that didn't work, Changed it to #define DREQ 2 and nothin

#

ok, the simple serial output worked, so that's something.

pallid sage
#

Anyone know off the top of their head how far in what directions did the Adafruit CLUE board move its display between Alpha and modern versions?

pallid sage
#

Trying to modify a 3D print case design to be useful for an alpha CLUE board, I only seem to have my eyes to go on though...

pallid sage
#

...Maybe right by 1/24th of the display area, seems 23.4mm, so 1mm?....

pallid sage
#
// Mod in OpenSCAD for https://www.thingiverse.com/thing:4321766
difference() {
    import("Clueslim-Top.stl");
    translate([-09.55,-9.533,0]) cube([23.4,23.61,2.2]);
    translate([-14.55,-11.125,1.2]) cube([30.5388,27.365,2.802]);
}

Maybe 1/7th of a person would appreciate this. May this make you whole. ;-)

eternal cloud
static sinew
# long kite Hello everyone! (I'm not a native speaker, I hope my question makes sense) I am ...

That would depend on the fingerprint reader you're using. I have no experience with them (I bought a couple for a future project but they're still untouched) but I would be surprised if they let you do what you want to do.
Usually, fingerprint readers don't store a full image of a print - they create an encoded version, often called a hash, which is stored securely. Future fingerprint reads are also converted to the code, and compared to the list of stored codes.
If I were designing a consumer-grade fingerprint reader, I would not let people pull the hash out of the storage, even for a good reason like yours.
But I could be wrong. If the product you're using has this capability, and the library is designed to enable it, then the library's documentation will have the info you need.

elfin thorn
onyx junco
#

Looking for code that works with the Adafruit Feather HUZZAH with ESP8266 using the deep sleep with or without battery. I've tried so many different pieces of code but none work. it works for a while and then creashes. This is the only output I get on the serial:

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)


 ets Jan  8 2013,rst cause:2, boot mode:(3,6)
#

I then manually press the reset button on the HUZZAH with ESP8266 but it will not come out of this state. I have to unplug power to get control again

onyx junco
#

I found some chatter on the forums that says the Adafruit Feather HUZZAH with ESP8266 board has errors that do not allow it to deep sleep - Is this confirmed?

stable forge
pallid sage
#

I'm guessing the only way forward with an alpha bootloader CLUE is to update the UF2? Was hoping to read off a copy of the default program first.

stable forge
#

Does CURRENT.UF2 appear in the BOOT drive? If so, and it's an Arduino program, you can copy the program off by copying CURRENT.UF2.

pallid sage
#

I was able to snag a current.uf2, though it is somewhat inscrutable to me. I don't see a circuit python mass storage device, and the CLUE screen proclaims "Filesystem not found".

#

The dribbles in the serial terminal don't seem to have any reaction to CTRL-C.

#

I will assume I've done all the scraping I can and work towards pushing bootloader 0.2.9 into the future then.
Awesome response, thank you!

stable forge
#

undid that change, it's wrong. there is a separate chip for CIRCUITPY

pallid sage
#

2MByte SPI, by the diagram, I guess the 1MByte is internal to the nRF?

stable forge
#

note the last post about adding pull-ups

onyx junco
stable forge
#

maybe they have pullups on board?

#

or the board initialization code for those boards is different

onyx junco
elfin thorn
onyx junco
stable forge
onyx junco
stable forge
mellow token
#

Is this where to ask about questions with bluefruit?

left mauve
#

I'm trying to play a .wav file on the adafruit pygamer but nothing happens. I'm using the example script from the adafruit_arcada github

#

It has read the audio file successfully but I don't hear anything

#
Trying SD Card filesystem
SD card found
QSPI filesystem found
QSPI flash chip JEDEC ID: 0xC84017
Mounted filesystem(s)!
Found filesystem!
WAV Files available:
---------------------------------
System Volume Information/
2 Portal Radio (Uncompressed).wav        8773702
---------------------------------
Playing file: 2 Portal Radio (Uncompressed).wav
#

I have also tried using headphones but still nothing plays

#

do the wav files need special settings???

eternal cloud
bold axle
#

Hi there! We have an Adafruit Feather M4 express. We have installed the fastled neopixel library and we are trying to upload the following code https://github.com/Electriangle/Fire_Main on it but it fail everytime. The board seems to turn dead after uploading the code. We have successfully used Circuit Python (so the Hardware is fine). Anyone can give us an hand ?

GitHub

Fire/Flame animation for WS2812B LED strip using an Arduino and the FastLED library. - GitHub - Electriangle/Fire_Main: Fire/Flame animation for WS2812B LED strip using an Arduino and the FastLED ...

fickle sentinel
midnight sleet
#

With the Adafruit GFX library, is it possible to manually access and update the buffer and then just call display? Bypassing any other function calls?

north stream
#

I'd assume so.

edgy ibex
#

Need a little help with a Seeed Xaio esp32-c3. It came with an external antenna that has a small coax connector, no more than a couple of mm in diameter. I think it's an IPX connector, but to be honest I'm not 100% certain of that. I can see well enough with the current state of my cateracts to see that the connector on the end of the cable should mate with the connector on the board.

#

What I don't actually know how to do is to get them to attach. It's not a "press-fit" as far as I can tell, but I can't tell if it's threaded or a bayonet connection or something else.

tame topaz
# edgy ibex Need a little help with a Seeed Xaio esp32-c3. It came with an external antenna...

They generally come in push on versions. Correct alignment makes it push together easily. Other forms are screw on and they will have flats on the mating part but these are expensive and normally only seen on high end/ high freq equipment. When we get to the age of cataracts they should supply a 12 year old with every miniature appliance remote control or technological marvel.

edgy ibex
neon trench
#

I"m using a Feather M4 Express & trying to get the simple Blink sketch running. I've copied the Blink code from the installation guide after running all of the appropriate setup for Arduino. Most of the time I'm getting:
Sketch uses 10904 bytes (2%) of program storage space. Maximum is 507904 bytes. No device found on cu.usbmodem311201 Failed uploading: uploading error: exit status 1
Curiously, the sketch did load once. I've tried quitting, restarting, selecting the board & port again. Any ideas what might be causing this? Thanks!

north stream
#

Might be you need to re-enter the bootloader

neon trench
# north stream Might be you need to re-enter the bootloader

I took a look - it said says:

Model: Feather M4 Express
Board-ID: SAMD51J19A-FeatherM4-v0```
That's above the 3.9 the learn guide suggests needs the update. It happened to both an M4 and M0 in Arduino that I just bought. That's why I was wondering if there might be some odd setting I need to deal with to prevent some sort of time-out.
north stream
#

If you're running Linux, you could set a udev rule so it doesn't change device nodes when the USB bus re-enumerates

north stream
#

I'd get one out, but the only handy board is a Pro Trinket and it's bedtime for me. Sometimes a Mac will think these boards are potential network interfaces

stable forge
neon trench
# stable forge I saw your query on Mastodon as well. The best sequence for Arduino I have found...

THanks a ton, Dan. This seems to have gotten things working! I had the latest bootloader, even re-installed the Arduino IDE thinking I might have inadvertently hit some setting with a hotkey, but the double-tap reset seems to get it back on track for receiving uplaods. I seem to have to do this for every upload, but as long as I do this, it's accepting what I send. I'll be sure to put this tiop into the build lesson I create. And so sorry if I missed something obvious in the documentation. As always, your kindness and helpfulness is world-class. Cheers!

knotty ridge
#

Hi!! , I could'nt find channel for ESP , so i came heree... Im having trouble using OTA feature. When i upload the Arduino BasicOTA Example File , it uploads normally via serial connection to my ESP8266. But when i upload the same code again via Network , It shows me the following error...

- . Variables and constants in RAM (global, static), used 28992 / 80192 bytes (36%)
-║   SEGMENT  BYTES    DESCRIPTION
-╠══ DATA     1504     initialized variables
-╠══ RODATA   1352     constants       
-╚══ BSS      26136    zeroed variables
-. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 60824 / 65536 bytes (92%)
-║   SEGMENT  BYTES    DESCRIPTION
-╠══ ICACHE   32768    reserved space for flash instruction cache
-╚══ IRAM     28056    code in IRAM    
-. Code in flash (default, ICACHE_FLASH_ATTR), used 285060 / 1048576 bytes (27%)
-║   SEGMENT  BYTES    DESCRIPTION
-╚══ IROM     285060   code in flash   
-13:19:23 [ERROR]: No Answer
-Failed uploading: uploading error: exit status 1
pine bramble
#

Hi, I'm new to nrf52 devices and want to start with a simple freertos setup. I managed to setup arduino framework with the adafruit library.

I can include the freertos.h and setup a task but i think that nobody calls the tick for the freertos. Do i have to add some code for that or is it already setup with the freertos libs?

#include <FreeRTOS.h>
#include <FreeRTOSConfig.h>
void setup() {
    xTaskCreate(DebugInputTask, NULL, 256, NULL, 1, NULL);
    vTaskStartScheduler();
void DebugInputTask(void *arg)
{
    debug_serial.println("DebugInputTask");
    while (true)
    {
        debug_serial.println("DebugInputTask running start");
        digitalWrite(24, LOW);
        //vTaskDelay(1);
        digitalWrite(24, HIGH);
        debug_serial.println("DebugInputTask running end");
        vTaskDelay(1);
#

The Taks is started but only runs to the first xTaskDelay(). If i remove the xTaskDelay the whil(true) loop runs several times (but logging crashes :))

onyx junco
stable forge
#

That could well be, and you could check this just with your finger. You might see what the temp is after it cools off to room temperature. The other functionsof that sensor may be more useful

onyx junco
onyx junco
stable forge
#

Is it hot to the touch? I think the library is fine; we would have gotten reports if not. Humidity would be up be cause temp is down and/or your finger is wetter

#

@onyx junco

livid osprey
onyx junco
onyx junco
livid osprey
#

That is correct.

#

How often do you tell your sensor to make a measurement?

jovial isle
onyx junco
stable forge
# jovial isle hello, does anybody know if the Adafruit bno08x library ( https://github.com/ada...

Yes, you can do this.

/*!
 *    @brief  Sets up the hardware and initializes I2C
 *    @param  i2c_address
 *            The I2C address to be used.
 *    @param  wire
 *            The Wire object to be used for I2C connections.
 *    @param  sensor_id
 *            The unique ID to differentiate the sensors from others
 *    @return True if initialization was successful, otherwise false.
 */
bool Adafruit_BNO08x::begin_I2C(uint8_t i2c_address, TwoWire *wire,
                                int32_t sensor_id) {
stable forge
pine bramble
#

Anyone using a nrf52 with the adafruit arduino library. I just realized that there is already a Freertos running for all the BLE stuff. How can i add my tasks to the existing FreeRTOS? I don't want to edit the library code...

burnt isle
#

which esp32 would you guys recomend for someone new to the using them but that has experience w/ arduino

#

this is the one i was looking at but it's rlly my first time looking at them so i thought i should prob ask for advice

merry cargo
# burnt isle which esp32 would you guys recomend for someone new to the using them but that h...

I used this one in a recent arduino project. I found it fairly easy to find sample code and appropriate libraries to accomplish what I needed.
Comes in 2 varieties: PCB antenna or w.FL connector. I got the second one since I wanted an external wifi antenna.
https://www.adafruit.com/product/5438

burnt isle
#

oh awesome! i'll look into that one, tysm!

jovial isle
# stable forge Yes, you can do this. ```c /*! * @brief Sets up the hardware and initialize...

Thanks @stable forge for your reply. I tried it this way but don't get it to work. Do you use one instance of the Adafruit_BNO08x class for both sensors (e.g. with IDs 0 and 1) or do you create two instances? (I tried both..)

Both sensors work by themself. The one initialized first works, the second one fails (begin_I2C(...) returns false). I swapped the code to init the other one first - it's not a matter of the sensor, the second one to initialize always fails.

I2C scanner finds both sensors on 0x4A and 0x4B.

I use the https://www.adafruit.com/product/5325 and two of the https://www.adafruit.com/product/4754; connected via the Stemma QT connectors.

#include <Adafruit_BNO08x.h>

#define SENSOR_COUNT 2
Adafruit_BNO08x bno08x;
const uint8_t I2C_ADDR[] = { 0x4A, 0x4B };

void setup(void) {
  Serial.begin(115200);
  while (!Serial) { delay(10); }

  Wire1.setPins(SDA1, SCL1);

  for (int i = 0; i < SENSOR_COUNT; i++) {
    if (!bno08x.begin_I2C(I2C_ADDR[i], &Wire1, i)) {
      Serial.printf("Failed to find bno08x chip with address %d\n", I2C_ADDR[i]);
      while (1) { delay(10); }
    }
    delay(1000);
  }
...

Any ideas what could be wrong?
I always get Failed to find bno08x chip with address 75 (which is 0x4B; if I swap both addresses in I2C_ADDR[] to { 0x4B, 0x4A }, 0x4B succeeds fails and 0x4A fails)

north stream
shell folio
#

Hello. We have a question about the motor "Servo Motor Micro MG90S – 360 Degree Continuous Rotation".
We use this motor so that we can position ourselves wherever we want. However, since we do not need it to turn at full speed, we cannot position it at a specific angle due to the lack of potentiometers.
Could you let me know how to control this motor?

This is Arduino code.

#include <AFMotor.h>
//#include <Servo.h>
#include <VarSpeedServo.h>

VarSpeedServo myservo;
//Servo myservo; 

int pos = 0;

void setup() {
  // The servo control wire is connected to Arduino D2 pin.
  myservo.attach(10);
  // Servo is stationary.
  myservo.write(90);
}

void loop() {
  myservo.write(100);
  delay(425);
  myservo.write(90);
  delay(1000);
    myservo.write(80);
  delay(350);
    myservo.write(90);
  delay(1000);
   
}

https://protosupplies.com/product/servo-motor-micro-mg90s-continuous-rotation/

The Servo Motor Micro MG90S - 360 degree continuous rotation servo is a micro size 360 degree analog servo with metal gears.

north stream
livid osprey
#

Without the addition of some encoder or potentiometer externally, there isn’t an accurate way of reading arm position.

#

If you need accurate position control and continuous rotation, consider adding closed loop feedback or switching to a stepper motor.

jovial isle
# north stream You'll need two instances of the Adafruit_BNO08x object, one for each sensor. Y...

Thanks @north stream for having a look. I tried it, but still encounter the same problem. Here's my updated code:

#include <Adafruit_BNO08x.h>

#define SENSOR_COUNT 2
Adafruit_BNO08x bno08x[SENSOR_COUNT];

const uint8_t I2C_ADDR[] = { 0x4A, 0x4B };

void setup(void) {
  Serial.begin(115200);
  while (!Serial) { delay(10); }

  Wire1.setPins(SDA1, SCL1);

  for (int i = 0; i < SENSOR_COUNT; i++) {
    if (!bno08x[i].begin_I2C(I2C_ADDR[i], &Wire1, i)) {
      Serial.printf("Failed to find bno08x chip with address %d\n", I2C_ADDR[i]);
      while (1) { delay(10); }
    } else {
      Serial.printf("Found bno08x chip with address %d\n", I2C_ADDR[i]);
    }
    delay(1000);
  }
...

It's again always the second sensor in I2C_ADDR[]that fails to init:

const uint8_t I2C_ADDR[] = { 0x4A, 0x4B }; -> 0x4B fails
or:
const uint8_t I2C_ADDR[] = { 0x4B, 0x4A }; -> 0x4A fails

Thank you very much for your help here, I highly appreciate it!

stable forge
stable forge
#

@jovial isle I'm discussing this internally, and it's not clear how easy this is to fix. It depends on the Bosch-supplied library we use underneath being re-entrant, and it may not be (but we need to look).

stable forge
north stream
#

That's unhappy

livid osprey
#

I'm more curious what the application is for multiple BNO085 sensors. Is the intention to read the sensor data simultaneously? If not, an I2C multiplexer like the TCA9548 could switch between multiple BNO085s without needing multiple instances of said sensor.

north stream
#

Unless the driver maintains some sort of state, in which case switching between sensors could result in confusion.

woven cradle
# north stream If your need is to position it at a specific angle, it's probably not the right ...

We currently have no other solution but to use this engine because it needs to follow the sun and because it is a prototype of small dimensions for our needs. So far we have found that we can control it to go clockwise and counterclockwise. How to control the speed, but we have a specific problem when positioning, for example, we need 30 degrees and it turns 30 but does not return to 0. This allows us to delay.. If you have any ideas on how to solve this, please suggest (without changing the motor) ...
Best regards and thanks in advance.

livid osprey
#

An accelerometer or magnetometer could also offer arm angle relative to the earth.

woven cradle
# livid osprey This servo has no position control, only speed control. In order to add position...

I am aware that this motor is intended only for speed control, but I think it can be countered with a delay, it is clear to me that it is not more precise, but I am just wondering if I can somehow make the mathematical calculation more precise, for example for speed 100 x=5.82*angle /360
and a certain number of seconds is obtained.
Thank you for giving me advice, it means a lot to me. ❤️

north stream
#

The speed will depend on the voltage, load, and even direction of rotation

livid osprey
#

The speed control is relative to its own max speed, which depends on the factors above and others too

#

Even temperature could make a difference in speed, which could make a difference in angle traveled.

#

You’d have to experiment with timings to see what works, but this won’t be suitable for much past one-off demos.

#

The speed control, to my knowledge, isn’t responsive enough for braking either, so precision is going to be very difficult to achieve.

north stream
#

If there's a particular position you care about, you could have a simple encoder that just actuates when it's at that position.

woven cradle
#

if I had the opportunity, I could put it on, but they told us to try it without the encoder, and I feel like I'm in the matrix while I'm looking for a solution.. initially it was very difficult to find out how to control it, but thank you for the ideas...

#

and if it's not a problem, I have one more question about the mgs90 micro servo 180 servo motor
how can I make it stand still with the help of the program.. because I've tried many ways and it's simply frozen and I don't need that because it can overheat and kill my arduino and everything alive

#

and thank you for help

north stream
#

I'm not sure what you're using to control it, but many motor drivers have a "brake" mode where they simply don't apply voltage, just connect the ends of the windings together. That will discourage rotation but won't heat the motor with power.

woven cradle
#

It's clear to me, but if I give it a job, it doesn't do anything, like at the moment there's no voltage, why it's stuck doesn't make sense to me... I used to work with various motors, but now when the question is servo, I don't know how to do it properly.

north stream
#

Oh right, it has its own built-in controller.

woven cradle
#

ugh I don't know how to solve any problem anymore, I'm not smart

woven cradle
livid osprey
#

What is your overall goal, and what is defining the hardware you're allowed to use?

woven cradle
#

I would like to start from the hardware, so from the hardware I have two servo motors, one of which turns 180 degrees and the other 360 degrees, the other one I have one motor shield and an arduino mega

#

the point of this project is to track the sun with the help of mathematical formulas, that's why I need a 360 servo... (I didn't choose and I can't choose, unfortunately)
and I specifically need to send it to a certain position, for example 223.3 degrees, and our question for that is whether to do it through a mathematical proportion or (I have no more ideas because I've exhausted everything).. And with the second engine I want (180degrees) while standing in a certain position, it doesn't work because it would waste energy unnecessarily, it's clear to me that the prototype is small, it's useless that my engine overheats...

livid osprey
#

Servos do draw power to hold a position. If force is needed to hold the arm in the right spot, your energy consumption does go up. If you don't need the servo to hold the position, you can disconnect power or stop sending signals to the servo to reduce power consumption when at rest.

#

I also see the word "prototype" a couple of times in the text. If the goal of the prototype is simply to demonstrate function, hopefully there is another opportunity to define more suitable hardware at a later stage of the design process.

north stream
#

There are 360° servos that aren't continuous rotation, that would have been a good choice, but as you said, that option was not open to you.

woven cradle
#

thanks for your help
I hope that I will succeed in some of what you told me
❤️

jovial isle
jovial isle
dense valley
#

Anyone got an idea as to why Arduino IDE claims that there is no device on the upload port?

Waiting for upload port...
Upload port found on COM10
"C:\Users\magla\AppData\Local\Arduino15\packages\adafruit\tools\bossac\1.8.0-48-gb176eee/bossac.exe" -i -d --port=COM10 -U -i --offset=0x2000 -w -v "C:\Users\magla\AppData\Local\Temp\arduino\sketches\BAAFA6A961ED28D5021055A5B278EB2D/samd21_blink.ino.bin" -R
No device found on COM10
Set binary mode
Failed uploading: uploading error: exit status 1
opal iris
#

How do I solve the com port access being denied? I need help!

Tried solutions:

Changed cable
Updated drivers of ports
Reinstalled software
PC Restart
jovial isle
opal iris
jovial isle
#

Is there another application open that accesses the com port? Like a Serial Monitor? Or another instance of the Arduino App? (Which, after a restart, like you said, really shouldnt be... just to make sure)

#

Or could it be that you have restricted user rights, like on a computer from a company, where the IT admins don't want to allow you the access to com ports? - but if you can install software, that also shouldnt be the case...

opal iris
#

I am using nrf5340 audio DK in my project. unlike other MCUs, it creates 2 COM ports. one for the application core and another for the network core.

#

I don't know whether that the reason behind this issue

vagrant oxide
#

how can i convert RGB565 to HEX on arduino

lethal yarrow
# vagrant oxide how can i convert RGB565 to HEX on arduino

Well, it's just 16 bits, so you could convert it directly to hex. But I'm suspecting what you actually want is to convert it to RGB888. That being the case, it'll look something like this:

typedef struct {
    uint8_t r;
    uint8_t g;
    uint8_t b;
} RGB888; 

RGB888 unpack_rgb565(uint16_t rgb) {
    RGB888 result = RBG888();
    result.r = rgb >> 9;
    result.g = (rgb >> 5) & 0x30;
    result.b = rgb & 0x20;
    return result;
}

-# DISCLAIMER: I typed this on my phone. It is untested.

obsidian knoll
#

This is technically not arduino but its relevant

#

I am trying to write an extremely basic test cpp class

#

led_builtin.cpp:

#include "pico/cyw43_arch.h"
#include "led_builtin.hpp"

LedControl::LedControl()
{
    cyw43_arch_init();
}

void LedControl::turnOn()
{
    cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
}

void LedControl::turnOff()
{
    cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0);
}

led_builtin.hpp:

#include "pico/stdlib.h"

class LedControl
{
public:
    LedControl();
    void turnOn();
    void turnOff();
};

main.cpp:

#include <stdio.h>
#include "pico/stdlib.h"
#include "pico/cyw43_arch.h"
#include "led_builtin/led_builtin.hpp"

int main()
{
    stdio_init_all();

    LedControl ledControl;

    while (true)
    {
        ledControl.turnOn();
        sleep_ms(250);
        ledControl.turnOff();
        sleep_ms(250);
    }
}
#

I just get undefined reference to `LedControl::turnOff()' when trying to compile

#

I cannot tell if this is a programming mistake or a build environment mistake.

#

I feel like I am going crazy. apparently you need to add stuff to cmakelists to be able to add classes to other files?

#

is there something i can read or watch that will explain how to break a simple c++ program up into multiple files?

#

no matter what I do I just get undefined reference to `LedControl::LedControl()

lethal yarrow
obsidian knoll
#

this is not arduino

#

there isnt really another channel for code that makes sense

#

its just cpp

lethal yarrow
#

Oh wait I had the discussions mixed up.

obsidian knoll
#

next time i will stick to arduino, this thing is impossible

#

i am just trying to get a crappy test project onto an rp2040. i cannot figure out how to get a separate.cpp and .hpp file to work

lethal yarrow
#

One issue is that you declare but never instantiate ledControl. The full line should be

LedControl ledControl = LedControl();
#

(it would work the same way with arduino, by the way)

obsidian knoll
#

yeah

lethal yarrow
#

Also, you need include guards in the hpp file.

obsidian knoll
#

i still just get undefined reference to `LedControl::LedControl()' on line 10, which is the declaration

obsidian knoll
lethal yarrow
#

Lack of include guards will cause a compilation error (although it isn't this error).

obsidian knoll
#

the more i add the more there is to break so i am trying to keep it as barebones as possible

lethal yarrow
#

Yes, but that's not something you can remove.

obsidian knoll
#

i have tried to add include_directories(src) to cmakelists.txt and that somewhat alleviates the error (goes from file not found to undefined reference)

#

i will try to figure out how to do include guards

lethal yarrow
obsidian knoll
#

unless i misunderstood what you said that does not fix it

lethal yarrow
obsidian knoll
lethal yarrow
#

Ok, that's a build env error. I don't have time to debug it right now.

obsidian knoll
#

its not even attempting to compile the file lol

#

only the main file is in the compilation command

obsidian knoll
#

i have been trying to make this work for 4+ hours now so i am going to take a break before i throw my laptop off my balcony.

lethal yarrow
#

That's probably a good idea.

#

And yeah, C(++) build environments have always been a mess.

obsidian knoll
#

the worst part is that there is zero documentation

#

nobody has just written down "how to set up a cpp build environment"

#

and the official documentation is useless because it assumes that you are a 70 year old gigaprogrammer with 38 years of experience

#

like thanks for not telling me what include_directories does lol

lethal yarrow
#

Unfortunately 40+ years of cruft have made "just writing it down" difficult.

obsidian knoll
#

doesnt help that the raspberry pi "project generator" generates the most useless, least functional "project" that is possible either

vagrant oxide
obsidian knoll
#

Yes

vagrant oxide
# obsidian knoll Yes

imma be real, using it looks miserable and insanely complex for beginners. id suggest using arduino pico instead

obsidian knoll
#

too late.

#

i have don a ton of arduino, python, etc

#

i literally just cannot make this thing compile

#

i can smash it all in one file and that would be fine

#

but that is gore and i dont want to do it

north stream
#

Looks like one file is including from a subdirectory and one isn't

rough torrent
#

I just use PlatformIO because I can still stay in the "relatively comfortable" Arduino environment and have those libraries and APIs but it's super easy to use multiple files cause it detects what H files you import and automatically compiles all CPP files. Then I also don't have to use the Arduino IDE which is a bonus.

green thunder
#

I've been playing around with some ideas for the LED glasses using the nRF52840 glasses driver board. Yesterday I started trying to do some work with the built-in LIS3DH and noticed that suddenly my program took a huge framerate hit. It seems like once I call begin() on the LIS3DH library, ~30ms of time is added to the execution loop, even if I never actually take any readings from the accelerometer. Prior to adding the accelerometer code my entire loop was ~10ms so this is a pretty massive slowdown. Is this expected? Is there anything I can do to mitigate this?

green thunder
#

Okay I have a little more info. It seems to be an unexpected (by me) interaction due to using both the LISD3H and the IS31FL3741 LED driver. Each frame I'm calling show() on the LED driver, which prior to calling begin() on the LISD3H would take about 9-11 ms to complete. Once calling begin() on the LISD3H, the LED driver show() method takes about 40 ms. Seems like it's I2C related but I'm not sure what the exact culprit is yet.

green thunder
#

Well, I found a "solution", but I still don't completely understand the reason. Apparently you need to call begin() on the LISD3H driver before calling begin() on the IS31FL3741 driver 🤷‍♂️. Doing it the other way causes updating the LEDs to take about 4 times longer.

stable forge
#

are you making any other calls to the LIS3DH library in the loop?

green thunder
#

Nope, all I was doing was calling the begin() method on it. Never referenced the accelerometer in the program after that

#

now that I've swapped the initialization order, I added code to take readings, and everything is working as expected, with no framerate hit

stable forge
#

could you upload your sketch with the + to the left?

green thunder
#

Let me make a sample sketch for you with just the relevant code, this sketch has grown quite large lol

stable forge
#

and confirm that sketch has the problem too 🙂

green thunder
#

Here's a minimal reproduction of the issue. You can see the difference in the output depending on whether initAccelFirst is set to true or false.

#

@stable forge

stable forge
#

so if you set up the IS31 first, the bus is inited and set to 400 kHz, but if you set up the LIS3DH first, the bus is already inited and I bet the speed change does nothing

green thunder
#

I'll bet that's the case too. Interesting though, because I didn't know the nrf52840 could have an I2C bus speed faster than 400k 🤔

stable forge
#

no the speed is 400 kHz (400000)

green thunder
#

my bad that's what I meant

#

the code in Wire_nRF52.cpp also leads me to believe that's the case 🤔

void TwoWire::setClock(uint32_t baudrate)sorry  {
  if (master) {
    _p_twim->ENABLE = (TWIM_ENABLE_ENABLE_Disabled << TWIM_ENABLE_ENABLE_Pos);

    uint32_t frequency;

    if (baudrate <= 100000)
    {
      frequency = TWIM_FREQUENCY_FREQUENCY_K100;
    }
    else if (baudrate <= 250000)
    {
      frequency = TWIM_FREQUENCY_FREQUENCY_K250;
    }
    else
    {
      frequency = TWIM_FREQUENCY_FREQUENCY_K400;
    }

    _p_twim->FREQUENCY = frequency;
    _p_twim->ENABLE = (TWIM_ENABLE_ENABLE_Enabled << TWIM_ENABLE_ENABLE_Pos);
  }
}
stable forge
#

"that's the case" not sure what you mean

green thunder
#

sorry, I mean to say that it seems like, according to the code there and the documentation I've found, 400 kHz should be the max speed

stable forge
#

LIS3DH first: bus is inited and set to 100 kHZ.

green thunder
#

ah!

#

understood

#

that's why I was confused

stable forge
#

IS31 first: bus is inited and set to 400 kHZ

green thunder
#

okay that makes much more sense

stable forge
#

sounds like this should be in the guide

green thunder
#

Agreed! Thanks for taking the time to look through this with me. Hopefully this will prevent headaches for others in the future 😄

stable forge
#

in fact, some of the examples do it in the "wrong" order

green thunder
#

I think that one's right. The LIS3DH needs to go first

stable forge
#

oh, hmm, I thought it was the other way round. OK, maybe my expalnation is wrong

green thunder
#

🤔

stable forge
#

or maybe the lis3dh initialization sets it back to 100 kHZ

#

ok, i bet that's it

green thunder
#

makes sense

#

Fortunately I think the code in the examples is fine, so anyone just working from that would probably never notice the issue. I do think it'd be worth a special note somewhere in the glasses guide anyway though

stable forge
#

i will add one as soon as understand what is really going on

green thunder
#

Yeah I was about to say, assuming the issue can't be fixed for whatever reason.

#

okay yeah I think I traced the code, and you're right

stable forge
#

where are you seeing the "don't change it"

green thunder
stable forge
#

where are you seeing that the IS driver setting the speed to 400 kHz is not taking effect?

green thunder
#

oh gotcha

#

so the begin() method in both the LIS3DH and the IS32FL classes call i2c_dev->begin()

#

That takes us to bool Adafruit_I2CDevice::begin(bool addr_detect), which finally calls _wire->begin()

#

in the IS32FL class, after that, it then manually sets the clock speed to 400 kHz

#

the LISD3H class does not do that

#

and the _wire->begin() call sets the speed to 100 kHz

stable forge
#

ok, got it - I didn't see the last thing

green thunder
#

so, that seems to support your theory that the IS32FL driver is setting the speed to 400 kHz, and then the LIS3DH is setting it to 100

stable forge
#

got it. I'll add a warning box somewhere in the guide

green thunder
#

Thanks!

#

Also as a further bit of confirmation, if I add Wire.setClock(400000) after initializing both objects, then the order doesn't matter.

obsidian knoll
# obsidian knoll

@north stream @lethal yarrow update on trying to get separate cpp/hpp files to work:

I fixed it. dont know what this does, but it makes files in /src work.

in cmakelists.txt:

file(GLOB_RECURSE PROJECT_SOURCES ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp) # NEW TO MAKE SRC FOLDER WORK

add_executable(projectname
        main.cpp
        ${PROJECT_SOURCES} # NEW TO MAKE SRC FOLDER WORK
        )

file(GLOB_RECURSE HEADER_DIRS LIST_DIRECTORIES true ${CMAKE_CURRENT_LIST_DIR}/src/*) # NEW TO MAKE SRC FOLDER WORK

target_include_directories(projectname PRIVATE
  ${CMAKE_CURRENT_LIST_DIR}
  ${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required
  ${HEADER_DIRS} # NEW TO MAKE SRC FOLDER WORK
#

i click compile, there are no errors. I don't know why, and can't find any documentation or tutorials or anything that explains why this works. all I know is that the glob_recurse bits are somehow finding relevant files in the src folder and passing them in to other config lines which existed already from the project generator.

#

so if any of you know what the heck this does, I am all ears :)

north stream
#

Ah, I did not know you were using cmake

regal star
#

Hi folks - I am a bit new to ESP32 programming to so go easy on me... hoping I have a silly question here... I am working with my FeatherS2 programming it with the Arduino IDE - everything I am doing works great with the board plugged into my computer but when I try to run it off battery (3.7v ICR18650) it doesnt seem like it is doing anything... I know the LDO2 needs to be enabled by setting GPIO21 to HIGH (which I have done) - but what else am I missing?

eternal cloud
sage lichen
#

Hey guys, bit of a question. I am usibng an Adafruit Huzahh ESP8266 to control some neopixels & run a webserver. For some reason, the board force-resets periodically every few minutes. I've tried a few different things to isolate the issue, such as reducing the number of neopixels & adding yield() invocations in case the neopixel code was taking too long and timing out the watchdog timer, but no luck. Any ideas? I can share code as needed ofc

north stream
#

Sounds like a power supply problem

stable forge
sage lichen
#

The power supply is new, and I also had it connected to my computer over usb as well

#

I was able to narrow down the problem area to specifically when strip.show() is called (even though the wdt timeout is intermittent, every time it fails is during that call). I also noticed that it occurs regardless of the neopixel strip size, as I am getting the same issue with both a 10 pixel strip and a 144 pixel strip

stable forge
sage lichen
stable forge
#

I do not know. You could upload your code here. Use the + to the left to upload the file. You could also ask in the forums, where the offical support people hang out.

sage lichen
stable forge
#

do you have to make strip.show() be in a critical region? Does it mess up if you don't?

#

you are calling MDNS.update() a lot. I would think that is expensive.

stable forge
stable forge
sage lichen
sage lichen
stable forge
stable forge
#

Once every ten seconds might be fine. I really don’t know.

#

I’d do some web searching on this

sage lichen
sage lichen
stable forge
sage lichen
tepid crow
#

Hi all, trying to use Arduino as a standalone UPDI programmer for ATtiny816. I followed the example code for ATtiny817 https://github.com/adafruit/Adafruit_AVRProg/tree/master/examples/attiny817_updiprog
However, I cannot compile the project in Arduino IDE due to error:

avrprog.setUPDI(&Serial1, 115200, AVR_POWER); // can also try 230400
^~~~~~~
Serial

exit status 1

Compilation error: 'Serial1' was not declared in this scope

It's true that Arduino Uno doesn't have Serial1 interface, so this should fail. However, in this tutorial video from Adafruit https://blog.adafruit.com/2021/10/05/fast-standalone-updi-programming-library/, she could still use serial monitor and UPDI interface at the same time. I read the source code and I'm really sure it must use 1 serial interface for UPDI programming, and I don't think debug print can share the same serial interface as it willl break the programming messages. So what is the secret here that I don't know can someone please tell me? Thank you

#

Another question I have for this UPDI standalone prorgammer library is that if it's possible to program both eep file and hex file? If yes, how can I configure it in the images.cpp file?

tepid crow
#

But why Adafruit published the library that uses a totally different code from the code they used in the video?