#help-with-arduino

1 messages · Page 12 of 1

grave mortar
#

Sorry it's late

#

ohhh I think I get it now the ACK for the 0x02 is the last bit in the green bar, but the ACK for the command is the low with the orange square.

cedar mountain
#

No, the 0x02 byte is 0000 0010, but only the top 7 bits are the register address: 0000 001, which is register 0x01.

#

That 8th bit in the first byte is the top bit of the value to write into the 9-bit register.

grave mortar
#

👀 kk lemme try and see if that makes sense for what I expect

#

yeah doesn't seem to make sense where is the ACK for bits 15 to 8

#

Ope no I get it now thank you so so much

#

So this is register 2? and is sending 0001 1000 0000 which is
// [9:11] is set to: 000 (extra bits)
//ROUT1EN [8] is set to: 1 (enable headphone out)
//LOUT1EN [7] is set to: 1 (enable headphone out)
//SLEEP [6] is set to: 0 (no sleep)
//BOOSTENR [5] is set to: 0 ()
//BOOSTENL [4] is set to: 0 ()
//INPPGAENR [3] is set to: 0 ()
//INPPGAENL [2] is set to: 0 ()
//ADCENR[1] is set to: 0 ()
//ADCENL[0] is set to: 0 ()

#

Is that what this function is doing automatically? adding the first bit from val to the end of reg?

cedar mountain
grave mortar
#

Nice will have to pull out all the corrected values from my capture and I should be good.

grave mortar
frank field
#

is anyone aware of a touchio library for arduino?

It looks like I made the mistake of wiring up a custom rp2040 board like I would for circuitpython, gpio with 1M pulldown to an exposed pad. But I'm not finding anything so far that would do the same like touchio

stable forge
#

The code there is not microcontroller-specific

#

your custom board could quite possibly run CircuitPython using the Pi Pico build (or a custom build). The Pi Pico build exposes all the pins so you would just use the pins you have exposed.

frank field
#

thanks danh - I've run CP on a bunch of custom boards with great success. this specific one relies on some fastled code that I wouldn't have the time to move over. I'll look at that code

grave mortar
#

I feel like I'm missing something obvious about why my arduino isn't seeing this write? using esp32 if that matters, wires are correct.

quick hornet
#

I am looking for some help with troubleshooting an intermitent Neopixel LED issue with the RP2040 and FastLED. Please see here for some more details and a video of the issue.: #help-with-circuitpython message

north stream
#

Looks like a data wrapping issue or a hardware problem

quick hornet
#

I don't have the issue when using CircuitPython code that addresses all LEDs fine

north stream
#

So, not a hardware problem.

muted gyro
quick hornet
#

I don't believe so

#

I have swapped that LED for a new one and it still flashes blue

grave mortar
quick hornet
north stream
#

I'll often pulse an I/O lead to indicate a function was called. You can watch it with an LED, oscilloscope, etc.

quick hornet
muted gyro
quick hornet
muted gyro
north stream
#

It looks like you're pointing all of the initializers to the same spot in the same LED array

#

Apparently FastLED deals with that for you

grave mortar
quick hornet
#

Sometimes the data pin drops down to 0 volts

#

This is measuring the data on the faulty strip

#

Here is how it looks with the correct CircuitPython code

#

And here it is with the FastLED library

lethal yarrow
#

What are your horizontal and vertical scales there?

quick hornet
#

500 mV/div and 300 us/div

#

I have level shifters
3.3v to 5 volts
Unless they aren't working?

lethal yarrow
#

And what sample rate is it using?

quick hornet
#

2.7 MHz

lethal yarrow
#

Can't read the text in those images. Super low resolution.

quick hornet
#

You can read them if you click on them and pick Open in Browser

#

That will open the uncompressed image

#

On mobile the option is in the menu on the top right when you tap on an image

grave mortar
muted gyro
#

huh, might be. Check the RP2040 datasheet what voltage it considers high

grave mortar
#

using esp32

muted gyro
#

ah lol right

#

then that datasheet 😆

grave mortar
#

😆

#

come on penpengu get your act together/j

muted gyro
#

come on clump, just port everything to RP2040! 😝

grave mortar
#

I mean I was using that but I think it might be the same issue haha

quick hornet
grave mortar
#

lol that's what I'm soldering up right now ahah

muted gyro
#

Warning - really usure about this: I think there are some level shifters that aren't fast enough for Neopixels🤔

quick hornet
quick hornet
muted gyro
#

ah lol perfect

quick hornet
#

But, I'm starting to worry that they are the issue

#

I wonder if one of these logic level shifterw would work better

#

But, it's still strange that the board works fine when using CircuitPython

#

Something with how FastLED works on the RP2040 seems to be the issue.

grave mortar
#

any idea why my level shifter is more like a level inverter 😬

gilded swift
grave mortar
tender sinew
#

hi anybody alive

#

I would like to know how to smoothen out the brightness of LED from Arduino code

#

Currently this is the code that I am using. Very simple.

#

For now it reacts really fast

#

It would be nice if I can have smoother blinking instead of instant blinking like that.

elfin hare
#

a slower rise in brightness when you press the button?

tender sinew
#

and it's audio signal's CV Voltage coming out from another microcontroller

#

getting into A0 on Arduino Uno, reading the signal in real time

tender sinew
#

I am trying this one

#

I don't know if it smoothened it a bit or no.

#

But this is def not what I am looking for.

#

I am looking for longer decay

#

if anybody knows how to achieve it, lmk!

north stream
#

The basic technique is to implement a peak detector, so you'd have a stored brightness value. If the input voltage is higher, reset it to the input voltage. Otherwise, reduce it by a given fraction each time period to implement the decay over time.

tender sinew
#

I understood what you mean but it's hard for me to code

tender sinew
#

@north stream Idk I just can't lol

north stream
# tender sinew <@348911944486486016> Idk I just can't lol

Basically, you'd want to write the peak value instead of the brightness value. I whomped up some code that does a proportional dropoff (the percent of drop is set by the DROPOFF amount). I kept your update rate of 80ms, but hoisted that value into a #define. I'm not sure whether peak needs to be a float to do the dropoff, but I made it one just in case: ```arduino
#define DROPOFF 1
#define INTERVAL 80

static float peak;
unsigned long nextupdate;

void loop() {
int DACValue = analogRead(DAC_PIN);
int brightness = DACValue/2;
unsigned long now = millis();

if (brightness > peak) {
// update peak because incoming signal is greater
peak = brightness;
} elif (now > nextupdate) {
// update peak because it's time for a decay increment
// subtract a percentage of the current value
peak *= (100 - DROPOFF) / 100.0;
} else {
// no updates this time, skip timer reset and output
return;
}

analogWrite(LED_PIN, (int) peak);

nextupdate = now + INTERVAL;
}

tender sinew
vale mason
#

Okay here

#

Guys i need help with connecting my feather nRF 5284 to the phone through adafruit connect app

grave mortar
#

Hey sorry to bother y'all again but this i2c is a beast I can't wrangle, I finally got my pico to reply to the request, but it seems to be holding the line low after the read request. any idea on how I rease this?

grave mortar
#

I got it to release the line by adding the on request function, but it takes 133ms and it says it's writing the TxByte but over 3 seconds?

grave mortar
tame valve
#

is there any reason the adafruit mositure sensor would only return FF for the eeprom?

tender sinew
#

It just blinks longer, once.
And I also don't understand that else if's condition. How could now become bigger than nextUpdate?

wooden barn
#

whats up theydies and gentlethem

#

im in a quest for knowledge

#

i have a Adafruit Metro ESP32-S2 and after going over all the documentation i cannot find out whats the max output current wise i can get out of the Logic pins

#

i am trying to switch 4 transistors or even relays

#

but im unsure as to how much juice i can get out of them

#

thanks in advance for any info

tame valve
#

Does anyone use the seesaw moisture sensor?

north stream
tender sinew
#

nextUpdate will be always greater than now. no?

#

And also, the LED doesn't change gradually. instead, it just shuts the light immediately.

north stream
#

nextUpdate should only be reassigned if the peak is updated (either by the incoming signal being greater, or the time reached for it to decrement): that's what the final else clause is for, to return out of loop() if neither of these conditions apply.

stark kindle
wooden barn
#

Oh I was supposed to look at the esp32-s2 datasheet itself

#

That makes more sense

#

I appreciate it big time @stark kindle

#

I'm going to be using some 2n222s to switch some relays and I have to make sure it ain't gonna hurt nothing

#

Thank you very much

#

Now I can go size the resistor

stark kindle
tender sinew
#

@north stream Ok but why does this doesn't work toebeans toebeans toebeans toebeans

tender sinew
north stream
north stream
wooden barn
#

but they are more than beefy enough for what i need

#

it should work very well with the motors i got

#

im gonna solder em onto a PC board and throw the transistor and resistor on there too

red pine
#

I wanted to extend my thanks for this recommendation, it has been brilliant! What a great controller. I'm throwing memory caution to the wind and making all sorts of instances of my effects 😅

Also I know I won't max out its LED-driving capacity any time soon as my projects currently have at most 50 LEDs, and even the biggest future project I'm considering might drive 500 of the 5050 LEDs.

Thanks again, Scorpio is awesome! 👍🎉

cold lagoon
#

Hi. I cant get custom partitions for my esp32 working. I made a new .csv file and copied over the default_16MB configuration (just to test). I added it to the boards.txt file to the appropriate esp32 board (ESP32-WROOM-DA Module) but after restarting the arduino IDE no new partition option shows up. I also tried changing an existing one app3M_fat9M_16MB but it still shows up as before.
I also read that you had to put the .csv file in the same folder as the sketch but that didn't work ether

hazy moon
#

anyone having problems driving the waveshare 1.54 200x200 rbw V2 bare screen with the Adafruit e-ink friend and adafruit_epd library? I'm on 4.5.2 (latest) of the adafruit library and initializing using the example tri-color app. It's partially working but never setting the background to white. I've checked the same screen with the waveshare dev board and their sample code, and it displays properly. They have code branches, however, for v1 and v2 boards, so something has changed.

lilac ginkgo
#

no idea about the libary, but what does "not setting background white" mean?

  • random colors (aka noise)
  • background with another color
  • something else i didnt think of
dense yacht
#

im not too sure why, but my sensor is updating very slow

Adafruit 9-DOF Orientation IMU Fusion Breakout - BNO085

millis, sensorValue.un.rotationVector.real
6076 0.33
6179 0.33
6303 0.38
6405 0.38
6529 0.14
6631 0.14
6753 0.07
6856 0.07
6978 0.07
7081 0.07
7203 0.07

#

so, ~ 200 ms between unique values

#

200 +

#

what are some things I can check?

stark kindle
signal gust
#

Has anyone here messed with SquareLine to develope a UI on an arduino or esp32 platform?

deep steeple
#

I'm doing some model railroad automation and been using some of the L298N motoer controllers but get some high coil wine at low speeds, would it be better to change the motor controller I'm using or the code? <-- Played around and found upping frequency helped, 20khz got it silent

hazy moon
red pine
#

I'm working on an LED project that uses the Adafruit Feather Scorpio to drive two sets of LEDs; one set of 2020-sized RGB NeoPixels and another set of 5050-sized RGBW NeoPixels.

I'm currently using the Adafruit_NeoPixel.h library and I'm trying to use an IR remote to change "scenes" which worked when my project was just 8 LEDs and some simple animations but now is malfunctioning as my project has grown to 39 LEDs and a number of more complex animations.

I believe the issue is that the Adafruit_NeoPixel.h library is pausing interrupts, causing IRRemote.h to fail to properly see the button-presses accurately. Is there a work-around for this?

Could I siwtch to the NeoPXL8 library? Does that support the use of multiple types of LED simultaneously like I currently have?

quartz furnace
#

Any idea why this uplands fine to an UNO but doesn’t play nice with an ESP32?

#

It’s just I2C based

stark kindle
quartz furnace
#

Doesn’t build

stark kindle
#

And the errors are...

quartz furnace
#

I can get it in text , but I’m laptop isn’t signing into here

I’m currently on my phone

stark kindle
#

Normally I hate photos of screens but yours is abnormally legible 😉

#

thanks for posting that, it makes it much easier to help

quartz furnace
#

Welcome:)

#

I’ve tired declaring SCL SDA at the top of….

stark kindle
#

You'd need to have them be defined for Seeed_Arduino_GroveAI.cpp as well

quartz furnace
#

Exact board is Adafruit QtPy ESP32

Pins are 19 and 22

#

Ahhhhh

stark kindle
#

Yeah, ESP32's Arduino Core doesn't use those constants (as you see). It's odd that they did this and then suggest using this with an ESP32-C3, which also would not build it :/

quartz furnace
#

Yep just out of troubleshooting I did try a C3!!!

stark kindle
#

suggested alternative FUN_IE_S ... oh Arduino IDE... 😂

#

@quartz furnace is it possible you have an old version of the library? I'm looking at it on Github and I'm not seeing PIN_WIRE_SCL or SDA though they're clearly in the code you're building...

#

the library doesn't have version numbers 😦

quartz furnace
#

Mine matches the wiki page they have

stark kindle
#

yeah there's only one commit to Seeed_Arduino_GroveAI.h too, so there isn't an older version from what's on github...

quartz furnace
#

Hmmm so am I stuck ?

stark kindle
#

I had the wrong repo 🙂 the code in the correct one does match what you're using, I'm taking a look at it now

#

I think they just wrote it and never tested it with an ESP32. The easiest fix would be to locate Seeed_Arduino_GroveAI.h and edit it and add the #defines for the two constants at the top, that should fix the error (hopefully that's slightly different from what you did already). You should be able to find it in the path in the error message - Documents/Arduino/libraries/Seeed_Arduino_GroveAI-master

#

@quartz furnace Another option if this is a long term thing you want to share with other people would be to fork the Github repo, make a change to your fork, and then have your program use your fork instead of theirs. But if you just want to get this built and use it and then not worry about it, editing the .h file locally is the easiest thing.

quartz furnace
#

Looking at .h file now

#

So example “#define PIN_WIRE_SDA = 19”

stark kindle
#

Close - no "=" - #define does a text substitution, it's not a variable. So #define PIN_WIRE_SDA 19 and then anywhere after that that the pre-processor (which gets run before the compiler) sees PIN_WIRE_SDA it will replace it with 19

quartz furnace
#

Sayyyyy whatttttttt

#

It compiled 🙂

#

Now to see if it actually works

stark kindle
#

Awesome!

#

Yeah I can't promise it'll work but at least now it has a chance to. Good luck, I hope it does 🙂

#

You were very close to fixing this on your own

quartz furnace
#

Many thank YOUs 😄

#

Well it doesn’t work —- getting a “Algo begin failed” in the serial console

#

Darn

#

I bet I’m going to have to modify the GROVE_AI_ADDRESS

#

Ahhh I’m using the qwiic port , it’s SCL1/SDA1 Do I have to use the pins on the actual side of the board SDA/SCL (0) @stark kindle ?

#

So to be clear I had the numbers correct on the qwiic port 19 & 22 — but they are the “2nd” set of WIRE pins

#

And then update with the define 4 & 33 ?

#

With this board having a camera as well as a processor, it might be an over sized power consumption for the qwiic port ? 🤷🏻‍♂️

stark kindle
#

@quartz furnace the address of I2C devices is embedded in the device (all devices of a particular kind have the same address,), so you shouldn't need to change the GROVE_AI_ADDRESS

But you will need to give the right SCL and SDA pin numbers for however you have it connected. I don't know the specifics of the board you're using but it sounds like you're on the right track

#

If you get stuck on that and aren't sure if you've got I2C configured correctly or whether there's a problem with the Grove camera software you can build an i2c_scanner sketch and load that on the ESP32 - if I2C is set up correctly it will see the camera and report 0x62. If it doesn't then it won't report any I2C devices (if the Grove camera is the only thing connected). You may have to modify the i2c_scanner sketch to use the correct SCL and SDA pin numbers.

quartz furnace
#

Ahhh good point .. I have done the scan for I2c before !!!! I’ll start there!!

stark kindle
quartz furnace
#

Thanks again!! Enjoy the break!

#

I got it to work — I had a random thought that the C3 QtPy board has the default I2c pins for the qwiic connection not the 2nd set .. updated with C3 pins and it works 🙂

charred jacinth
#

Has anyone used the nrf feather? I heard it has internal power for buttons. I have 6 buttons I wanna use for my project so I wanna know if I have to power them with or I can just wire it right to the pin.

lilac ginkgo
ebon cloud
#

hey ,
im using an esp32 and a gc9a01 tft ,
i want it to have a function which will get a text as an input and will print it on the screen (let say up to 100 words for now) .
but i want the function to handle all the manual work .
like the screen width , height , new lines , and in case theres no space left on the screen to clean the screen and start from the top again.

can someone provide an example?

red pine
#

Sorry just resending hoping for some help here:

I'm working on an LED project that uses the Adafruit Feather Scorpio to drive two sets of LEDs; one set of 2020-sized RGB NeoPixels and another set of 5050-sized RGBW NeoPixels.

I'm currently using the Adafruit_NeoPixel.h library and I'm trying to use an IR remote to change "scenes" which worked when my project was just 8 LEDs and some simple animations but now is malfunctioning as my project has grown to 39 LEDs and a number of more complex animations.

I believe the issue is that the Adafruit_NeoPixel.h library is pausing interrupts, causing IRRemote.h to fail to properly see the button-presses accurately. Is there a work-around for this?

Could I siwtch to the NeoPXL8 library? Does that support the use of multiple types of LED simultaneously like I currently have?

muted gyro
#

(I don't know, just some thoughts:) Can you just try it out? There are also a few other neopixel/WS2812 libraries, maybe try those. Could you run the LED code on one core and the IRRemote on the other?

red pine
#

I made an attempt to switch over and adjust the code as best I understood how to work with the neoPXL8 library. My updates compiled, but it kept crashing the Scorpio. Before I make myself insane, trying to fix it, I just want to know if it’s even possible to use the multiple LED types simultaneously. 😅😂😜

livid osprey
red pine
#

nevermind, I built a work-around where the project pauses all LED updating for 2 seconds when it first detects any IR input at all, then it's able to respond to a subsequent button press properly during those 2 seconds! (interrupts work correctly if the LEDs aren't actively updating)

#

Not perfect, but completely functional and easy

long robin
#

Is the old matrix portal no longer supported in Arduino 2.2 I dont see it in adafruit boards drop-down in Arduino 2.2+ TIA

stark kindle
long robin
stark kindle
# long robin

You need to select "Adafruit SAMD Boards" in the board manager when you look for the board. It's two below what you did select. See my screencap.

long robin
stark kindle
#

When you post things like this it'd help if you sent screencaps rather than photos of your screen. Photos can be blurry and hard to read in ways that screencaps will not.

long robin
long robin
livid osprey
# long robin

Check the “Adafruit SAMD” boards two options down from “Adafruit Boards.”

#

Not in the board manager, in the board selection drop-down

long robin
#

Some updates today then restarted Arduino now the boards there, was ended at hallowing last night, odd! But seems good 👍 now thx.

fallen gate
#

How do i get the adafruit SAMD to show up in the board manager

#

all i have

#

found it

inland gorge
small prairie
#

I’m using a ss1306 oled feather wing. I have a sketch working when connected via USB but when I try to run on battery the screen doesn’t work. The feather and other connected devices are working.

leaden walrus
small prairie
#

@leaden walrus I removed all serial code from my sketch

leaden walrus
#

sometime a delay is needed in setup() as well

#

can you link your current code?

small prairie
leaden walrus
small prairie
#

Thank you that did it!

dull pond
#

Good afternoon everyone, I was wondering if I could get assistance with using the Feather M0 (with RFM95 LoRa Radio for referece) with MicroSD card breakout board+? I've checked the pins a few time and ensure I'm calling the right GPIO pin assigned to the CS pin.

However, it saying "Initializing SD card...Card failed, or not present" from the if (!SD.begin(chipSelect)). When I wire the SD breakout board with my Arduino Nano, it works all good and saves on the SD card.

Could it be something within the script I would need to change (using Datalogger example with chipSelect = 10;)

muted gyro
# dull pond Good afternoon everyone, I was wondering if I could get assistance with using th...

Are you sure those pins are right for SPI? For what board is that example code you have? The feather M0 might have a completely different processor with different capabilities regarding what pin can do what. You also might have to tell it something like "SPI mosi is on pin x, miso pin y, etc" before begin of the sd card. I would doublecheck that feathers documentation and pinout.
(I don't know about the feather M0 specifically. But what I'm describing is a common "issue" on RP2040 because that MCU is different than classic standard arduinos.)

dull pond
# muted gyro Are you sure those pins are right for SPI? For what board is that example code y...

I'm pretty sure those are the right pins for SPI, confirmed it by using a Nano. The example code was meant for an Arduino Nano (https://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial/arduino-library), which I assumed would work as I used the BNO055 example's scripts with no problems. That's a great suggestion, I know for CircuitPython those would need to be declared but I don't think so based on the example script.

Most definitely, it might be the case but with it working with the BNO055 (I2C) I assume all should be fine with using it with Arduino scripts as instructed in their guide (https://learn.adafruit.com/adafruit-feather-32u4-radio-with-lora-radio-module/using-with-arduino-ide)

muted gyro
#

To be completely honest, I really don't know if those are the right pins or not. Just, this

I'm pretty sure those are the right pins for SPI, confirmed it by using a Nano
Is wrong. Feather M0 uses a Samd21 MCU while the Arduino Nano uses an ATmega328. They're completely different. Which pins can do what is completely different.

#

And I also don't understand the pinout diagram. Too early after waking up to understand that wall of text in the top left corner and what even sercom is

hazy belfry
#

Hey I'm working on a program to make a lock using fingerprint sensor and i used the enroll program/code from your website but it keeps showing an error message

#

Can someone please help??

#

And yes I am using an audrino uno

wind drift
#

Question:

I am currently using an arduino mini pro + a sd card breakout board to play some audio tracks.

I want to create a custom pcb with a much smaller footprint.

Is there some IC that I can use that is:

  • easily accessible
  • "ease" to use
  • has enough integrated storage so I can avoid the sd card?
muted gyro
# wind drift Question: I am currently using an arduino mini pro + a sd card breakout board t...

something like https://www.adafruit.com/product/5643 or https://www.adafruit.com/product/4899 maybe? (haven't used them, so idk how easy they are. But you could try the adafruit modules with their libraries and then maybe integrate the chip onto your board.)

livid osprey
livid osprey
# wind drift Question: I am currently using an arduino mini pro + a sd card breakout board t...

Sounds like you want something similar to https://www.adafruit.com/product/2220 but on your own custom board. Adafruit does offer schematics and layouts for reference, if you want to build something similar.

wind drift
#

Hmm - is it possible to program it too? I need the sound to play only in specific cases

livid osprey
#

Or use a microcontroller to trigger the button inputs

wind drift
#

Another question - I have some old arduino pro micro boards laying around.
For some reason it can't find the COM port - but I need to read the serial monitor

#

I am able to upload a sketch by shorting the GND and RST pins quickly

waxen hawk
#

Hey guys, I am asking a bit of a control theory question. Does anybody know how to tune a pie controller for analog dimming of a led driver?

livid osprey
waxen hawk
livid osprey
#

Is this something that has to be done with a DAC? Would some type of constant current source work?

waxen hawk
#

Yep it will be done on dac. It is a constant current system. However, tuning it pid to achieve various set points is tedious (unsurprisingly)

livid osprey
#

It can be very tedious, indeed. That’s why the simplest constant current sources are usually built from transistors or specialized ICs instead. Hence why I wanted to see if you were locked into the DAC option, as it’s definitely not the easiest way to do it.

#

For a DAC based control loop, you also need a current measurement device, which usually involves another specialized IC or a differential ADC across a shunt resistor.

#

If you are already locked into this hardware, you can calculate some theoretical values based on the desired response of the device, or guess and test values based on a simple P or PI controller.

#

But off the top of my head I forget the formulas. Are you sure this is the method you need?

#

It’s also worth noting that most precision DACs aren’t designed to output significant amounts of current, you may need an amplifier depending on your load.

waxen hawk
#

Yeah unfortunately, existing project specifically controls dac.(so redesign to pwm (being a popular for leds) would require a lot of works)

#

Yeah if you have specific formulas to give some guidance could help. Am looking for some ideas. Perhaps those formulas can help me find the range of KP and KI that can work

#

From what I can experiment, fyi, PI is the most effective and you can get away with just P.

livid osprey
waxen hawk
#

Great thanks! I will take a look at this

lethal yarrow
#

What type of DAC? If it's an MDAC, there may actually be a pin to an internal resistor that lets you close the feedback loop and set current.

waxen hawk
#

Just a dac no op amp to multiply by.

fast jacinth
#

the serial monitor gets stuck on the following:

9697949593919289908887868584838281807978

void loop() {

if (j % 5 == 0) {
Serial.println("**********************");

TB.printI2CBusScan();
canvas.fillScreen(ST77XX_BLACK);
canvas.setCursor(0, 25);
canvas.setTextColor(ST77XX_RED);

Message (Enter to send message to 'LOLIN C3 Mini' on 'COM4')
New Line
9600 baud
00:47:55.025 -> ESP-ROM:esp32s3-20210327
00:47:55.025 -> Build:Mar 27 2021
00:47:55.025 -> rst:0x15 (USB_UART_CHIP_RESET),boot:0x0 (DOWNLOAD(USB/UART0))
00:47:55.025 -> Saved PC:0x40041a79
00:47:55.025 -> waiting for download

stark kindle
#

That indicates it’s in bootloader mode. Try pressing the reset button. Don’t hold down the boot button.

fast jacinth
#

the reset button does not appear to do anything. It restarts the display and goes straight back to the same screen

livid osprey
#

Is it possible something is shorting the boot pin to ground?

inland gorge
#

@fast jacinth Yeah looks like the BOOT pin is being held low (button pressed) on power up if you’re seeing the Espressif bootloader in the serial monitor

fast jacinth
#

Hmm, i know D0 is the boot button, but is there a boot pin as well i need to check? I am not sure why that might be shorting, this is a new board

#

I am getting different behavior when i press the boot button vs when i dont, so i dont think the button has been shorted or anything. (ie pressing reset with D0 held vs without)

inland gorge
fast jacinth
inland gorge
leaden walrus
#

are you seeing the FTHS3BOOT folder showing up when the TFT shows the boot screen?

inland gorge
#

@fast jacinth you may also want to upgrade the UF2 bootloader on your board. You're running 0.12.3, current version if 0.16.0. If you go here https://github.com/adafruit/tinyuf2/releases/tag/0.16.0, download the file "update-tinyuf2-adafruit_feather_esp32s3_reverse_tft-0.16.0.uf2" and copy that onto your board in UF2 mode, you'll update the bootloader firmware. You should see the version change after the board finishes flashing and resets.

fast jacinth
toxic flare
#

Heya, I was just wondering: I'm working on a board carrying a SAME51 chip, which is almost identical as the SAMD51 on the Grand Central M4 Express. I haven't been able to find a library which uses the SDHC peripheral for Arduino, although it exists for CircuitPython. Have I just not been looking hard enough or does such a library really not exist?

#

Just to clarify: This is to interface with SD cards without using SPI. My SD card is wired to the SDHC1 pins, SPI is not an option.

fleet plover
#

Hi 😊
So I have an at mega pro mini (without usb) and I want to code over an arduino uno.

I installed the arduino isp to the uno and connected all pins, but when I want to upload, I get this error? I tested all processors I could select, but all time the same

inland gorge
fleet plover
#

This board I want to programming

#

And this are all processors I can choose

inland gorge
#

It also looks like you're using a custom boards package? Where did you get it? If your board is a ATmega328 5V/16MHz, then you should be able to use the standard Arduino AVR board package and choose "Arduino Uno"

fleet plover
inland gorge
fleet plover
#

Allready tested

#

Same Error

merry cargo
delicate cairn
#

Hey yall im very new to all this but i used to troubleshoot basic electronics for the USMC and learned MM soldering there as well so i aint hopeless, im trying to use an Isty 5v to run a A4988 and a small 5v 10Ohm stepper, i think i have everything coded correctly as the pin13 lights up when its telling the stepper to rotate, but i have no spin.
Ive got the drivers, libraries, and i think everything i need, Running it off a 9v battery, then 2 9v in case amp draw? I haventy tried it with the 3Cr123s i plan on running it with but I am not sure thats the issue either.

delicate cairn
# delicate cairn Hey yall im very new to all this but i used to troubleshoot basic electronics fo...

#include <AccelStepper.h>

// Define the motor pins
#define STEP_PIN 12
#define DIR_PIN 13
#define MS1_PIN 5
#define MS2_PIN 7
#define MS3_PIN 9

// Define the driver control pins
#define ENABLE_PIN 3
#define SLEEP_PIN 11
#define RESET_PIN 10

// Create an AccelStepper object
AccelStepper stepper(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);

// Set microstepping mode to 1/16 step
const int microsteps = 16; // Change this if you want a different microstepping mode

void setup() {
// Set up motor pins
pinMode(MS1_PIN, OUTPUT);
pinMode(MS2_PIN, OUTPUT);
pinMode(MS3_PIN, OUTPUT);

// Set up driver control pins
pinMode(ENABLE_PIN, OUTPUT);
pinMode(SLEEP_PIN, OUTPUT);
pinMode(RESET_PIN, OUTPUT);

// Set microstepping mode
digitalWrite(MS1_PIN, (microsteps & 0x01) ? HIGH : LOW);
digitalWrite(MS2_PIN, (microsteps & 0x02) ? HIGH : LOW);
digitalWrite(MS3_PIN, (microsteps & 0x04) ? HIGH : LOW);

// Enable the driver
digitalWrite(ENABLE_PIN, LOW); // Enable the driver

// Set up the AccelStepper library
stepper.setMaxSpeed(1000);
stepper.setAcceleration(500);
}

void loop() {
// Calculate the number of steps for a full 360-degree rotation
const long stepsForFullRotation = 360 * microsteps;

// Rotate the stepper motor 360 degrees clockwise
stepper.setSpeed(200); // Set your desired speed (adjust as needed)
stepper.moveTo(stepsForFullRotation);
stepper.runToPosition();

delay(1000); // Delay for a moment

// Rotate the stepper motor 360 degrees counterclockwise
stepper.setSpeed(200); // Set your desired speed (adjust as needed)
stepper.moveTo(0);
stepper.runToPosition();

delay(1000); // Delay for a moment
}

delicate cairn
inland gorge
delicate cairn
inland gorge
delicate cairn
#

sry bad paint

lethal yarrow
#

As a general rule, I say lose the 9V battery. Get a LiPo, preferably one with onboard protection circuitry.

delicate cairn
#

Would a 2 cell be enough? that drops my voltage down to 7.4

#

I would have to be a 11.1 right?

lethal yarrow
#

Yeah a 2S might be on the low end (although fully charged it wouldn't be an issue).

pine bramble
#

I am trying to control a dc motor with l293d motor shield driver for Arduino uno R4 wifi am using adafruit motor shield library v1 but I am constantly getting the error "DC MOTOR PWM RATE" not defined in this scope. I tried googling and reading docs but my code seems to be the exact same as others. The error continues even when I try to run the examples.

delicate cairn
lethal yarrow
#

Well how big is your stepper?

delicate cairn
lethal yarrow
#

250mA is quite a bit to pull from the Arduino supply.

delicate cairn
grizzled mirage
#

How to assign accelerometer motion/direction movement to a keyboard keystroke?

Hey, All…

So, I made some progress this morning. I was able to successfully get an ADXL345 accelerometer working with an Arduino Pro Micro. I attached the video…

My question is, I simply want to have the 4 main values x+/x- and y+/y- assigned to a keyboard keystroke. In this case, the arrow keys.

So, x- would be left, x+ would be right, y- would be down, and y+ would be up.

That way I can assign those keystrokes to an action in my pinball game - for nudging.

Is this pretty straightforward to do?

pine bramble
#

i am using adafruit motor shield library v1 and i am constantly getting this error

muted gyro
#

DC_MOTOR_PWM_RATE is in capslock (and used as a default value for a parameter). It could be that the library expects you to #define it

pine bramble
#

I freshly downloaded the library and tried running the example and I am still getting the error so it's from the library

pine bramble
leaden walrus
fierce hamlet
#

is there a way to find out the calibration data for the raw touch data to the screen coordinates on a 3.5" TFT 320x480.

#

as i keep getting a Y drift for my touchscreen

livid osprey
grizzled mirage
inland gorge
gaunt echo
#

Do FTDI programmers power the atmega chip while programming, right?

gaunt echo
#

Also has anyone tried using one of those 8Mhz "internal oscillator" bootloaders for the atmega328? It removes the need for an external crystal, right? Are they reliable?

toxic flare
#

And yeah, no need for an XTAL

wind drift
#

ah nevermind it was somehow stuck on the wrong port

spiral carbon
#

Hello!
Not sure where to ask this, so i try here:
i have a ESP32-S2 from adafruit, but there are two revisions; B & C sold. How can i tell which one i have?
(i want to turn off I2C during deep sleep and you do the opposite depending on revisions.)

Also: does the "turning off" actually work in deep sleep if i just set it to the inverse before going to sleep. My LED on the I2C device is very dimly on during DS.

wind drift
#

Why is there such a long delay?

elfin hare
muted gyro
# wind drift

super weird. what else does your program do? Does it use the other core? Can you reproduce this with as little code and as few libraries as possible?

wind drift
#

I'll try - it basically just has an LED ring that plays a sequence. Not much else.
On my arduino uno it works just fine which with the delays

#

I have a feeling it can't do the delays

#

actually maybe can't handle multiple print statements?

#

And another question - how can I store/play sound on it?

#

Is there an example somewhere for that?

muted gyro
#

my RP2040 audio player project is kinda on pause right now due to too much other stuff going on. You could use https://github.com/pschatzmann/arduino-audio-tools
It might still have a few bugs. Please @mention me if it works or if you encounter any bugs. Over all I don't like the library that much tbh. But wav-from SD-card and wav-from-progmem (both 16 bit per sample and to I2S output) worked for me a few months ago.
I didn't test https://github.com/earlephilhower/ESP8266Audio but it claims it works and I think it can also do audio output via pwm. And it looks way simpler than arduino-audio-tools.
Theoretically RP2040 has enough power to even decode MP3 but I haven't tried that yet.
There were some bugs in the I2S itself but they should all be fixed now.

#

I went up to I think 3 lines of 80 characters per millisecond 🤔 or was it the other way around every 2-3 milliseconds one line of 80 characters. Anyway, it was enough to make a certain serial monitor program lag

wind drift
#

Thanks I'll try

#

What I don't yet understand is how to get the mp3 onto the board

#
#include "AudioFileSourceSPIFFS.h"
#include "AudioGeneratorMP3.h"
#include "AudioOutputI2SNoDAC.h"

AudioGeneratorMP3 *mp3;
AudioFileSourceSPIFFS *file;
AudioOutputI2SNoDAC *out;
void setup()
{
  Serial.begin(115200);
  delay(1000);
  SPIFFS.begin();
  file = new AudioFileSourceSPIFFS("/jamonit.mp3");
  out = new AudioOutputI2SNoDAC();
  mp3 = new AudioGeneratorMP3();
  mp3->begin(file, out);
}

void loop()
{
  if (mp3->isRunning()) {
    if (!mp3->loop()) mp3->stop(); 
  } else {
    Serial.printf("MP3 done\n");
    delay(1000);
  }
}```

For example here
#

it does not show as a drive for me

muted gyro
#

Is that arduino-audio-tools?

#

not sure if SPIFFS works there. Littlefs is the thing where you have a file system on the flash that also contains your program. There should be a tool in the tools menu of the Arduino IDE to upload files to the Littlefs.
And I think you should be able to just use a file source in Arduino-Audio-Tools and give it a file that's on LittleFS 🤔

wind drift
#

no the other one.

The arduino-audio-tools would be like this:

#include "StarWars30.h"

uint8_t channels = 2;
uint16_t sample_rate = 22050;

MemoryStream music(StarWars30_raw, StarWars30_raw_len);
I2SStream i2s;  // Output to I2S
StreamCopy copier(i2s, music); // copies sound into i2s

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

    auto config = i2s.defaultConfig(TX_MODE);
    config.sample_rate = sample_rate;
    config.channels = channels;
    config.bits_per_sample = 16;
    i2s.begin(config);
}

void loop(){
    copier.copy();
}
muted gyro
#

I see

muted gyro
# wind drift ```#include <Arduino.h> #include "AudioFileSourceSPIFFS.h" #include "AudioGenera...

ESP8266audio has a midi from littlefs example. https://github.com/earlephilhower/ESP8266Audio/blob/master/examples/PlayMIDIFromLittleFS/PlayMIDIFromLittleFS.ino
Maybe you only have to replace the "SPIFFS" from the SPIFFS-Example with Littlefs 🤔

GitHub

Arduino library to play MOD, WAV, FLAC, MIDI, RTTTL, MP3, and AAC files on I2S DACs or with a software emulated delta-sigma DAC on the ESP8266 and ESP32 - earlephilhower/ESP8266Audio

wind drift
muted gyro
#

you need to select how large of a littlefs you want

#

same menu where you select the board and port I think

wind drift
#

ah the flash size?

muted gyro
#

yes

wind drift
#

ok cool seems to have worked now

muted gyro
#

Overall flash size has to be the correct for your board of course. But the difference is how much flash for your code and how much for littlefs

#

👍

wind drift
#

and how do I delete it again?

muted gyro
#

just upload something else again. And set the flash size back to no littlefs to delete it completely

#

There's also some nuke.uf2 but idk where that just completely deletes everything from the RP2040 flash

wind drift
#

hmm.

Uploaded this:

#include "StarWars30.h"

uint8_t channels = 2;
uint16_t sample_rate = 22050;

MemoryStream music(StarWars30_raw, StarWars30_raw_len);
I2SStream i2s;  // Output to I2S
StreamCopy copier(i2s, music); // copies sound into i2s

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

    auto config = i2s.defaultConfig(TX_MODE);
    config.sample_rate = sample_rate;
    config.channels = channels;
    config.bits_per_sample = 16;
    i2s.begin(config);
}

void loop(){
    copier.copy();
}
#

speaker connected to +- as marked on the board

#

but I got no sound

muted gyro
wind drift
#

I connect the speaker here, right?

muted gyro
#

yes

muted gyro
#

do you have to turn the I2S amp on with some specific pin?

wind drift
#

I did but still nothing for some reason

#

I modified the other code now.

//
// SPDX-License-Identifier: MIT


uint8_t x = 0;

void setup() {
  // core1 setup
  Serial.begin(115200);


  pinMode(PIN_EXTERNAL_POWER, OUTPUT);
  digitalWrite(PIN_EXTERNAL_POWER, HIGH);
}

void loop() {

}



// audio runs on core 2!

#include <I2S.h>

#include "boot.h"
#include "hithere.h"
#include "StarWars30.h"

struct {
  const uint8_t *data;
  uint32_t       len;
  uint32_t       rate;
} sound[] = {
  hithereAudioData, sizeof(hithereAudioData), hithereSampleRate,
  bootAudioData   , sizeof(bootAudioData)   , bootSampleRate,
  StarWars30AudioData   , sizeof(StarWars30AudioData)   , StarWars30SampleRate,
};
#define N_SOUNDS (sizeof(sound) / sizeof(sound[0]))

I2S i2s(OUTPUT);

uint8_t sndIdx = 0;


void setup1(void) {
  i2s.setBCLK(PIN_I2S_BIT_CLOCK);
  i2s.setDATA(PIN_I2S_DATA);
  i2s.setBitsPerSample(16);
}

void loop1() {
  Serial.printf("Core #2 Playing audio clip #%d\n", sndIdx);
  play_i2s(sound[sndIdx].data, sound[sndIdx].len, sound[sndIdx].rate);
  delay(5000);
  if(++sndIdx >= N_SOUNDS) sndIdx = 0;
}

void play_i2s(const uint8_t *data, uint32_t len, uint32_t rate) {

  // start I2S at the sample rate with 16-bits per sample
  if (!i2s.begin(rate)) {
    Serial.println("Failed to initialize I2S!");
    delay(500);
    i2s.end();
    return;
  }
  
  for(uint32_t i=0; i<len; i++) {
    uint16_t sample = (uint16_t)data[i] * 32;
    // write the same sample twice, once for left and once for the right channel
    i2s.write(sample);
    i2s.write(sample);
  }
  i2s.end();
}```
#

it starts playing the starwars sound now - but has a very loud noise to it

#

the "hithere" sound is super quiet

#

When I was playing it previously on my arduino uno + one of these dfplayer sd card boards it was very loud

muted gyro
#

quietness could be a speaker thing. But i don't know what the dfplayer can handle. That MAX9... can do 3W on 4 Ohm but at 8Ohm it's only like 1,8W or something

wind drift
#

Right now it's like someone is whispering

wind drift
#

Also tried another speaker - same thing there

wind drift
#

the volume is 10x higher when I set it to max

#

SPeaker says 8ohm 1W

spiral carbon
wind drift
#

@muted gyro actually I tried now the circuitpython approach. Here the volume seems better.

Not sure what I'm doing wrong when using arduino

#

But now I have to rewrite my whole code 😵

muted gyro
#

it's really a shame that audio stuff on arduino is not "that great" currently 😭

analog fulcrum
#

If we're having technical problems with a specific Adafruit tutorial how do we get help with it? I'm having problems with the https://learn.adafruit.com/adafruit-qualia-esp32-s3-for-rgb666-displays/arduino-rainbow-demo in compiling the Arduino Rainbow Demo. The Adafruit_FT6206.h installed by the Arduino Library manager doesn't seem to have a function to match ctp.begin(0, &Wire, I2C_TOUCH_ADDR).

Adafruit Learning System

Use the new Qualia ESP32-S3 to add a higher resolution Dot Clock RGB-666 Display to your next project

stark kindle
#

Press and hold the BOOT button, press and release the RESET button, then release the BOOT button. That's the sequence that will force any ESP32 into bootloader mode. It can't be overridden in software so if that doesn't cause the device to appear, something is going on with the USB cable or computer OS (or the ESP32 could always be fried but really it's usually the USB cable).

stark kindle
#

If it appears as CIRCUITPYTHON then it's currently running CircuitPython and the serial terminal would be 115200 not 460800. Are you trying to interact with the CircuitPython REPL or are you trying to flash an Arduino program to it or something else?

#

So you're trying to talk to the CircuitPython REPL? What are you trying to do?

#

I would try using a terminal program under Windows outside of the Ubuntu environment in order to test whether the issue is the Ubuntu environment.

lilac ginkgo
#

Windows using Ubuntu??? Does that mean you are working from WSL (or a W10 VM on Ubuntu)? Bad wording and tried both OSes?

If former (unless you using something usbipd), you may not have access to the device at all

#

Not what i meant, at all

#

Answer the question

#

I usually use PuTTy for this kind of stuff

#

Unless you need to access it from WSL, that is

fallow valve
#

I might make a proton pack Neutrona Wand Arduino powered board with the sound board (if it's still being made)

how can I do a delay of the power down so it can play the power down of the Ghostbusters Proton Pack fvrom the sound board?

#

though the sound board is stand alone - I'm still gonna use an arduino to do the lights and trigger the sounds still

fallen gate
#

Using the Adafruit Feather 32u4 RFM95 LoRa Radio- 868 or 915 MHz With the Adafruit Ultimate GPS featherwing.
The GPS code for the test from the web page works and the test for the radios works the parsing of the GPS does not work and I cannot combine any part of the GPS code into the message being transmitted.

safe shell
#

@fallen gate you'll probably need to post or link to your code, there's no reason the two things shouldn't be able to get combined

fallen gate
#

Thanks, I'll post my best try

north stream
fallow valve
#

I know the adafruit FX board can do it too if it was to be told to play a sound while being powered down

gusty cypress
#

ah oops sorry I didn't scroll down far enough

charred salmon
#

Somewhat specific question about SPI. I'm going to try and control a display that uses the SSD1306 chip, and in the datasheet it says that it samples the data/control line every 8 bits to determine how to handle the incoming byte.
When using hardware SPI, does a microcontroller typically generate a clock signal continuously, even when not actually sending any data?

lethal yarrow
#

No, the clock should only run while sending data.

charred salmon
#

Cool. I was worried that I might somehow have to actually keep track of that. I know Arduino has commands for controlling the SPI bus directly, it just didn't seem to have anything for that.

#

Gonna start with a trinket, but the ultimate goal is to drive this thing with an ATTiny. So I need to skip the library.

north stream
#

Note that SPI is inherently bidirectional, so the CPU does generate a clock to receive data (technically it sends filler data like zeros)

charred salmon
#

The SSD1306 library that is.

#

Fortunately to start with, receiving data won't be a problem. The SSD1306 chip can't send data over SPI.

#

It will be something to worry about once I add an IO expander to this. I should have just enough pins, but it's going to be creative.

north stream
#

Ah, just clock and data, that does simplify things

charred salmon
#

But first things first, build my own functions to draw directly to the screen using raw SPI commands.

north stream
#

I may be doing the same thing with some anonymous VFDs I picked up cheap on AliExpress.

surreal gate
#

Curious if anyone has ever used the Adafruit Ultimate GPS module?
https://learn.adafruit.com/adafruit-ultimate-gps

I'm following the guide and it says it'll work with 3.0 -5.5VDC.

I plugged the module into the 3.3V output from my Arduino Uno and it fails to turn on. Works fine and I get GPS signal with the 5V output. This is concerning me because I have a 3.7V battery spec'd for my power supply for this project.

Perhaps I need to configure the board somehow to accept 3V instead of 5?

Adafruit Learning System

One GPS to rule them all and in the darkness find them!

inland gorge
surreal gate
#

oh interesting idea. So power the arduino from my battery with the Vin pin on the Uno and then plug in the USB and everything should run at 3.7V?

#

Wait, this actually doesn't check out. Because the light on the GPS module doesn't come on. So it's not even running

#

The module itself only turns on when I give it 5V

fallen gate
#

Im using the Adafruit V3 GPS or the feather they both work for me on 3.7v but I don't know how to send the parsing with the 32u4 LO-RA board

inland gorge
charred salmon
#

If you're driving the Arduino from 3.7v, and trying to power the GPS from the 3.3v output, I'm going to guess that you're not getting 3.3 off that. Looking up the Uno, it looks like the use the AMS1117 linear regulator for the 3.3 output which has a rated dropout voltage of 1V, and guaranteed not more than 1.3V. So to get even 3V out of it, you need to be providing a minimum of 4, or as much as 4.3.

#

I'd say stick a multimeter on it and see what you're really getting.

fallen gate
#

I can't get the parsing to transmit it works without the radio code combined but then all i get is zeros with but then all I get is zeros with the code the Lora code mixed in

upbeat oyster
#

Hey all! I originally posted this in #help-with-projects but am asking here per @crystal yacht 's advice

I'm trying to make these firewalker shoes but I'm having so much trouble actually getting the code onto the Gemma (I'm specifically using the v2, not the m0). This is the error I keep getting:
avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)
Failed programming: uploading error: exit status 1

Does anyone know how to fix this? I've never used a Gemma board before so any help is super appreciated!

https://learn.adafruit.com/gemma-led-sneakers

Adafruit Learning System

Your new favorite LED sneakers

charred salmon
#

Check what USB port you're plugging into. According to the product page certain USB3 ports don't work. So I'd start by trying different ports. Does your computer give any indication that it's seen a new device when you plug it in?

#

If it is a port problem, and you have a particularly new computer, you might not have any USB2 ports. Though I think most manufacturers still put one or two on for low level compatibility.

upbeat oyster
#

So far, my computer can always tell when one is plugged in but actually uploading the code has been weirdly hard 😅

charred salmon
#

And the red LED is pulsing when you try?

upbeat oyster
#

Yeah so I'm not sure why it isn't uploading

fallen gate
#

Sounds to me like you need the USB driver computer Windows 10 or newer

fallen halo
#

I just bought these chainable NeoPixels which are addressable. I've written Arduino code to control an LED light strip before, but it isn't clear to me how to program each individual pixel in this setup. Is it something I am just overthinking? The general NeoPixel tutorial I believe was more helpful for strips. I don't get the LEDs until Tuesday so I am trying to plan what I can:

https://www.adafruit.com/product/5162

muted gyro
#

1 strip with 100 LEDs == 100 "strips" with a single led each. (As long as the signal is wired in series)

fallen halo
#

I hope it is haha. I think it is as that's the point of this model, I think, but I have a ton to learn.

floral breach
#

How do I modify the arduino compiler call string? I want to enable LTO on the feather M4 CAN (gcc 9)

fallen gate
#

Has anybody been able to get the 32U4 to transmit the latitude and longitude from GPS feather because only the tests from the web page work none of the libraries for the Arduino GPS will work no parsing the only parsing I got to work was from somebody else's tiny GPS off YouTube had nothing to do with the Adafruit there's no examples of how the radio reads from the GPS serial instead of it reading from its own Sereal it appears to me that the feather shares pin one with the radio they say they use separate serial codes and it doesn't matter but I've never got them to work in combination

north stream
north stream
upbeat oyster
fallen halo
#

For LED strips, I frequently have to use a separate power source. The set I just bought uses 4 watt LEDs and I have 8 of them, which apparently requires 4 amps of power. That is obviously too much for an Arduino Uno. Are there are any boards, Arduino or not, that can output that much power without needing a separate power source? It would make my setup cleaner.

north stream
#

Not really: microcontrollers are not power supplies. The usual approach is just use a hefty power supply and use it to power the LEDs and the microcontroller.

muted gyro
#

Power needs to come from somewhere. Your PC's USB ports are only required to output 500mA at 5V. Some can just do 5V 2A. (For example my monitor has a single "charging" USB port that can do 5V 2A)

lethal yarrow
muted gyro
#

WLED is an open source LED controller based based on ESP32. I've seen some dedicated hardware for it. If those are just "shields" for ESP32 modules, then I'm sure you could use them with Arduino (ESP32 Arduino core) as well. Might make wiring simpler. (But you still need a proper PSU for it of course)

fallen gate
#

I did order two of the Adafruit Feather M0 with RFM95 LoRa Radio - 900MHz - Radios so hopefully the code will work with those

peak fractal
#

Trying to run a BLE sketch with an esp32-s2 tft feather and it says Bluetooth is not enabled. Anyone point me at anything to help get it up and running.

stark kindle
stark kindle
open hemlock
#

hi all! I'm testing Arduino on my ESP32-S2 Feather, and I can't get the WifiClient test from https://learn.adafruit.com/adafruit-esp32-feather-v2/wifi-test to work. I was able to get a network trace from my router, and I can see the Feather is making it out to the internet, but the Adafruit server doesn't respond. I feel like I'm going crazy. I've even tried modifying the code slighty to match what I've seen curl doing.

client.print("GET "); client.print(path); client.println(" HTTP/1.1"); client.print("Host: "); client.println(server); client.println("Accept: */*"); client.println("User-Agent: curl/8.0.1"); client.println(); }

Any ideas?

edgy ibex
#

Also just for giggles and grins, try adding the following:

client.println("Content-Length: 0");

just after the "User-Agent" line. Not specifying a Content-Length, even when it's zero, can make it a bit harder for the server to know when to respond.

upbeat oyster
north stream
open hemlock
#

If you have a network trace, what does

viral prawn
#

I'm attempting to monitor with midimittr and midi wrench. I know very little about midi so I'm worried apple does some shenanigans that make it more complex/impossible.

#

I mean, midi devices do work with iPads over usb, so it should be possible, right?

#

Unless they have to be whitelisted or a certain chip has to be whitelisted or something?

#

Or do I have to advertise it in a certain way? I really know very little about how midi works.

native dagger
#

How do I setup software serial for rx and TX on a qt py 2040? Im looking at an example for a non adafruit Lib that uses it and they use just numbers for the pins but the 2040 guide says TX is available as PIN_SERIAL2_TX

#

Can I just use 20 and 5 since those are the numbers for TX and RX per the diagram?

ocean lotus
#

hey guys, I'm trying to boot my feather esp32 s2 and it's hanging up while booting

native dagger
#

Also I'm trying to use the vl53l1x with the stemma qt cable but am running into issues with Wire, I think. How can I make it use the proper pins?

inland gorge
native dagger
stark kindle
# ocean lotus

What are you expecting to see from it? It's executing the application - those messages are from the application's startup code.

ocean lotus
stark kindle
ocean lotus
inland gorge
# viral prawn Hey I'm trying to get my esp32 dev kit to advertise as a midi device over usb/li...

I usually use the Adafruit_TinyUSB_Arduino library as it isn't chip-dependent. Here's a USB MIDI example that I just tested on an ESP32S2 Feather: https://github.com/adafruit/Adafruit_TinyUSB_Arduino/blob/master/examples/MIDI/midi_test/midi_test.ino

GitHub

Arduino library for TinyUSB. Contribute to adafruit/Adafruit_TinyUSB_Arduino development by creating an account on GitHub.

wind drift
#

Question:
What do they mean by Effective Rotational Angle(typ.) 333.3° here?

https://www.murata.com/en-eu/products/productdetail?partno=SV01A103AEA01B00

#

What happens if I rotate to for example 350°?

inland gorge
north stream
#

If it doesn't have a stop, that means that if you turn it past the end of the resistive element, the wiper goes open circuit until it reaches the other end

viral prawn
wind drift
#

It doesn't have a stop yeah

#

Is there a better alternative that can do full 360?

inland gorge
viral prawn
#

Thanks a million

wind drift
#

Or could I even use the LIS3DH Triple-Axis Accelerometer on my RP2040 propmaker to detect rotation?

#

Rotation on Z axis (laying flat on the table)

north stream
wind drift
#

Continuous would be preferred

wind drift
#

Or maybe I have to use a gyro instead?

wind drift
#

I don't think I can use one of those magnet angle sensors because I have a speaker nearby

gilded swift
#

You could use a rotary encoder to get a full turn

north stream
#

The magnetic ones are pretty robust, it may not be a problem. You can always put magnetic shielding (like an iron or steel sheet) between them.

open hemlock
#

Is the new MAX battery chip more reliable than the LC709203F? I'm getting Couldnt find Adafruit LC709203F? a few times now using Aruino on my ESP32-S2 Feather with BME280. I do have to reset the device a lot more which I assume is why it's happening more frequently than it did with CircuitPython.

quick hornet
#

Does the SAMD51 microcontroller not support servo motors? I can't get the servo library to compile for the SAMD51.

#

I'm trying to use the ServoFirmata library on a pybadge board.

muted gyro
#

It can always be that specific libraries don't work on specific architectures. Especially when they use low-level platform-specific features/hardware. But maybe you can find a different library providing the same (or similar) features that does work

#

For example, on AVR I think servos are handled by the timer hardware. On RP2040 servos are handled by PIO. Both are very different low-level platform-specific features. So you can't just take such a low-level configuration from one platform and use it on another. In this case, the library has to specifically support the hardware

safe shell
#

@open hemlock I think it may be a little quirkier, not sure specifically why it wouldn't behave on ESP32-S2

#

Please note this chip uses I2C clock stretching, on Raspberry Pi Zero/1/2/3 you will need to slow down the I2C port.

quick hornet
open hemlock
#

But that appears to have slowed down my humidity/temp data collection by 500ms!

wind drift
#

My speaker but be placed directly below it

livid osprey
#

It could work with a speaker if its magnetic field is aligned to the encoder’s rotational axis. The alternative would be an optical encoder, which would be completely void of any magnetic fields, but have its own added complexity.

zenith crypt
#

For using a VL6180 time of light sensor, I am having issues detecting the sensor when it is connected to an external 5V power supply, as opposed to the 5V output on an Arduino Uno Rev 3. When connected to the internal Arduino 5V power supply, the sensor works just fine. When connected to an external 5V supply, the sensor is not able to be found. The voltage of the external supply has been measured between 4.98-5.07V. Any help would be much appreciated.

stark kindle
zenith crypt
stark kindle
# zenith crypt Of course thank you. We were powering the Arduino using the serial cable. And ...

Grounds definitely have to be connected. They provide a reference point for the voltage. Any ground lead on the power supply can be connected to any ground lead on the Arduino.

When you say you're powering the Uno using the serial cable do you mean USB?

Why are you choosing to power the VL6180 separately? It's a low power chip, drawing only 350µA at 2.8V. It shouldn't need an independent power supply.

charred salmon
#

Is there any way to know ahead of time how big variables are in memory? I think I just got tripped up when porting a project from an M0 based board to an ATTiny. At first I thought I was just running out of memory entirely, but now it looks like I may just be overflowing some specific variables.

#

It seems that the functions I'm having problems with are using 65536 stored to an int. On the M0 they all ran fine, but crash on the Tiny. Digging into it I do find one page from Arduino that says that on SAMD chips ints are 4 bytes, but only 2 on AT chips.
Is there any good source for this information? They don't seem to mention anything about other types.

#

Oh, and I can't use sizeof() since I have no text output from this project.

stark kindle
#

sizeof() isn't limited to strings

#

Oh wait you mean you can't get the output from sizeof?

charred salmon
#

Yeah. No display, no serial monitor.

stark kindle
#

got it

charred salmon
#

Maybe I should rework the hardware test to do it. Yay diagnostic LEDs.

stark kindle
# charred salmon It seems that the functions I'm having problems with are using 65536 stored to a...

Rather than int and long we often use specific types like int32_t or uint64_t to ensure that code will work correctly when run on CPUs with differently sized fundamental types. Then we'll use a header file that uses typedef to map int32_t to the correct type for the CPU you're building for. Then you don't have to worry about whether 65536 will fit in an int.

I think all Arduino platforms should provide this but it's possible that it's just a convenience that I've taken for granted in the ones I work with.

lilac linden
#

I keep getting this error when trying to compile neopxl8 code for my esp32-s3 board. Any ideas as to how to fix it?

charred salmon
#

Useful information for future projects I guess. For the moment I think I'm just going to convert what I need to longs or uint16 and reduce the number by 1. It's not a big project, and losing 1 from the color range is insignificant.

stark kindle
charred salmon
#

Yep. Looks like it does.
Unfortunately fixing this requires retyping a whole load of variables.
Eh. Not too big of a deal I guess.

zenith crypt
stark kindle
upbeat oyster
north stream
wind drift
#

Do these kiind of "flat" speaker exist in bigger sizes?

#

Without the bump in the back

#

~70-80 mm diameter

#

~5mm height

livid osprey
#

Typically, a larger diaphragm requires a larger coil to drive it, so getting a speaker in that size will generally require some space underneath for the larger coil.

#

You might be able to find a piezo speaker with thinner proportions, but be prepared to pay a premium for them. https://store.miscospeakers.com/4-inch-wide-range-speaker-piezoelectric-93124

north stream
wind drift
charred salmon
#

I've been sitting here for an hour trying to drive this display manually.
No wonder I haven't gotten anywhere. There's a heck of a lot more setup than I though.
At least I've managed to dig into the library and find how Adafruit configures it.

north stream
#

I had to do that with one chip that had an undocumented configuration block that could only be created by a DOS-only program I couldn't run. I just cribbed the config block from the AdaFruit driver and decided not to do business with that chip vendor in the future.

charred salmon
#

I blame the fact that the datasheet makes it sound simple.
It's like, 4 steps and two of them are about applying power.
Apply power to chip, wait for power to be stable.
After power is stable, reset chip.
After reset, apply power to display.
After display power is stable, send on command.

charred salmon
#

Well. That may look like a load of garbage to the untrained eye, but it is in fact a near complete success.

native dagger
#

Arduino ide appears to be showing warnings as errors (multiple of the same warning for a library, says some warnings treated as errors), but I appear to have the most permissive compiler warnings setup. How can I fix this?

#

Ide 2.2.1

leaden walrus
#

the BSP sets those, so would need to change files there

native dagger
#

What's the BSP? And is that possible?

leaden walrus
#

Board Support Package

#

so you'd be editing files generally not meant to be user modified

#

what board is this for?

native dagger
#

Hmm OK. Rp2040

#

Here's the errors

#

Sorry for photos wifi down

#

If I wanted to edit the library, could I have the methods return something rather than nothing?

#

I'm using the earl philhower core

leaden walrus
#

yep. that'd be an easy way to fix that.

#

and the generally better approach - i.e. fix the library, not mess with the BSP

muted gyro
#

arduino-pico has problems with a few libraries because its compiler is too new 😆 Some NFC library relies on a compiler bug that is now fixed so it doesn't compile any more

native dagger
leaden walrus
#

can you link to repo with the roboclaw library code?

#

could just return 0, but worth looking at code to see if there are reasons to be fancier

native dagger
leaden walrus
#

looks like it's trying to protect against softwareserial

#

and sort of saying only AVR supports it

#

you're using hardware serial with the pico?

#

Serial1 = 0 and 1, Serial2 = 8 and 9

native dagger
#

Oh I'm connected to rx and TX on the board

leaden walrus
#

oops. nvm. you aren't using a pico.

native dagger
#

Yeah sorry.

#

I'm using rx tx

leaden walrus
#

np. one sec. ignore above about pico pins.

#

looks like those end up being Serial2

#

and would be hardware serial

native dagger
#

OK so if I don't have software serial in my code, will it skip this issue?

leaden walrus
#

it won't

native dagger
#

OK so

leaden walrus
#
int RoboClaw::peek()
{
    if(hserial)
        return hserial->peek();
#ifdef __AVR__
    else
        return sserial->peek();
#endif
    return 0;
}
native dagger
#

ah ok I was about to post htat

#

ok thank you

#

worth it to pull req the repo?

#

and if I just edit the code on my machine, will it compile directly?

leaden walrus
#

i'd open an issue first. the code above is a hack.

native dagger
#

ok

leaden walrus
#

need to add same thing to other functions

native dagger
#

I did

#

The idea didn't seem to pick up the changes.

leaden walrus
#

something may be cached?

native dagger
#

Hm om

leaden walrus
#

try adding an intentional syntax error and see if it gets flagged

native dagger
#

What does that mean in this context?

leaden walrus
#

need to verify the updated library is being compiled, and arduino is not using a previously compiled file

muted gyro
#

I would git clone the library into the /lib (I think) directory inside the project and remove the dependency from the platformio.ini
(though you could also put the library inside a random folder on your PC and add something to the platformio.ini to tell it to use the version from that folder but I forgot the command for that)

native dagger
#

Thank you all

native dagger
muted gyro
#

ah sorry then I don't know

#

lol you've literally written "Arduino ide appears to be..." 🤦‍♂️ me

muted gyro
#

But similar idea maybe... Isn't there a way to put a library inside the sketch folder? At least with the new arduino IDE 2🤔

native dagger
#

would it be

#
Serial2 serial;
RoboClaw roboclaw = RoboClaw(&serial, 10000);

?

leaden walrus
native dagger
#

nice thanks

leaden walrus
native dagger
#

Here's my current code and what I'm working on

#include <SoftwareSerial.h>
#include <RoboClaw.h>
#include <Adafruit_VL53L1X.h>
#pragma
Adafruit_VL53L1X vl53 = Adafruit_VL53L1X();
float Kp = 17.37; // prop gain
float Ki = 0.0; //integral gain
float Kd = 182.4; //deriv gain
int qpss = 7775; //quadrature pulses per second
int address = 128; //address of roboclaw



int16_t distance = 710; //Number of encoder pulses to turn.
int16_t up_speed = 200; //Number of encoder pulses per second on upswing
int16_t up_accel = 500; //Time rate of change of up_speed
int16_t down_speed_fast = 100;//speed down when moving out of view
int16_t down_speed_homing = 35;
int16_t down_accel_fast = 200;
int16_t down_accel_homing = 1000;

bool zero = false;



RoboClaw roboclaw = RoboClaw(&Serial2, 10000);



void setup() {
  Serial2.begin(115200);
  roboclaw.begin(115200);
  
  roboclaw.SetM1PositionPID(address,Kp,Ki,Kd,qpss,0,0,0);

  
  vl53.setTimingBudget(15);
  vl53.startRanging();
  Serial.println("before serial delay");
  while (!Serial2) delay(10);
  Serial.println("After serial delay");
  Wire1.begin();
  
  while (!zero){
    Serial.println("Starting zeroing");
    if (vl53.dataReady() && vl53.distance() > 50){
      roboclaw.SpeedM1(address,50);
      Serial.println("Zeroing");
    }else{
      zero = true;
      roboclaw.SpeedM1(address,0);
      roboclaw.SetEncM1(address,0);
      Serial.println("Zeroed");
    }



  }

}


void loop() {
  
  

}

atm I'm not reaching
Serial.println("before serial delay");
so I'm trying to figure out why

leaden walrus
#

Serial2 is defined in the BSP, can just be used directly

#
#include <SoftwareSerial.h>

remove since you are not using software serial

#
#pragma

this is doing nothing, can also remove

#
  Serial2.begin(115200);

remove this line, the library does this

#
  while (!Serial2) delay(10);

remove this line. in general, sketch code should not use Serial2 directly

native dagger
#

why can I not deploy to my qt py twice in a row? Do I always have to reset it before each load?

leaden walrus
#
  Wire1.begin();

remove this line. the VL53L1X library will do this

#

you aren't calling Serial.begin()

native dagger
#

Here's what I have now

#
#include <RoboClaw.h>
#include <Adafruit_VL53L1X.h>
Adafruit_VL53L1X vl53 = Adafruit_VL53L1X();
float Kp = 17.37; // prop gain
float Ki = 0.0; //integral gain
float Kd = 182.4; //deriv gain
int qpss = 7775; //quadrature pulses per second
int address = 128; //address of roboclaw



int16_t distance = 710; //Number of encoder pulses to turn.
int16_t up_speed = 200; //Number of encoder pulses per second on upswing
int16_t up_accel = 500; //Time rate of change of up_speed
int16_t down_speed_fast = 100;//speed down when moving out of view
int16_t down_speed_homing = 35;
int16_t down_accel_fast = 200;
int16_t down_accel_homing = 1000;

bool zero = false;


Serial2.setRX(5);
Serial2.setTX(20);
Serial2.begin(115200);
RoboClaw roboclaw = RoboClaw(&Serial2, 10000);



void setup() {
  
  Serial.begin(9600);
  roboclaw.begin(115200);
  
  roboclaw.SetM1PositionPID(address,Kp,Ki,Kd,qpss,0,0,0);

  
  vl53.setTimingBudget(15);
  vl53.startRanging();
  
  Serial.println("before serial delay");
  Serial.println("After serial delay");
  
  while (!zero){
    Serial.println("Starting zeroing");
    if (vl53.dataReady() && vl53.distance() > 50){
      roboclaw.SpeedM1(address,50);
      Serial.println("Zeroing");
    }else{
      zero = true;
      roboclaw.SpeedM1(address,0);
      roboclaw.SetEncM1(address,0);
      Serial.println("Zeroed");
    }



  }

}


void loop() {
  
  

}
#

that gives me
24 | Serial2.setTX(20);
Compilation error: 'Serial2' does not name a type; did you mean 'SerialUSB'?

leaden walrus
#
Serial2.setRX(5);
Serial2.setTX(20);
Serial2.begin(115200);

remove these lines

native dagger
#

I don't need to set RX and TX?

leaden walrus
#

no

native dagger
#

what about resetting the board every time?

leaden walrus
#

see if you can duplicate that behavior uploading a basic blink example, to rule out it being something with the sketch interfering with soft reset

native dagger
#

OK. why might I not be seeing print messages?

leaden walrus
#
#include <RoboClaw.h>
#include <Adafruit_VL53L1X.h>

Adafruit_VL53L1X vl53 = Adafruit_VL53L1X();
RoboClaw roboclaw = RoboClaw(&Serial2, 10000);  // HW serial on Qt PY RP2040 is Serial2


void setup() {  
  Serial.begin(9600);
  while (!Serial);
  Serial.println("RoboClaw Test.");
  
  if (!vl53.begin()) {
    Serial.println("Could not start VL53L1X.");
    while(1);
  }
  Serial.println("VL53L1X started.");  
  
  roboclaw.begin(115200);
  Serial.println("RoboClaw started.");
}


void loop() {
}
#

try that as a basic example

#

guessing VL53L1X init will fail, if its connected via STEMMA QT

leaden walrus
#

no serial output after that?

native dagger
#

nope

leaden walrus
#

weird. the vl53 being must be hanging?

native dagger
#

It's got a green light

#

let me try the simpletest

leaden walrus
#

how is the VL53L1X connected to the QT PY?

native dagger
#

stemma

#

I've verified that it works. that was my first step

leaden walrus
#

ok. will need to change code above.

#
  if (!vl53.begin(VL53L1X_I2C_ADDR, &Wire1)) {
native dagger
#

Its still doing the "need to reach boot or I can't reach you" thing too

#

Will try above

#

oK got to roboclaw started

#

Does this make sense?

while (!zero){
    Serial.println("Starting zeroing");
    if (vl53.dataReady() && vl53.distance() > 50){
      roboclaw.SpeedM1(address,50);
      Serial.println("Zeroing");
    }else{
      zero = true;
      roboclaw.SpeedM1(address,0);
      roboclaw.SetEncM1(address,0);
      Serial.println("Zeroed");
native dagger
#

yeah I have that above

leaden walrus
#

zeroing loops seems OK as a first pass. can try it and see how it plays with actual hardware.

native dagger
#

It doesn't seem to do anything. I don't get into the first print stateent

leaden walrus
#

put a serial print before and after the while (!zero) loop

#
Serial.println("Zeroing...");
while (!zero) {
  // stuff
}
Serial.println("Done.");
native dagger
#

I had a call to the roboclaw before begin

#

I trying again

#

I sure miss drag and drop heheh

native dagger
#

what could cause that?

leaden walrus
#

not sure

native dagger
#

OK what about failing to secure a serial connection?

leaden walrus
#

which one?

native dagger
#

to the serial monitor

#

sometimes it does, sometimes it doesn

#

t

leaden walrus
#

could be switching COM ports because its left open?

#

try closing serial monitor before uploading

native dagger
#

ok

#

Yeah still timing out

#

Here's my code

#include <RoboClaw.h>
#include <Adafruit_VL53L1X.h>

Adafruit_VL53L1X vl53 = Adafruit_VL53L1X();
RoboClaw roboclaw = RoboClaw(&Serial2, 10000);  // HW serial on Qt PY RP2040 is Serial2

float Kp = 17.37; // prop gain
float Ki = 0.0; //integral gain
float Kd = 182.4; //deriv gain
int qpss = 7775; //quadrature pulses per second
int address = 128; //address of roboclaw



int16_t distance = 710; //Number of encoder pulses to turn.
int16_t up_speed = 200; //Number of encoder pulses per second on upswing
int16_t up_accel = 500; //Time rate of change of up_speed
int16_t down_speed_fast = 100;//speed down when moving out of view
int16_t down_speed_homing = 35;
int16_t down_accel_fast = 200;
int16_t down_accel_homing = 1000;

bool zero = false;



void setup() {  
  Serial.begin(9600);
  while (!Serial);
  Serial.println("RoboClaw Test.");
  
 

  
  vl53.setTimingBudget(15);
  vl53.startRanging();
  
  roboclaw.begin(38400);
   roboclaw.SetM1PositionPID(address,Kp,Ki,Kd,qpss,0,0,0);

  Serial.println("RoboClaw started.");
while (!zero){
  Serial.println("Starting zeroing");
  if (vl53.dataReady() && vl53.distance() > 50){
    roboclaw.SpeedM1(address,50);
    Serial.println("Zeroing");
  }else{
    zero = true;
    roboclaw.SpeedM1(address,0);
    roboclaw.SetEncM1(address,0);
    Serial.println("Zeroed");
    }
  }

}


void loop() {
}
leaden walrus
#

vl53 init missing

native dagger
#

Ahhhh

#

Thanks

#

Any idea about the reset thing?

leaden walrus
#

no, sry.

native dagger
# leaden walrus no, sry.

OK! Made progress. Here's what I've got so far, my motor is not moving

#include <RoboClaw.h>
#include <Adafruit_VL53L1X.h>

Adafruit_VL53L1X vl53 = Adafruit_VL53L1X();
RoboClaw roboclaw = RoboClaw(&Serial2, 10000);  // HW serial on Qt PY RP2040 is Serial2

float Kp = 17.37; // prop gain
float Ki = 0.0; //integral gain
float Kd = 182.4; //deriv gain
int qpss = 7775; //quadrature pulses per second
int address = 128; //address of roboclaw



int16_t distance = 710; //Number of encoder pulses to turn.
int16_t up_speed = 200; //Number of encoder pulses per second on upswing
int16_t up_accel = 500; //Time rate of change of up_speed
int16_t down_speed_fast = 100;//speed down when moving out of view
int16_t down_speed_homing = 35;
int16_t down_accel_fast = 200;
int16_t down_accel_homing = 1000;

bool zero = false;



void setup() {  
  Serial.begin(9600);
  while (!Serial);
  Serial.println("RoboClaw Test.");
  vl53.begin(VL53L1X_I2C_ADDR, &Wire1);
 

  
  vl53.setTimingBudget(15);
  vl53.startRanging();
  
  roboclaw.begin(38400);
   roboclaw.SetM1PositionPID(address,Kp,Ki,Kd,qpss,0,0,0);

  Serial.println("RoboClaw started.");
  roboclaw.SpeedM1(address,50);
#

I'm going to try to read something from the roboclaw to verify that I am talking to it

#

OK I can read the encoder

#

Let me see if the speed was just too small

spiral carbon
#

Hello Ppl!
Can i use Arduino UNO R4 WiFi and The Adafruit IO lib? How can one tell that i can use the (any) board with for example AdafruitIO_WiFi.h? et al...

charred salmon
#

My best guess is that you can use it, but you might have to manually set a flag.
Ultimately there's no harm in including the library, adding a few commands, and then trying to compile it for the target board, even if you don't have it or your code wouldn't do anything useful. That alone should generate errors if the library's incompatible.

#

My logic for "you should be able to use it" is based on the fact that the Uno R4 Wifi uses the RA4M1 microcontroller. A Cortex M4 based chip. The Adafruit Metro M4 uses a chip based on the same Cortex M4 core, though more powerful. (120MHz vs 48)

livid osprey
#

It doesn’t include everything, but should cover most typical use cases.

#

Anything higher level than this probably has one or more library dependencies in this list. If they all pass here, I don’t expect any issues with compatibility.

spiral carbon
livid osprey
#

IIRC the Wi-Fi module on the R4 Wi-Fi is an esp32.

spiral carbon
grave mortar
#

I'm sure this might be a dummy question but why does this run every second instead of much faster?

charred salmon
#

My first thought goes to what clock frequency are you compiling for, and do you actually have to set the frequency in the chip manually?

grave mortar
#

this is on the pico, I think I'm stepping on the serial line and it's causing the delay

charred salmon
#

Ah, yeah, anything about clocks would be irrelevant there. Well, not irrelevant, but the issue I'm thinking of wouldn't be a thing.

#

Probably

grave mortar
#

seems like my if message just takes 1 second 😬

charred salmon
#

Since you're initializing the USB serial, I'd suggest tossing a debug message out there and see what the serial monitor shows. See if your loop really is running every 10ms or not.
If it is, then you've probably got a transmission problem. If it isn't, then you actually do have a clock problem, though I'm not sure how.

grave mortar
#

hmm readStrting() vs read()

charred salmon
#

Interesting. I suppose I don't know enough about read vs readString to say.

#

Ohh... This might do it.

Serial.readString() reads characters from the serial buffer into a String. The function terminates if it times out (see setTimeout()).

#

And yep, checking into setTimeout, "It defaults to 1000 milliseconds"

grave mortar
#

🫡 🤦‍♂️

charred salmon
#

Take note though, serial.read gets you only a single byte with each use.

grave mortar
#

how do I override thge set timeout?

charred salmon
#

Serial.setTimeout(time)

#

And time is in ms

grave mortar
#

thank you!

viral prawn
#

Hey, when I'm at the point in my project where I want to go from my esp32 devkit to printing a pcb, is there a good and convenient way to do that? Specifically I'm wondering if there are like pcb templates that sort of duplicate the functionality of the devkit that I can work from instead of rebuilding that part myself.

#

Or is there an intermediate step I should do in between, like upgrade to a more professional dev kit? Or do they provide a schematic, then I duplicate what I need off of it?

#

My main concern is just not making it harder on myself than is necessary

muted gyro
#

Adafruit designs are open source and they have a few ESP32 boards

wraith current
#

@viral prawndepending on what the device will do you might get away with just using one of the feather form factor boards. Unless you want to run a special sensor on the board or do a mass production run you don't really need to design your own board.

#

But making a board based off an adafruit design is a good idea because their designs are very good.

edgy ibex
#

I'm considering switching to PlatformIO for MCU development, however I'm a litle puzzled about something. I did a pio boards and went searching through the output for the RPi Pico W I'm using for one project. Nothing for the Pico W, only the regular Pico, Is the W supported in PlatformIO? That's a bit of a drop-dead show-stopper if it isn't.

muted gyro
# edgy ibex I'm considering switching to PlatformIO for MCU development, however I'm a litle...

that's a loooong story with a lot of drama...
First, there are two "competing" arduino cores for RP2040. The official arduino-mbed one and the unofficial (but good) arduino-pico by earlephilhower. The official arduino-mbed one only has board definitions for Pi pico (without w) and the Arduino nano rp2040 connect. On the Pico w not even the blink builtin led example works. On the other side, Arduino-Pico has board definitions for everything. And full Pi pico w support. Afaik it's the one that adafruit recommends and writes their arduino libraries for. I bet you were already using this arduino-pico core in the Arduino IDE.
The "raspberrypi" platform in the platformio registry only supports the official arduino-mbed core. I would not expect any updates to that platform by anyone (except updates to the latest arduino-mbed core.)
There is a pull request that's been stalled for over 2 years now due to company politics. That pull request adds support for arduino-pico, and debugging.
You can still use arduino-pico with platformio, just not from the registry. Here's the guide: https://arduino-pico.readthedocs.io/en/latest/platformio.html

#

over all the Platformio integration of arduino-pico works really well

open hemlock
#

hey, I was uploading a sketch and then it wouldn't reboot. I did the ESPTool web flasher and then the board booted back up happily. But I uploaded my sketch, everything compiled and uploaded... But I got what appeared to be a different sketch output. I tried uploading an LED blink sketch and now it won't boot normally again, so I assume I need to re-flash the firmware again ...

Does that mean my local Arduino install is corrupt? Or is my board dying?

viral prawn
# wraith current <@138150549794193408>depending on what the device will do you might get away wit...

Yeah it's for work and there we are planning on tens of thousands of boards being produced so we would just like to design our own board around the esp32 chip. I already have written prototype code and prototyped around the esp32 dev kit from expressif. We have an electrical engineer in house who will inevitably handle this, I just wanna see how much I can do myself before then and print up some pcbs to build my own hopefully.

native dagger
#

Curious what folks think of this issue. I think it's my code but I'm not sure: The issue is under the creation of buffer1 and buffer2, where I have the while while (buffer1 != 128) logic. I never leave that while loop despite printing 128 repeatedly.

void loop() {
  int now = millis();
  int up_time = 3000;
  int down_time = random(2500,6000);
  uint8_t buffer1;
  uint8_t buffer2;
  roboclaw.SpeedAccelDeccelPositionM1(address,  up_accel, up_speed,up_decel , distance, 1);
  roboclaw.ReadBuffers( address, buffer1, buffer2);
  
  while (buffer1 != 128){
    roboclaw.ReadBuffers(address, buffer1, buffer2);
    Serial.println(buffer1);


  }
  while(now - millis() <= up_time){
    continue;
  }
  
   roboclaw.SpeedAccelDeccelPositionM1(address,  down_accel_fast, down_speed_fast,down_accel_homing , 75 , 1);
  while (buffer1 != 128){
    roboclaw.ReadBuffers(address, buffer1, buffer2);

    
  }
 while(now - millis() <= down_time){
    continue;
  }


}
#

buffer1 is supposed to be equal to 128 when the task is finished.

#

Here's my serial monitor

fringe shuttle
#

Hello, I am working with the Itsy Bitsy nRF52840 Express - Bluetooth LE. The guide Im looking at says to put the white DI cable into the 5V+ through hole. Someone on the forum said that wasn't correct but theyve stopped responding. Can anyone tell me where its supposed to go?

#

I will also note I am trying to make it not a closed loop. Id like for the circuitry to be on one end of the neopixel

edgy ibex
fringe shuttle
#

Thank you!

edgy ibex
#

Hang on a sec. The pin that's labelled 5**!** on the board is the Vhi output that you use for the power supply. I don't see a general output pin number 5. I'd suggest switching this over to #help-with-circuitpython since the provided code is written in CircuitPython. If I were doing this, I'd just look into changing the pin number at this point in the CP code:

from adafruit_bluefruit_connect.color_packet import ColorPacket
from adafruit_bluefruit_connect.button_packet import ButtonPacket

# NeoPixel control pin
pixel_pin = board.D5   # <<<<< Chasnge this to some other pin

# Number of pixels in the collar (arranged in two rows)
pixel_num = 24

but you'd want to talk with the folks over in the CircuitPython channel to get a correct relationship between the pin number in the code and the physical pin on the board.

fringe shuttle
#

Will do. Thank you

stark kindle
# native dagger Curious what folks think of this issue. I think it's my code but I'm not sure: T...

The way loop() is written there's nothing to indicate that you've left either while loop. After it gets through both of them it'll just start the first one again since it's in loop(), you'll just keep seeing the messages.

I'd add more debugging messages to make it more clear what's happening in the control flow. For instance:

void loop() {
  int now = millis();
  int up_time = 3000;
  int down_time = random(2500,6000);
  uint8_t buffer1;
  uint8_t buffer2;
  roboclaw.SpeedAccelDeccelPositionM1(address,  up_accel, up_speed,up_decel , distance, 1);
  roboclaw.ReadBuffers( address, buffer1, buffer2);
  
  Serial.println("starting first while loop");
  while (buffer1 != 128){
    roboclaw.ReadBuffers(address, buffer1, buffer2);
    Serial.println(buffer1);


  }
  Serial.println("completed first while loop");
  while(now - millis() <= up_time){
    continue;
  }
  
   roboclaw.SpeedAccelDeccelPositionM1(address,  down_accel_fast, down_speed_fast,down_accel_homing , 75 , 1);
  while (buffer1 != 128){
    roboclaw.ReadBuffers(address, buffer1, buffer2);

    
  }
  Serial.println("completed second while loop");
 while(now - millis() <= down_time){
    continue;
  }


}
edgy ibex
#

Quick PlatformIO question. I'm making the transition from Arduino IDE to PlatformIO, and have run into one minor issue.
I get the general case that libraries are not supposed to be global, and I understand their motivation to have libraries work on a per project basis. For all the stuff f I D/L from the web that makes perfect sense.
However, there is one library I have that does want to be in the Global Library store. It's a small collection of utility functions that I have written myself over the years that gets included in every project I write. Installing that on a per project basis will turn maintenance of that specific library into a nightmare, because if I fix a bug, or make an improvement, I'll need to do it ten or fifteen times, since I have that many projects on the go at once.
So, how do I set about putting a single .cpp and the corresponding .h file in the global library store in PlatformIO?

stark kindle
native dagger
stark kindle
stark kindle
native dagger
#

sorry, haven't had caffein

#

e

#

I see now thank you

stark kindle
viral prawn
# inland gorge Yep it will be recognized by an iPad. It’s a USB class device.

Hey when I run this code and plug it in to an apple device (iPad or MacBook via micro USB cable to a USB hub for the macbook or a lightning camera adapter for the iPad) TinyUSBDevice.mounted never returns true and it is never seen by the iOS device. I'm just looking for it in midi monitor on the MacBook but nothing ever changes in there. Am I doing something wrong?

grave mortar
#

Y'all ever know that there's a better way to do something but just have no idea how?

char myBuf[4];
if(Serial2.available() > 0)
{
byte in = Serial2.read();
if(myBuf[1] == byte(0x04) && myBuf[2] == byte(0x00) && myBuf[3] == byte(0x10) && myBuf[4] == byte(0x80) && myBuf[5] == byte(0xFF)&& in == byte(0x5C)){
Serial1.write(byte(0xB7));
Serial.println(in);
}
else {
Serial1.write(in);
Serial.println(in);
}
myBuf[0] = myBuf[1];
myBuf[1] = myBuf[2];
myBuf[2] = myBuf[3];
myBuf[3] = myBuf[4];
myBuf[4] = myBuf[5];
myBuf[5] = in;

grave mortar
#

🫡

stark kindle
#

for the latter bit of code where you're shifting myBuf down you could implement that as a ring buffer - you'd keep track of the current starting point and change that index instead of moving the bytes. Downside is it's harder to do the compare

grave mortar
#

sorry what woudl the memcpy be replacing here?

inland gorge
grave mortar
grave mortar
stark kindle
grave mortar
#

Gotcha, is it okay to just compare the full buffer as I have above?

stark kindle
#

Yeah that should be fine

viral prawn
edgy ibex
pallid sage
#

I just watched a silly sorting algo comparison, I feel using overlapping memcpy()s would be a a hilarious addition

north stream
#

I once intentionally misused qsort() by handing it a random comparison function, hoping for a quick way to shuffle an array. It turns out that the misuse, combined with the poor quality PRNG I was using, gave some odd structure to the result. I ended up plotting it and got an appealing herringbone pattern.

open hemlock
#

Is it normal for a board to lose it's boot loader every few uploads of code? I've been testing deep sleep in Arduino with my ESP32-S2, which I realize makes my life a little harder, but on my Windows and Mac I've found I've had to reset the bootloader after just reloading the board a couple times.

inland gorge
# viral prawn https://www.digikey.com/en/products/detail/espressif-systems/ESP32-S2-DEVKITC-1-...

Sounds like you're new to the "quirks" of ESP32-S2/ESP32-S3 Arduino development. It can be kind of a pain. Some tips:

  1. I would recommend only using the USB port marked "USB" and not the one marked "UART". The "USB" port is what can be different types of USB devices like CDC/HID/MIDI/MSC, etc
  2. In the Arduino IDE "Tools" section, make sure you have the Upload Mode and USB Mode are set to "USB-OTG", like in the attached screenshot. (this selects that you'll be using the "USB" port for uploads).
  3. Before uploading, hold the BOOT button and tap RESET, then release BOOT. This puts the board in USB bootloader mode
  4. When you upload, it may get confused which upload port to use. Sometimes it figures it out. Sometimes you have to go back to Tools/Port and select it again
  5. After uploading, you have to physically tap RESET for your sketch to start
  6. If using the Serial Monitor, you will need to change your Tools/Port to the port TinyUSB creates as part of your sketch
viral prawn
#

You are absolutely right and I certainly appreciate the tips. Thanks a lot!

So, my Arduino IDE does not have a "USB Mode" option. It does have "Upload Mode" but the only options are "UART0" and "Internal USB". Maybe this is because of the version or because I am on Ubuntu?

I am using the port labeled "USB" and not "UART".

When holding "BOOT" then pressing "RESET" /dev/ttyACM0 becomes available and is labeled with my dev kit model.

I have successful uploaded it using both upload modes available to me.

When it is done uploading I unplug the USB micro cable from my computer and move it to the USB hub attached to my iPad.

I then open midi wrench and midimittr and I don't see any new devices.

I then hit the reset button on the Dev kit and reopenen either app and still see no device.

#

Please excuse the terrible picture

#

I also tried on a MacBook and saw nothing in the media monitor. Another thing is that I don't know what I'm looking for. Are midi wrench or midi monitor good apps to test this? If not, could you suggest one?

#

I should also mention that I am using this dev kit successfully on another project.

inland gorge
# viral prawn You are absolutely right and I certainly appreciate the tips. Thanks a lot! So,...

I don't know the current consumption of the ESP32 dev kit so the iPad may not be able to power it. I would ensure you're seeing it show up as a USB MIDI device on your computer first, to eliminate any iPad weirdness. As for your iPad power issues, you could try putting a powered USB hub (or maybe even power it via the "UART" USB port, though I'm unclear what kind of power switching the devkit board does if both USB ports are plugged in)

viral prawn
#

I have it wired up to be powered by the five volt rail anyway so I'll try that real quick

viral prawn
#

Hmmm no change on the iPad feeding it through five volts or through a powered USB hub. Unfortunately I won't be able to test on a MacBook until Tuesday.

viral prawn
inland gorge
river yacht
#

I just got the rainbow demonstration working on the qualia rgb666 and the 320x820px display... may I have some suggestions on what to look at next to figure out how to draw an image or text to it?

inland gorge
quartz furnace
#

I’ve always had so much help from this channel/ community…. Appreciate it 🙂

#

Today looking for help with this library

#

It appears possible to use a different camera than in the code … I have a “timer camera-x” by M5Stack

#

Normally you just go to a tab and modify “camera pins” to your board

#

Apparently they implemented things differently, not sure what it’s looking for// in code modification

#

Really hoping to use Timer-Camera-X board by M5 , because it doesn’t require a FTDI programmer like AI-tinker does

#

Any help would be appreciated

#

Update: example 3 “get your first picture “ has a little more detail— showing 5 total ESP32 Cam variations

So there are possible changes… just need to know the file to edit and add “M5 Timer Camera “ to the possibilities.

river yacht
#

@inland gorge Thank you! I now have something that almost looks like an egt gauge, albeit a simplistic one!

short steppe
#

Hi all, I just got an ESP32-S3 feather from Adafruit, and I'm trying to load the normal blinky sketch but the IDE can't open the port, despite being able to detect the Feather board. I've installed all the drivers per instructions, anyone have any tips?

open hemlock
#

Then you have hit 'reset' yourself... Pick the other com port.... And then yer good 🙂 It's kind of a PITA... CircuitPython is dreamy in comparison. But it is quite fast and that's why I am trying to have fun with it 🙂

stark kindle
stark kindle
# quartz furnace Update: example 3 “get your first picture “ has a little more detail— showing 5 ...

There are two things you need to be concerned about here.

First is the how the camera is connected to the CPUs IO pins. These cameras use a lot of pins. You'll have to work from the documentation on the M5 Timer Camera and try to reconfigure the code you want to run to use those pins. Unfortunately the naming on all the pins isn't always consistent, so you may have to guess what the wiring on the M5 Timer Camera corresponds to in the code.

quartz furnace
#

I did get a ESP32-CAM MB off of eBay — and used them with some Microcenter ESP32 CAM boards —— so that could be an option. Just prefer the integration and compact size of the M5 versions

stark kindle
#

There's a chart showing the pins used by the M5 at https://docs.m5stack.com/en/unit/timercam_x - Pinmap

#

Second you'll need to make sure the code you want to run supports the camera that the M5 uses. There are quite a few variations of cameras that these devices use and they all work slightly differently. The M5 uses a OV3660 camera sensor, so you'll need to make sure the code you want to run supports that. You may need to reconfigure it to use that sensor... depends on the code.

quartz furnace
#

Hi didn’t see in the example where it assigns camera pins though

#

I’ve reached out to them on GitHub to ask if they’d add the M5 versions

I might just get an ESP32-CAM-EYE board, it’s supported and like the M5 is compact and doesn’t require a programmer

#

I appreciate you looking at this with me —- wish they would have just done a “camera_pins.h”

stark kindle
stark kindle
#

also just a little bit of documentation would have helped

quartz furnace
stark kindle
# quartz furnace Brilliant!!!!!!

took a while to find it, it's not just you having trouble with it 🙂 They actually did a nice job organizing it all in C++, there's just a lot to look through. Good luck!

quartz furnace
#

What got me is wouldn’t it need to “include” setModePins.h ?

#

How are they linking it without doing the include ?

stark kindle
quartz furnace
#

Ahhhhhhhhhhhhhh!!!

#

Didn’t know you could do it in that manner. Thanks 🙏🏻

#

Thought they somehow did some hidden voodoo lol 😂

stark kindle
#

They kinda did 😉

quartz furnace
quartz furnace
# stark kindle They kinda did 😉

So after finding the pins configuration .h file , it appears to be a very close match to the “m5” settings ——- easy fix.! I was hesitant to just try that option without knowing exactly the camera version

Cool thanks again 🙂

peak shell
#

Hi, I'm completely new here and looking for some advice on my new project (feather rp2040, Music Maker FeatherWing, 2xNeokey 1x4, I2C Stemma QT Rotary Encoder). I refer to the simple example "feather_player". Playing a few .mp3 files works perfectly. But now I have problems integrating the Neokeys. My guess is that no further action is possible while the .mp3 is playing. Is there a simple way to run several tasks side by side while the .mp3 is playing?

Thank you very much

muted gyro
#

Rp2040 is dual core. So maybe the easiest way is to just run each task on a separate core. (I don't know the feather_player example, how it works or if it truly can't run anything else on the same core while playing)

north stream
#

The Readthedocs page on the Pico says there's a Multicore.ino example, so I updated to the latest version of the RP2040 board package, but I had to do a little looking to find it. It turns out it's a few menus deep in File -> Examples -> Examples for Raspberry Pi Pico -> rp2040 -> Multicore

limpid pivot
#

appreciate any thoughts

river yacht
#

Are there any SPI tutorials out there that actually make sense? The one on circuit digest is downright terrible.

safe shell
#

@river yacht what processor board are you using, and what SPI device are you wanting to connect to?

river yacht
#

@safe shell can m4 to qualia esp32-s3 rgb666

river yacht
#

I've got the board mostly working...

#

just not the spi

#

I want to use spi to send results from the can m4 to the qualia so it can display voltage, egt, and eventually some data from the j1939 network

safe shell
#

it might be easier to use UART between two processors

dusk orchid
river yacht
#

i have it all wired up for spi though i suppose i could rewire it… i have zero experence with uart beyond sending a usb message back to the computer

safe shell
#

@river yacht you may be able to use the spi pins for uart, without re-wiring anything

river yacht
#

i’ll give it a try! thank you!

safe shell
#

hm, not sure

#

SERCOMs can used as UART (TX on SERCOM pad 0, RX on any pad) [M4]

#

(but in any case, you wouldn't necessarily have to remove the SPI wiring)

#

more flexibility on the ESP side

river yacht
#

in theory the display doesn’t ever need to send any data back, just respond to and display results for the can m4

sturdy plover
#

I am trying to use a wemos D1 mini and an arduino pro micro to emaulate an HID device (https://github.com/jensweimann/esphome_ducky) I am able to send duckyscript payloads from Home Assitant now when the Arduino Pro Micro is plugged into my pc directly, however when I plug it into the keyboard port on my Tesmart KVM I can see it come online and send a script but the KVM doesn't pass that script to my PC. I want to use the hotkey feature of my KVM over wifi throgh home assistant.

GitHub

Contribute to jensweimann/esphome_ducky development by creating an account on GitHub.

safe shell
#

@river yacht my read is that D1 (TX on the silk), D5, or D12 could be a UART TX

fair tusk
leaden walrus
#

looks like bill is helping you in forums

fair tusk
#

the SDX and SCX pins arent pulled up, so for a 5V device do i need to add anything?

leaden walrus
#

probably best to troubleshoot in one place

river yacht
#

Is there a way to turn off the splash screen on the oled feather without modifying the library?

inland gorge
river yacht
#

oooo thank you!

river yacht
#

I'm trying to setup my qualia rgb666 in vscode but even after adding both urls and reinstalling esp32 I still am unable to find the qualia board listed in the board manager. Am I missing a step?

river yacht
#

well now I have vscode finally seeing all the libraries but it doesn't seem to be able to upload to the qualia

#

guess it needed a reset before the upload, never mind! Thanks for putting up with me!

dull pond
#

Good evening folks, I'm working with the Feather M0 Adalogger with a set-up of an IMU, pressure sensor, RTC, and temperature sensor to save data to a SD card.
I have both a breadboard and protoboard version that works fine and saves data when plugged via a USB.

However, when I use an external battery instead of the USB. No data is saved? Is it because there's too much going on for the battery to support the system?

stark kindle
river yacht
#

well the spi is trying... I think... but I must be missing part of the puzzle

brave flower
#

I'm thinking about learning to use wifi on an arduino, as such I'm going to order an UNO R4 WiFi, on top of that I was wandering if anyone had suggestions for a board that has a wireless module built in but has a smaller form factor. for example I don't require an LED matrix, the UNO will be for learning the other board for implementing.

muted gyro
#

Some Feathres and QT Py have wifi. Keep in mind, that different boards have different WiFi modules

north stream
viral prawn
edgy ibex
# brave flower I'm thinking about learning to use wifi on an arduino, as such I'm going to orde...

Following on from what @muted gyro said, if you're just starting, one of the ESP32 Feathers would be a really good starting point just to get your feet wet. There are sample sketches on the Adafruit learn pages that will walk you through, step by step, the process of connecting to your WiFi, and from there connecting to the Internet.
https://learn.adafruit.com/adafruit-esp32-feather-v2/wifi-test

Adafruit Learning System

The Feather HUZZAH32 in a whole new light!

inland gorge
viral prawn
inland gorge
spark carbon
#

Hello. Im trying to get the 64x128 monochrome OLED to work with my ESP32 Feather v2. I have it connected over STEMMA QT and it says its getting power but I cant seem to get anything on the display. Im just trying to run the example code provided by the Adafruit_SSD1306 library

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3D

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

void setup() {
  Serial.begin(9600);
  
  if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
    Serial.println(F("SSD1306 allocation failed"));
    for(;;); // Don't proceed, loop forever
  }

  display.clearDisplay();
}

void loop() {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println("Hello World");
  display.display();
  delay(1000);
}
light stream
#

Hi, I'm programming my esp32-s3 with arduino, but it keeps going back to circuitpython mode, how do I make it stop doing this?

inland gorge
light stream
#

I keep getting sent back here all the time. It was just working and then all of a sudden we start going here lol

#

I worked on my code several times no problem and then this always

#

I sometimes can fix it for awhile by reloading the test program for this board, but when I work on my code we go here

inland gorge
# viral prawn I took a video of where I'm at with this. Does anything jump out at you that I'm...

I just tried this Arduino sketch (https://gist.github.com/todbot/512f9911df02289ee630d92122bcab2b ), a modified version of the "midi_test.ino" from Adafruit_TinyUSB_Arduino that fixes a few small issues (midi loopback, midi send storm on boot) and tried it on a ESP32-S2 dev board and an ESP32-S3 QTpy. On both I observe the expected behavior:

  • on plugging in, the device shows up as a USB MIDI device with custom name that's not "USB JTAG/Serial debug unit"
  • shows up in a MIDI device list (like in say MIDI Monitor's expanded "midi sources" https://www.snoize.com/midimonitor/)
  • prints to Serial Monitor when USB MIDI is received
  • constantly sends USB MIDI notes that play a tune
    If this or the normal "midi_test.ino" doesn't even show up as a MIDI device to your computer or persists in showing up as "USB JTAG/Serial debug unit", then I would suspect the Arduino install or some configuration setting under Tools. Perhaps try installing the Arduino IDE on another computer, using the Board & Library Manager to install needed libraries, etc.
inland gorge
safe shell
#

@light stream the board enters bootloader mode if the reset button gets double-pressed or if reset then BOOT are pressed

light stream
#

I guess I'm calling it the wrong thing

spark carbon
viral prawn
light stream
dull pond
inland gorge
viral prawn
#

Cool I will, I just need to look when I get back there

river yacht
#

Just wanted to say thank you! Got it working now! nice little egt gauge. bunch more coding on it... then one day, figure out how to make a custom pcb that can handle everything!
https://youtu.be/AggzQU8-3Bo?si=lTSdpFghYOoCJYc1

After much pulling of the hair, I have successfully transmitted sensor data from the Adafruit feather can m4 to the Adafruit Qualia ESP32-S3 RGB666.

Very very cool! Much more work to go, but I had to share this success!

▶ Play video
vivid rock
spark carbon
#

I do not

vivid rock
#

two obvious culprits:

  • do you have pullups on SDA and SCL lines?
  • is the I2C address correct? iirc, some displays use I2C address 0x3C
#

can you run I2C scan?

charred salmon
#

I'm trying to make a tabletop stat counter, and want to have a few user selectable names for counters. Since these names will never actually change, I want to put them into program space to save on RAM given that eventually this will target the ATTiny with only 512 bytes. The idea is that each counter can just point to an array to reference a long and short name.

const String names[3][2] PROGMEM = {
  {"HEALTH","HP"},
  {"EXPERIENCE", "XP"},
  {"GOLD", "GP"}
};```
This works with warnings on the M0, but fails completely on the Tiny.
What is a good way to do this?  I'm hoping that I can just reference each name with two ints.
#

Basically, I'd like to make a function that is just printName(1,0); to have it print out "EXPERIENCE"

charred salmon
#

This is probably going to be the best I can do, unless someone else has a better suggestion. I'll just make my own pseudo strings I guess.

const byte names[3][11] PROGMEM = {
  {6,'H','E','A','L','T','H'},
  {10,'E','X','P','E','R','I','E','N','C','E'},
  {4,'G','O','L','D'}
};

const byte shortNames[3][5] PROGMEM = {
  {2,'H','P'},
  {3,'E','X','P'},
  {4,'G','O','L','D'}
};```
muted gyro
#

don't forget the zero termination

charred salmon
#

That's what the number is on the front. Kinda. It's a count of how many characters are in that string so I can use it to calculate how to center it when printing.

#

The function will take that number, offset the starting location based on it, and then it knows to only try and print that many characters afterwards.

muted gyro
#

I think at least some c string functions rely on zero-termination 🤔. But if you're only using your own function then I suppose it's fine

charred salmon
#

Yeah, no proper strings here. At least not for this section.

muted gyro
#

But why not just zero-terminate it? I mean you're not saving a single byte by doing your own "storing the length" thing

charred salmon
#

Because I need the character count ahead of time for centering. So it's either put the count at the beginning, or count the characters each time.

#

Same number of bytes stored, but more work for information that should already be known.

muted gyro
#

I see

charred salmon
#

That said, the more I think about it, the more I think I probably don't need to be this stingy with my RAM. I mean, at worst when this is fully fleshed out I'm going to have 8 independent counters, each one in the range -999 to 9999. I'm not that pressed for RAM.

#

Even sticking the strings into RAM I'm probably going to be sitting under 100 bytes used.

muted gyro
charred salmon
#

It's all I know for strings.

muted gyro
#

Sounds to me like the c string is enough for you. And if you have very little RAM avoiding any kind of dynamic allocation (which String might do) is good

charred salmon
#

Oh, so it kinda just ends up doing what I'm doing in the second version anyway. Though I called them bytes, not chars.

muted gyro
#
const char* const names[3][2] PROGMEM = {
  {"HEALTH","HP"},
  {"EXPERIENCE", "XP"},
  {"GOLD", "GP"}
};

this compiles without warnings but I haven't tested if it actually works

#

"declare names as array of array of const pointer to const char"

charred salmon
#

One way to find out. Stick some serial prints in and let it fly. Gonna start by seeing if it'll tolerate treating them as normal strings.

#
12:58:52.104 -> GOLD
12:58:53.083 -> HEALTH```
#

Well would you look at that. Fancy.

charred salmon
#

Yep

muted gyro
#

🥳

charred salmon
#

So I guess I'll just be counting characters. I kinda wanted to avoid that, but honestly it's a lot easier than what I was going to have to do anyway.

#

Unless... Gotta check something...

muted gyro
#

doesn't sizeof(names[0][0]) work in this case 🤔 (or subtract 1 from that because of the null termination to get the amount of displayable letters)

#

I mean the array sizes are defined at compile time so it might work

charred salmon
#

Unfortunately it does not. It's returning 4 every time for some reason.

#

Which is weird... Where is 4 coming from?
Oh... Wait... Is it getting the size of the pointer?

muted gyro
#

that might be it

#

I wonder how much this gets optimized away. Just completely to 7, right?

charred salmon
#

How about this, how can I copy the data that it's pointing at to a fresh variable? Remove the use of pointers for this.

#

I know strikingly little about pointers.

north stream
#

You can use memcpy() to copy things. However, in low-RAM environments, it may be worth learning how to code effectively with pointers. The AVR architecture is optimized for pointer operations.

charred salmon
#

I looked into memcpy(). Unfortunately for that you need to know how many bytes to copy, which is what I'm trying to find in the first place. So far I can get the strings, but other than operating on them as a whole I can't seem to do anything more specific.

north stream
#

If you're dealing with the strings directly in flash, there's another layer you have to deal with. You might consider returning to your length+data model. You can store it like "\04DATA"

charred salmon
#

I might have to.

#

Note to self, specify that these are characters.

13:43:11.750 -> Name 1 is 10 characters long. It is: 69888069827369786769
13:43:12.728 -> Name 2 is 4 characters long. It is: 71797668
#

It's probably not the best way of doing this, but it's functional. And to me that's the more important part.

north stream
#

Yar, that works

#

I got into pointers early on, so my Arduino code tends to have structures of pointers to other structures, functions that take a bunch of pointers as arguments, etc.: ```arduino
// display object structure (symbol, current segment, current position, size, rotation)

struct object {
struct symbol * symbolp;
struct segment * segmentp;
struct segment * segmente;
struct param curparam;
struct param dparam;
};

// forward declarations

static void initshapes();
static void initobjects();
static void setupline();
static void updateobjects();
static void getnextobjectsegment();
static void setupobject(struct symbol * symbolp);
static void buildfromvertices(const struct figure * figurep, const struct symbol * symbolp);
static float frandom(float range);

#

You'll notice I declare a bunch of stuff as const and static too (which saves memory in some circumstances)

charred salmon
#

They're definitely something I need to get more into. I've poked them a little bit, but nothing particularly fancy.

#

I think the issue here is I'm trying to pile too many layers onto one thing. If I weren't trying to do strings in flash with pointers where I need to be able to access individual characters, it might be more reasonable.

#

I am at least doing bitmask operations. Not at all related, but it's better than constantly trying to work around some of the things with the IO expander, and is something in the past I'd never have needed to bother with.

#

So I am learning and expanding.

north stream
#

I'm unsure how effective pointers are in flash-based strings. I think under the hood, the code ends up calling a routine to fetch the bytes from flash one at a time in a loop, but I haven't looked into that recently so my memory is vague.

native dagger
#

Having an issue where my arduino doesn't seem to be overwriting old code, except sometimes it does? If I load an empty sketch, it behaves as normal, but if I overwrite my sketch I'm working on, it seems to keep some old variable values and not run some code. What could cause that? Here's some pseudocode


val1 = 1;
val2 = 2;
val3 = 3;
// seem to keep values from old versions of sketch, e.g. encoder position to go to is always the same even though I have changed it


void setup()
{
  some_code_that_does_not_run;
  some_other_skipped_code;

  code_that_runs;
}

void loop()
{

//runs normally
}
north stream
charred salmon
#

Hm. Definitely something to explore.

north stream
#

That's weird with the old values. Normally there's zero-initialized global data and static initialized data (like your global variables val1 and friends). Those are normally initialized at startup (from a data segment packaged with your program known as the bss segment). However, since they're not declared as static, it could be the loader is considering them as something an external module might modify?

native dagger
#

so write them as static?

#

it's very strange because I've "nuked" it with an empty loop and the old values no longer exist so?

#

sorry I didn't use type, they are all int16_ts

#

used to python

native dagger
#

ah that's because I didn't wait for Serial

inland gorge
muted gyro
#

👍 thanks, that explains it. But then it's counted at runtime, right?

#

this looks like it does the string-length counting during compilation. But I don't know if the constexpr interferes with other use of the names and PROGMEM 🤔 (Tbh I don't understand how constexpr really works)

#
constexpr const char* const names[3][2] PROGMEM = {
  {"HEALTH","HP"},
  {"EXPERIENCE", "XP"},
  {"GOLD", "GP"}
};
void setup() {
  Serial.begin(9600);
  constexpr int i = strlen(names[0][0]);
}
inland gorge
muted gyro
#

the tooltip looks correct for all

inland gorge
#

That's great! I was under the impression that doing multi-dimensional arrays of variable-length strings was not allowed in C++

muted gyro
#

me too 😆

#

I wonder how that actually looks in memory

#

nothing fancy actually. Just the char-arrays(strings) after each other and then pointers to them

#
.LC0:
        .string "HEALTH"
.LC1:
        .string "HP"
.LC2:
        .string "EXPERIENCE"
.LC3:
        .string "XP"
.LC4:
        .string "GOLD"
.LC5:
        .string "GP"
        .type   names, @object
        .size   names, 12
names:
        .word   .LC0
        .word   .LC1
        .word   .LC2
        .word   .LC3
        .word   .LC4
        .word   .LC5
charred salmon
#

Also is that a newer Arduino IDE, or something else entirely? I've been lazy and ignoring updates. So I'm still back on 1.8.19

muted gyro
#

interesting. constexpr doesn't actually matter (in my shortened test case) according to https://godbolt.org/

charred salmon
#

I guess I should upgrade, and hope that nothing breaks. I guess if the compiler is the same it should be fine.

muted gyro
#
#include <string.h>
constexpr const char* const names[3][2] = {
  {"HEALTH","HP"},
  {"EXPERIENCE", "XP"},
  {"GOLD", "GP"}
};

int main()
{
    constexpr int l0 = strlen(names[0][0]);
    constexpr int l1 = strlen(names[1][0]);
    constexpr int l2 = strlen(names[2][0]);
}

=> causes 6 load immediate instructions. (To initialize an int with a value that is known at compile time, you need two load immediate instructions because the int is 16 bit, but the load immediate instructions and registers are 8 bit.)
So the compiler figures out the values that l0, l1, l2 should have and just saves 6, 10, and 4 in the program.

  • removing all constexpr => doesn't change anything
  • removing all constexpr and the second const from the names declaration => strlen() actually gets called during program execution.
#

I think the compiler figures out that everything is const in this case so it can optimize strlen() away

inland gorge
#

that's pretty cool and magical 🙂

inland gorge
muted gyro
#
#include <string.h>
const char* const names[3][2] = {
  {"HEALTH","HP"},
  {"EXPERIENCE", "XP"},
  {"GOLD", "GP"}
};

int main()
{
    int l0 = strlen(names[0][0]);
    int l1 = strlen(names[1][0]);
    int l2 = strlen(names[2][0]);
}

=> in this case, AVR gcc 9.2.0 and newer optimize strlen away. AVR gcc 5.4.0 still calls strlen. And gcc 9.2.0 is also the first one that knows about constexpr

muted gyro
inland gorge
#

hehe

inland gorge
muted gyro
#

btw: important to add -O0 to the compiler options for my 3 tests! Otherwise it completely optimizes everything away because int l0, etc aren't actually used.
But even with -O0 it optimizes strlen() away.

#

Earlephilhowers Arduino-Pico for RP2040 is also quite nice, because it uses GCC 12.3 so you can use some actually very new C++ features. I think the default is C++17 but you can change it to C++20 in platformio.ini

#

(It annoys me that most arduino cores use ancient compilers)

odd heron
#

i am having an issue in using global variable public_ip_addr

charred salmon
#

I updated to Arduino 2.2.1, and now it's telling me a programmer is required when I try to upload to my ATTiny85. Ok, fair enough, but I have a programmer. I specifically picked Arduino as an ISP which worked just fine in 1.8.19

#

Oh, nevermind. Arduino 2.x requires that you explicitly specify upload with programmer. 1.8.19 did it automatically. That's kinda lame.

inland gorge
north stream
vivid rock
#

I am trying to understand everything about building custom UF2 bootloaders for SAMD boards. The main source, of course, is adafruit's repository https://github.com/adafruit/uf2-samd21

I kinda understand how it works, but can someone tell me if the options for SAMD51 boards - like the ones below - are documented anywhere?

#
#define BOOT_USART_MODULE SERCOM0
#define BOOT_USART_MASK APBAMASK
#define BOOT_USART_BUS_CLOCK_INDEX MCLK_APBAMASK_SERCOM0
#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD0
#define BOOT_USART_PAD3 PINMUX_PA07D_SERCOM0_PAD3
#define BOOT_USART_PAD2 PINMUX_UNUSED
#define BOOT_USART_PAD1 PINMUX_UNUSED
#define BOOT_USART_PAD0 PINMUX_PA04D_SERCOM0_PAD0
#define BOOT_GCLK_ID_CORE SERCOM0_GCLK_ID_CORE
#define BOOT_GCLK_ID_SLOW SERCOM0_GCLK_ID_SLOW
#

@stable forge ?

vivid rock
#

indeed, sorry

stable forge
vivid rock
#

I expected that much.
Will read the code and ATSAMD51 datasheet then...

#

Thanks!

spark carbon
# vivid rock can you run I2C scan?

I ran the I2C command and it returned this (See image below). The ESP32 feather v2 documentation said this:

There is a power pin that must be pulled high for the STEMMA QT connector to work. This is done automatically by CircuitPython and Arduino. The pin is available in CircuitPython and in Arduino as NEOPIXEL_I2C_POWER.

I modified my code to the following but still no output on the 128x64 OLED

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define SCREEN_ADDRESS 0x3D
#define OLED_RESET -1

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

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

  // Documentation says to pull this pin high
  pinMode(NEOPIXEL_I2C_POWER, OUTPUT);
  digitalWrite(NEOPIXEL_I2C_POWER, HIGH);

  if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) {
    Serial.println(F("SSD1306 allocation failed"));
    for (;;);  // Don't proceed, loop forever
  }
}

void loop() {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0, 0);
  display.println("Hello World!");
  display.display();
  delay(1000);
}
#

There is nothing on the Serial Monitor indicating any errors

north stream
#

Maybe it wants a reset pin?

spark carbon
spark carbon
#

I solved the issue

#
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 display(128, 64, &Wire, -1);

void initDisplay(){
  delay(1000); // KEEP THIS!
  // The OLED driver circuit needs a small amount of time to be ready after initial power.
  // https://learn.adafruit.com/monochrome-oled-breakouts/troubleshooting-2

  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3D)) {
    Serial.println(F("SSD1306 allocation failed"));
    for (;;);  // Don't proceed, loop forever
  }
}

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

void loop() {
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0, 0);
  display.println("Hello World!");
  display.display();
  delay(1000);
}

https://www.adafruit.com/product/938
https://www.adafruit.com/product/5400
Here is the final code for anyone using the Monochrome 1.3" 128x64 OLED graphic display with the Adafruit ESP32 Feather V2 over STEMMA QT and having issues with getting it to display

north stream
#

Ah, a little time delay. That makes sense.