#help-with-arduino
1 messages · Page 21 of 1
those previous issue threads pre-date the Feather ESP32 V2, so can't roll back that far and still use the same board
however, using an original feather esp32
installing BSP 2.0.1
and then manually making these updates:
https://github.com/espressif/arduino-esp32/pull/5910/files
it works
did it not work before the updates?
it did not
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1284
load:0x40078000,len:12836
load:0x40080400,len:3032
entry 0x400805e4
Adafruit SCD30 test!
SCD30 Found!
Measurement Interval: 2 seconds
Data available!
Temperature: 22.91 degrees C
Relative Humidity: 47.63 %
CO2: 0.000 ppm
Data available!
Temperature: 22.89 degrees C
Relative Humidity: 47.81 %
CO2: 385.695 ppm
Data available!
Temperature: 22.87 degrees C
Relative Humidity: 47.82 %
CO2: 458.472 ppm
then you might try 3.0.0 or 3.0.1
i'm currently dealing with really slow internets, so unfortunately can't easily do a BSP version regression walk 😦
I would do it now but I have non-work stuff to do tonight. I can try tomw if you still have slow internet
@stable forge think i figure it out. it's related to i2c power feature of feather esp32 v2. adding a delay in user sketch before init'ing SCD30 seems to resolve it.
@versed python try adding a delay in the example sketch:
// Try to initialize!
delay(1000);
if (!scd30.begin()) {
Great! I wonder if there are other drivers that will need that.
datasheet doesn't seem to have a spec for power on timing
but a feather board reset power cycles the scd30
That fixed my error! Thanks @leaden walrus for figuring it out, and thanks @stable forge for your inputs:)
cool. glad that fixed. you can try reducing that delay amount to figure out what you can get away with.
1 second was just a super conservative guess value
I tested various values, and the lowest delay that I'm able to get away with is 24 ms, which is pretty good
is there a way to drive an st7789 from an esp32(s3) using DMA (using arduino ide)?
i mainly just need to be able to send a framebuffer very fast
Super beginner and basic at coding but joined robotics team and my job right now is to deploy lights on a rover:
need your feedback on my LED implementation for the robotics rover. The electrical team gave me detailed instructions, and here's what I've put together:
Hardware Requirements
Using WS2812 LED strips (30 LEDs)
Each LED draws 60mA at full brightness, so total current draw is 1.8A
Need external 5V power supply since Arduino USB (500mA) isn't enough
Added safety features:
1000 µF, 6.3V capacitor across power lines
Fuse for overcurrent protection
Backfeed protection for Arduino
My Implementation; I coded it (used a bit of feedback and google + AI to learn cuz I am super new sorry); can I get any feedback pls? Just trying to learn
https://paste.mod.gg/kkltzmkaeozb/0
A tool for sharing your source code with the world!
heres a pic of setup
check out the fill() routine, which does what your setColor() routine does, and more.
thanks, ill look it up
this is what they gave me to work with
Do you think it would be better to use fill()? I t looks like they do similar things/work the same, but I am looking to see if I can find it
It would probablyu make the code simpler though
It would make the code simpler, and you can do a partial fill if you want. It's in the .h file for the library.
Neopixels at full brightness are REALLY bright. Do some testing and see if you really need full brightness.
If not, you can cut back on the power requirements.
Personally, I’ve found that 30-40% brightness is pretty sufficient
Yeah I think I could literally just delete the loop
https://paste.mod.gg/twkvvhpprhlj/0
thoughts on this now? any improvements? potiential issues?
don't paste screenshots, if that's what you are doing. The link to the paste place is fine
oh alright, yeah the link works
sorry about that
ok ill leave the link but i cant delete the ss
if u have feedbacxks let me know
You can define a color once and use it, like:
uint32_t red = strip.Color(255, 0, 0);
I kind of did that
different syntax tho, ill change it
uint32_t red = strip.Color(255, 0, 0);
uint32_t green = strip.Color(0, 255, 0);
uint32_t blue = strip.Color(0, 0, 255);
uint32_t off = strip.Color(0, 0, 0);
``` smth like this, right?
ok
one sec
https://paste.mod.gg/xtwipijrzmih/0 check this ouit
A tool for sharing your source code with the world!
that works
yay
im gonna ask to set it up
i really wish i had more knowledge of circuits
i will learn though - i am in computer engineering but idk how themosvet and stuff works 😦
thanks so much for the help
Is it possible to do Arduino development (for RP2040 in this case) without using the Arduino IDE? It's awful performance is really getting in my way.
there's arduino-cli:
https://github.com/arduino/arduino-cli
That looks like it could be just the thing. tnx.
if you want an IDE, PlatformIO for VS Code
There is also the Arduino Extension for VSCode which is what I use
It interfaces with arduino-cli and adds a ui
its called "Arduino Community Edition" (the original was deprecated so this is the actively maintained fork)
New with the Arduino Uno R4 and designing my own board. On the Pro Mini with P328 I could grab pins directly in code using the names from the datasheet.
Would I be able to do the same with the R4 or is using any random pin for a function gonna be a world of hurt when actually trying to program it?
I am old school. emacs and a command line.
server nickname checks out 😆
Last architecture I programmed bare metal in assembly was RISC-V. Very reminiscent of the old IBM 360.
Microservo jitter behavior:
I have an SG92R micro servo wired up to a 5v metro mini v2 at D12 and an external power supply (5V, 30A). The microservo is attached to arm that's ~8 grams and 130mm long.
- It seems fine from 0-60 degrees
- 90 degrees, it jitters chaotically
- 90-180, it loses a few degrees the until 180 is actually closer to 140.
- added a 100uf capacitor across the external power supply, no luck
- microservo doesn't jitter at position 0
Any other ideas to stabilize the microservo?
void servo_test() {
for(int i=0;i<180;i+=30) {
sort_servo.write(i);
delay(5000);
sort_servo.write(0);
delay(5000);
}
}```
Tiny little servo can rotate approximately 180 degrees (90 in each direction) and works just like the standard kinds you're used to but smaller. You can use any servo code, hardware, or ...
have a problem with my code for a music box that has the following features. Using two neokey1x4 I can switch between folders on the SD card and press play/pause, stop, next song, previous song. Then .mp3 on the SD card should be selected and played. In each folder (01, 02, 03, etc.) there are .mp3 according to the following scheme: 001.mp3, 002.mp3, etc. I use a function to count the songs in the folder. I tried many things and looked many times in the mp3 musicbox adafruit project. Unfortunately, songs are skipped and I don't know why. Everything works, until further notice. In the meantime I have inserted a lot of serial.prints to check where the problem could be. I also checked different SD cards (FAT32), replaced the µC or the vs1053. In a stripped down project everything works fine. Maybe one of you has an idea? Thanks a lot!
setEncoderPosition() was not implemented in the initial firmware load on the encoder boards (are you using neokey or rotary encoder seesaw boards?).
But this does not sound like your problem. This sounds more like a debouncing problem.
Do the "Playing song" debug prints show skipped songs? How about the printouts in playSong()?
Having arduino nano issues I’m using these nanos and the red light is on and the it recognizes the nano board but nothing happens when I run my code. Is this some driver issue Ik not aware of if so how can I fix this?
it seems like the boards are working with that void setup test. I think it might be how it’s wired?
Looks like you have two nanos, what are they doing? Does either one start up?
Both start up and the red light is on
Testing out codes on both
Both are not plugged in don’t worry
Start up in the sense of starting to run your code?
Yeah
And the board blinks but nothing happens
Someone told me the nano needs an external power source
It should be powered from the USB connection
My next step would be to put some waypoints in the code to see how far it gets
waypoints are places where the code does something unique that you can see or hear. To tell that it got that far. For desktop computers, that is often a print statement. For a microcontroller, where there is no screen, blinking an LED (in a pattern) is typical. With a neopixel, blink and set colors.
hello danh, thanks for your looking into the code. In the following an example output after pressing playNextsong():
20:05:27.724 -> Now playing: /01/001.mp3
20:05:27.724 -> Started playing
20:05:30.230 -> File not found: /01/002.mp3
20:05:30.230 -> Failed to play song 2
20:05:30.279 -> Failed to start playing: /01/003.mp3
20:05:30.461 -> Now playing: /01/003.mp3
20:05:30.461 -> Playing song: 3 of 28
20:05:31.714 -> File not found: /01/003.mp3
20:05:31.714 -> Failed to play song 3
20:05:31.747 -> Failed to start playing: /01/004.mp3
20:05:31.912 -> Now playing: /01/004.mp3
20:05:31.912 -> Playing song: 4 of 28
20:05:33.230 -> Failed to start playing: /01/004.mp3
20:05:33.394 -> Now playing: /01/004.mp3
20:05:33.394 -> Playing song: 4 of 28
20:05:34.482 -> File not found: /01/005.mp3
20:05:34.512 -> Failed to play song 5
20:05:34.512 -> File not found: /01/006.mp3
20:05:34.512 -> Failed to play song 6
20:05:34.512 -> File not found: /01/007.mp3
20:05:34.512 -> Failed to play song 7
20:05:34.512 -> File not found: /01/008.mp3
20:05:34.512 -> Failed to play song 8
20:05:34.512 -> File not found: /01/009.mp3
20:05:34.512 -> Failed to play song 9
20:05:34.512 -> File not found: /01/010.mp3
20:05:34.512 -> Failed to play song 10
20:05:34.546 -> File not found: /01/011.mp3
20:05:34.546 -> Failed to play song 11
20:05:34.546 -> File not found: /01/012.mp3
20:05:34.547 -> Failed to play song 12
20:05:34.547 -> File not found: /01/013.mp3
20:05:34.547 -> Failed to play song 13
20:05:34.579 -> Failed to start playing: /01/014.mp3
20:05:34.745 -> Now playing: /01/014.mp3
20:05:34.745 -> Playing song: 14 of 28
20:05:35.732 -> Now playing: /01/006.mp3
20:05:35.732 -> Playing song: 6 of 28
20:05:36.689 -> Now playing: /01/007.mp3
20:05:36.689 -> Playing song: 7 of 28
20:05:37.610 -> File not found: /01/008.mp3
20:05:37.610 -> Failed to play song 8
The arrows on the NeoPixel / LED strip are going the other way, although hard to tell in video, they should be pointing away from the Data In signal wire.
Try connecting the wires (or at least the data signal wire) to the other end of the LED strip
If this works I’m gonna be upset with myself lol
I am working on a Weather Station project which is (probably) going to use a Feather ESP32-S2 in the final build.
However, I am developing with a Feather ESP32-S2 TFT board, And I would like to be able to display the Weather Data on the TFT.
So, my question is there a way, at compile time, to identify which board has been selected?
Many compilers will set some variables you can check with #ifdef type statements
Is it always the same files that produce "File not found:"?
does the arduino IDE have something like a define that contains the name of the currently selected board ? (like adafruit_feather_esp32s2_tft versus adafruit_feather_esp32s2)
it seems that in adafruit's pins_arduino.h there's things like USB_PID that could be tested for, or do a #ifdef TFT_CS for example, which only the tft feather will have in this case
I think it does
Discussion of this here: https://arduino.stackexchange.com/questions/21137/arduino-how-to-get-the-board-type-in-code. See the later replies especially.
It’s working
I’m so dumb
The arrows on the strip are supposed to face away from the board
We all goof sometimes, I'm glad you got it working!
Hello everyone!
I'm having an issue with my ESP32 S3 Mini when trying to upload code using Arduino IDE. Here's what's happening:
After I upload the code, the upload window in Arduino IDE gets stuck and doesn't finish.
The ESP32 gets disconnected from my PC, and I can't reconnect it unless I hold the BOOT button while plugging it in.
Does anyone know what might be causing this issue? Any help or suggestions would be greatly appreciated!
Thanks in advance!
(i don't view my debug rows on serial monitor)
sounds like possibly some native USB issues
try testing with a basic Blink arduino sketch
it was code problem, becase with simple code it works...
Now I'm trying to use lcd tft 1,28", with stock configuration pin of library Setup200_GC9A01.h then this:
#define TFT_MOSI 15
#define TFT_SCLK 14
#define TFT_CS 5
#define TFT_DC 27
#define TFT_RST 33
#define TFT_BL 22
It works (but I don't view nothing, correclty, because on my super mini esp32 I don't have this pins)
Then I changed this pins with mine:
#define TFT_MOSI 7
#define TFT_SCLK 6
#define TFT_CS 5
#define TFT_DC 4
#define TFT_RST 3
After uploading, I got this error in the serial monitor:
Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x42002c8c PS : 0x00060930 A0 : 0x82002d60 A1 : 0x3fca2c90
A2 : 0x3fc97ab8 A3 : 0x00000000 A4 : 0x0000000c A5 : 0x00000007
A6 : 0x000000ff A7 : 0x60004000 A8 : 0x00000010 A9 : 0x08000000
A10 : 0x3fc97bcc A11 : 0x019bfcc0 A12 : 0x00000001 A13 : 0x00000000
A14 : 0x00000008 A15 : 0x019bfcc0 SAR : 0x00000003 EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000010 LBEG : 0x40056f5c LEND : 0x40056f72 LCOUNT : 0xffffffff
Backtrace: 0x42002c89:0x3fca2c90 0x42002d5d:0x3fca2cc0 0x42002d68:0x3fca2ce0 0x42001d67:0x3fca2d00 0x42007322:0x3fca2d20 0x4037c9fa:0x3fca2d40
Looks like a null pointer reference, but I'm unsure how changing the pins would cause that
Perhaps the initialization fails for some reason, and returns null or something, then later code tries to do something with it?
what do you mean?
this is my simple code, I don't think thath it is code problem:
#include <TFT_eSPI.h>
#include <SPI.h>
TFT_eSPI tft = TFT_eSPI();
void setup() {
Serial.begin(115200);
tft.begin();
tft.setRotation(0);
tft.fillScreen(TFT_BLACK);
tft.setTextColor(TFT_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 10);
tft.print("Hello World!");
}
void loop() {
}
@north stream, I found it by using Visual Micro. The verbose output shows the defines; in this case, ARDUINO_ADAFRUIT_ESP32_S2_TFT
no, it's like random
Try calling stopPlayback() at the top of playSong(). Perhaps there's some conflict about access to the SD card.
Hi to everyone!
I just solved my storeprohibition problem on my ESP32S3.
Same pins and same configuration;
I installed a different version of the board library (ESP32 by Espressif), downgrading from 3.1.1 to 2.0.14.
If I wanted to make the same change in PlatformIO, how can I do it?
I can't find version of esp32 boards
Where would I find how the Arduino libraries map a pin number to a memory address? Basically the hardware layer of the stack.
Want to see if there's a smarter way to map out and call pins than listing all the pin's addresses as per datasheet
(I'm doing this for using my own board but still having access to other arduino libraries and functionality)
The variant.cpp file for a a paritcular board maps the integer pin numbers to an array of struct instances that describe which acual pin is to be used, and what characteristics it has. For instance, https://github.com/arduino/ArduinoCore-samd/blob/master/variants/arduino_zero/variant.cpp
you mentioned "libraries", but it sounds like you are talking about board definitions. If not, could you clarify?
No, you're right. Thanks!
There does seem to be more abstraction to it than I'd expect... Not immediately obvious how it gets from a pin number to a memory address :/
pins don't usually have a simple memory address. Instead there are multiple "registers" in the address space that are not regular memory addresses, but correspond to various aspects of a pin's functionality. Often the pins are represented as a bitmask. For instance, there might be a register to, say turn a pin's internal pull-up on and off. If there are 32 possible pins, then there might such a register, with its bit 0 correspond to pin 0, 1 to 1, etc.
Also pin numberings are not necessarily simple integers. For instance, the SAMD chip pin are grouped into "ports', so there's PA_00, for pin 00 in Port A, PB_05 for pin 05 in Port B, etc.
The Arduino pin numbers don't necessarily correspond to the chip pin numbers at all.
Yea so for the RA4M1 P010 to P015 it's 0x4004083F in increments of 4
And the physical pin numbers counting around the edge of the board or the edge of the chip are yet another scheme.
So the RA divided it up that way, but there are other orthogonal ways of doing it done by other chips
And then for P100 to it's 0x40040843 up to P115
So there's a lot to write out and was hoping maybe there would be some boilerplate for me to hook into or steal
Sounds like in the RA series all the functionality is in those four words for each pin?
I'd suggest you copy from an existing RA chip, like the Arduino 4 or maybe the Giga R1?
Ladyada has used AI code generators to produce boilerplate like this. But she feeds them the datasheets, and she knows when they get it wrong.
Yea that'd maybe be more work than writing out ranges myself 😄
Consider writing, say, a Python program to generate the rough outline and then correct it.
I'm gonna recount my pins and see if I can just mirror the pin usage from the R4 on my own board if I'm being nifty
.. Or I could just go back to an MCP24017 and make my life easier 😄 But then I'd have to spent multiple dollars extra on parts! 😆
The pin definitions is somethigng I triple-check against the schematic when I do a board definition in CircuitPython. In CPy, we describe the pin details (this one can do A/D, this one has no pull-up, etc.) once, in a chip-related pin file. Then for each board, we just refer to that file. In most Arduino board packages, those kinds of pin details are copied over each time, unfortunately.
If this doesn't work, maybe I'll just do an output-pin-array with direct addresses. Not as intricate and flexible but iteratable
iterationable...
I would do it the same way Arduino does, so you can remap pins at will. This is often needed when you change boards because of routing issues, etc. It can be tedious but you only have to do it once. Don't subject your users to being unable to remap pins. The inability of some Arduino BSP's not to remap pins has been a nuisance for us multiple times.
Not sure what that way is..
In variant.cpp it says { BSP_IO_PORT_03_PIN_01, P301 }
Gives the impression that they map a pin name per RA standard to a BSP defined value so there's more remapping, from BSP_IO_PORT_03_PIN_01 (which is 0x0301) to the actual chip specific address for that port's bitmask.
In the other direction, the user won't see P301 but D0 so there's another mapping there.
But if you just mean to list the pins and addresses in a list of #define then yea, you have a good point
It's just me doing this code, but I started with the RA expecting more complex projects down the line, so worth making it easier down the line.
variant.cpp lists all those in a table, in an order indexed by the Arduino pin number. So if say, Arduino pin 5 were BSP_IO_PORT_03_PIN_01, then it would be entry 4 (starting from 0) in that table.
Riiight so the analog pins are just expected to be indexed further in since they also start from 0
Yea I see now
Why they then even bother with the P301 is confusing...
The actual memory addresses are usually taken care of by the low level routines that do pin operations, e.g. there's a routine that, say, sets, a pull-up, and it takes BSP_IO_PORT_03_PIN_01 or P301 or whatever, and then internally converts that to the memory address. But most of the code doesn't need to know the actual memory address at all.
I don't know what P301 is in this case. What is its value?
Are these routines for the limited subset of pins used by arduino or is that something I can tap into for my own convenience?
So P301 is the name of a pin. All pins on the RA are Pxyy where x is port and yy is pin index
usually they are general purpose. Sometimes the Arduino code is talking the registers directly; sometimes it is calling some low-level HAL routines in the SDK provided by the manufacturer. E.g. for RP2040, Raspberry Pi provdies the pico-sdk, which has routines like gpio_set_pulls().
but is there a #define P301 <something>, and if so, what is the <something>?
Aaaah yea found it in an include...
PIN_PWM|CHANNEL_4|PWM_CHANNEL_B|GPT_ODD_CFG,
PIN_INTERRUPT|CHANNEL_6,
SCI_CHANNEL|PIN_RX_MISO_SCL|CHANNEL_2|SCI_EVEN_CFG,
SCI_CHANNEL|PIN_CTS_RTS_SS|CHANNEL_9|SCI_ODD_CFG|LAST_ITEM_GUARD
};
so that describes all its characteristics, like its PWM channel, etc, etc. In some variant.cpps, that's all broken out in the variant table
Riiiight
liked in the SAMD table I pointed you to, an example line is
{ PORTB, 8, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel2, PWM4_CH0, TC4_CH0, EXTERNAL_INT_8 }, // ADC/AIN[2]
But yea, I think I'll just use the overarching array of addresses and can shuffle them around if I need them in a different order
I think you should use the same table structure as the Arduino RA boards; is that what you mean?
Just listing the direct pin mode and value bit addresses in an array, so simpler
then you are doing it in a non-standard way. If you copy how Ardiuno does it, then you can use all the existing structure. Just copy the R4 board, and then shuffle around the table.
I know how to take the address and set the bit, but I don't know how to reuse this table :/
I'd say don't change the standard unless you have a reallly good reason
ok hold on, let's look at their table...
No I mean...
Sorry was trying to paste all the code somehow that wouldn't be a massive block in the channel
is there a reason for arduino ide to not output any serial print in values on the serial monitor
There are several possibilities, such as logic conflict, baud rate mismatch, port allocation problem, synchronization issue, driver problem, different port, etc.
Does anyone know if its possible to have an ATtiny85 to switch back and forth between pretending to be a USB keyboard and passing USB traffic from another device straight through? i want to put one inside a mouse and after it detects that it hasn't moved within a certain amount of time it switches to pretending to be a keyboard and types some stuff out on the computer its connected to.
You don't have to switch back and forth. A single "composite" device can be both a mouse and keyboard.
However, the "passthrough" mode you are talking about requires acting as a USB host, which the ATTiny can't do. Could you explain in more detail your use case?
ok i have the serial monitor working but get nothing but 000 on all axis even in the example scrypt for the TLV493d board which i am using
Does anybody know how to print Chinese characters using adafruit gfx?
Joey C made a fork to support Unicode: https://github.com/joeycastillo/Adafruit-GFX-Library
I did find that, but there seem to be missing dependencies. Specifically, something spiflash_fatfs
I know there are other libs that support Chinese, but I haven’t managed to get their driver to initialize properly.
oh, I just realized that's 6 years old
If you just need a handful of characters, you can map them like any other custom glyphs. If you need a bunch of them, you may run into issues.
I tried the arduino simulator online and its actually quite neat
didnt know I could just do it all virtually first, test it out. Then when you're actually confident transfer that to the real deal
Try wokwi.com too. Allows simulation and debugging and some components too (plus custom chips API)
Is there anyone familiar with the lvgl glue library? I’m trying to use lvgl with an ili9488 driver, but the only driver that works seems to be the one by Jared Burkett, which doesn’t appear to work with lvgl glue(expects spitft)
Alternatively, is there anyone familiar with a way to convert a display driver lib from adafruit_gfx to spitft?
Hey guys, anyone know why my LCD screen looks like this? It's washed out 🫣
my board is an ESP32-WROOM
and im using these pinouts
MOSI->DIN
SCLK->CLK
CS->CS
DC->DC
RST->RST
BL->BL
#define TFT_MOSI 14
#define TFT_SCLK 12
#define TFT_CS 15 // Chip select control pin
#define TFT_DC 2 // Data Command control pin
#define TFT_RST 4 // Reset pin (could connect to RST pin)
#define TFT_BL 13 // LED back-light
only thing i know is that MOSI is the data line
I'm guessing a color mapping or contrast issue
Which one do you mean by spi TFT?
Oh I see, Adafruit gfx
Looks like the advice is to use Bodmer's TFT_eSPI library (similar with the lilygo T-Display S3) https://forum.arduino.cc/t/changes-in-adafruit_ili9341-library-for-ili9488/614186/2
Use Bodmer's TFT_eSPI library. ILI9341 can write to SPI with 5-6-5 16-bit or as 6-6-6 24-bit ILI9488 can only use 24-bit RGB with SPI This means that regular commands are exactly the same. Write GRAM 0x2C and 0x3C commands need to write RGB for ILI9488 Read GRAM is always 24-bit RGB for ILI9341 and ILI9488. ILI9488 has a hardware problem w...
You might need an older or customised version, to match up to lvgl 8.2 which adafruit lvgl glue requires.
I’ve been trying and failing to get tft_espi working with my display. For whatever reason the weird Jared Burkett driver works flawlessly, but nothing else has been able to replicate its success.
Honestly my early attempts were hindered by the fact I was using a samd51, so I’ve since switched to an esp32s3 and am hoping the other options work better…
Got a link to the screen you bought
All I really remember is the tdisplayS3 had it's own changes for the bodmer library, included in the manufacturers board repo, but later the same driver was upstream too.
This Resource Centre provides all the latest manuals, datasheets, tutorials and projects from 4D Systems
I did manage to get it working on an esp32s3, so I think I’m okay for now. Thanks for looking into it @dusk orchid
is there a way to use an sd card (spi) with an esp32 and arduino and be able to use methods like "fopen"
esp-idf does this using mmc i think, but im not very expirienced with esp-idf or using periphirals with it
there is this https://github.com/espressif/arduino-esp32/blob/master/libraries/SD_MMC/README.md but thats for interacting with a specific type of card, not mounting the card
there is also the fatfs library for arduino but i cant find much info about it
Hmmm, I'm using Square line studio to generate everything, also set the pins etc, I just wonder how this is fiixable since I've never seen this happen lol
Hello!
How do I go about using this board: https://www.adafruit.com/product/5165 with a QTPY ESP32-S2 (https://www.adafruit.com/product/5348) ? The example from the library doesn't seem to work.
Thermocouples are very sensitive, requiring a good amplifier with a cold-compensation reference. The Adafruit MCP9601 I2C Thermocouple Breakout (a.k.a MCP96L01) does all that for you and can ...
I figured it out. Instead of:
if ( ! mcp.begin(I2C_ADDRESS) ){
I had to use:
if ( ! mcp.begin(I2C_ADDRESS, &Wire1) ){
Hi, I am trying to use the Arduino IDE to program an Adafruit Feather V2 to read data from an Adafruit SCD41 sensor and send it to a Raspberry Pi via MQTT. However, I am having trouble uploading the file and running it. The compilation process takes forever and never finishes. I'm not sure what’s wrong, as I’m not receiving any errors—it’s just compiling very slowly.
Here is the code I am trying to run. Do you have any suggestions on what I can try?
Hello!
I have some LED projects running with WS2812B strips and they are working superbly with the Neopixel library.
However they are only RGBW and I have to choose which color temperature of white pixel to buy. I'm intrigued by the WS2805 strips with RGBCCT with warm and cool white pixels so you can adjust color temperature. These seem ideal. However while I see that WLED has support as of 0.15.0-b2 for WS2805 I can't find anything that says support is available for Arduino libraries.
Would love to get some advice on where to look for an Arduino LED strip library that has WS2805 support, or news of when (if) that might come to the Neopixel library. And of course if I've completely missed it and it's already implemented somewhere please do steer me in that direction. Thanks!
Im pretty sure that the board is broken as one of the traces on the back is uncovered. When a motor is connected, if there is power in 12v or even 5v logic the motor runs. Removing the enable jumpers or writing LOW LOW on any of the pins does nothing. Is there something common ive missed or is this board just dead?
Looks like a short caused the trace to burn up.
yep so im assuming the motor is now directly connected to any input power
Its an LN298, even with the enable jumper removed (which should completely stop the motor) the motor runs constantly from when power is connected.
Im just checking to make sure that im not going crazy
can try compiling in the commandline, with arduino-cli, or using preferences in arduino-ide select verbose build option. Maybe it'll tell you what's up and why it never finishes.
When I compiled your code on wokwi (online esp32 simulation) it says wifi.init doesn't exist (see here: https://docs.espressif.com/projects/arduino-esp32/en/latest/api/wifi.html#wifista)
https://wokwi.com/projects/421455473960407041
I'm following the instructions on this page:
https://learn.adafruit.com/adafruit-esp32-s3-tft-feather/arduino-blink
I can upload the blink sketch which includes a Serial.println("Hello!"); in the loop()
The LED blinks, but I get nothing on the Serial Monitor - it says: Port monitor error: command 'open' failed: Invalid serial port. Could not connect to COM4 serial port.
However this is the same COM port that was just used successfully to upload the sketch. (Arduino IDE 2.3.4 on Windows10)
It is always the same COM4 port whenever I check it in the Tools PORT menu , uploading uses that port and the Serial Monitor attempts to open that same port.
Any suggestions?
If the USB device re-enumerates, sometimes it will map to a different device name
Open up device manager and keep an eye on the COM port names there.
Only COM4 ever appears in Device manager.
Here's another clue: if I hold the Boot button and press the Reset button, the serial Monitor can connect to COM4 OK. But when I just press Reset - to start a sketch running, Serial Monitor cannot connect to COM4.
post your full sketch
it is the blink sketch from the page in the link above.
Another clue is that I have to hold Boot and press Reset before uploading a sketch works (can connect to COM4)
why is that a clue?
Putting an ESP32 into bootloader mode doesn’t seem weird to me.
or you mean you can connect to it (via serial) while in bootloader mode?
Yes I can only connect to COM4 while in Bootloadwer mode.
Because I think you should be able to Upload a sketch without having to get into the bootloader every time you upload. But there are some confusing instructions regarding the bootloader on the page I linked. The screenshot of the tools menu does not match what is in the current version of Arduino IDE. Butr this is a digression from the issue that I cannot get Serial Monitor to work while a sketch is running.
The mcu needs to be in bootloader mode for the code to upload. Sometimes the Arduino IDE does it for you, sometimes it doesn't work and you have to do it by hand.
I would expect to need to go into bootloader anytime you upload code on a device with native USB.
Also, the COM port will be different between bootloader mode and code running mode, if you want serial while the code runs, you need to choose the new com port.
(ESP32 or otherwise)
OK lets focus on why Serial Monitor cannot connect when running a simple sketch. Only one COM port ever appears in Device Mgr. How do I tell Serial Monitor to look at a different port?
That’s where I am confused.
If you see the COM port in Device Manager, then serial monitor would be able to connect.
and just to verify, you have a ESP32-S3-TFT-Feather?
Yes
Do you have another terminal program like putty or Real Term?
yes putty
Can putty open the port?
No putty cannot open the port either when in Bootloader mode or when a sketch is running.
Sometimes serial just breaks on Windows. Try unplugging it, rebooting, and then plugging into a different USB port.
And make sure it actually reboots, because "fast startup" can screw with things.
Ok thanks for the assistance. I have to quit for the day now. Maybe I'll try using a Linux box or a Mac and see if that makes and difference.
With Linux, you can use udev to assign a fixed device name to a piece of hardware, which is quite handy.
Hello! Not really an arduino question but I’m using the arduino core for nrf52840 and am trying to set up OTA but uploading the zip file doesn’t work and results in an error that I’m not targeting the board type
The solution to my problems uploading to the ESP32-S3-TFT-Feather and then viewing the Serial Monitor is three settings in the Arduino IDE Tools menu:
- USB CDC on Boot: Enabled
- USB Mode: Hardware CDC and JTAG
- Upload mode: UART0 / Hardware CDC
will an Adafruit CLUE board work with a BNO085 sensor board using I2C? Thanks!~
It should be OK, because the CLUE is an nRF52840. BNO085 has troubles with some chip families: https://learn.adafruit.com/i2c-addresses/troublesome-chips
Hey Dan, just got back from the hospital. Caught COVID at the hospital so I just got home from an extended stay, 2 days ago and the BNO085 was waiting for me. I wanted to try it out and the only thing that had I2C ports I wasn’t using was the CLUE so I threw some Arduino code together based on the code on the Adafruit site.
What's strange is Arduino is telling me the port is in use but. the only thing connected is the CLUE and when I do a "board info" from the tools menu It shows the CLUE.
I don't have anything except Arduino IDE running. No terminal or anything else. I'm using the code on the Adafruit learn page for the BNO085. Here's the error:
Sketch uses 58480 bytes (7%) of program storage space. Maximum is 815104 bytes.
Global variables use 9148 bytes (3%) of dynamic memory, leaving 228420 bytes for local variables. Maximum is 237568 bytes.
Upgrading target on /dev/cu.usbmodem101 with DFU package /Users/joebanko/Library/Caches/arduino/sketches/E65B8CDB73A3112F38E04F5EF9E25475/Clue_BNO085.ino.zip. Flow control is disabled, Single bank, Touch disabled
Timed out waiting for acknowledgement from device.
Failed to upgrade target. Error is: Attempting to use a port that is not open
Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
Please upgrade the Bootloader or select correct version in Tools->Bootloader. - Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.
Traceback (most recent call last):
File "main.py", line 296, in serial
File "dfu/dfu.py", line 235, in dfu_send_images
File "dfu/dfu.py", line 203, in _dfu_send_image
File "dfu/dfu_transport_serial.py", line 155, in send_init_packet
File "dfu/dfu_transport_serial.py", line 241, in send_packet
File "serial/serialposix.py", line 615, in write
serial.serialutil.PortNotOpenError: Attempting to use a port that is not open
off to PT. back in a couple of hours...
In the Arduino IDE settings, make sure you have "Show verbose output during" checked for at minimum, "Compile", but perhaps also "Upload". That might help you understand what steps the compile process is going through.
Is there a way to tell what version of ESP-IDF is being used by the ESP32 Board Manager version 3.1.1? I see evidence it's 5.3 in the 3.1.1 tag on Github, but I'd like something more authoritative.
What's more authoritative than the change log on the release?
IDF release/v5.3 by @me-no-dev in https://github.com/espressif/arduino-esp32/pull/10816
Something in the build configuration that tells it to fetch a particular version
Also, what I'm starting from is the version string "3.1.1" in the Arduino IDE.
There's a tag for that in the repo, fine
Now how do I directly find the version, rather than poking through other releases to find something? Ah, found this; https://github.com/espressif/arduino-esp32/releases/tag/3.1.2
The comment in the release note title is helpful, but if that were missing, what might tell me? That's what I mean by authoritative. What the the build system choose, so I don't have to rely on the person who did the release to document it?
I'm suddenly having weird issues with reliably flashing this ESP32-S3 (Adafruit MatrixPortal S3) I have. Whether or not I put it into BOOT mode, I get
Connecting......................................
A fatal error occurred: Failed to connect to ESP32-S3: No serial data received.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
Failed uploading: uploading error: exit status 2
I can usually clear it by manually calling esptool.py erase_flash, but that's a pain because Arduino grabs the port and I have to take annoying steps to make it let go
Oh actually using sudo when erasing it fixes that particular issue, but it's still a pain to just try to interate within the IDE
Make sure you don't also have the port open in a terminal program.
It seems to have settled down. I definitely didn't have any external terminals connected, but maybe the Serial Monitor was interfering. Even that seems okay now.
Check the macro, https://github.com/adafruit/Adafruit_NeoPixel/blob/f01f618b0671fc8a5437eb6e47184bea74f1be60/esp.c#L28
Or if esp header imported then https://github.com/adafruit/Adafruit_Wippersnapper_Arduino/blob/7ab9e78834ce63a446ddfce6c4e63c0c3d82375b/src/provisioning/tinyusb/Wippersnapper_FS.cpp#L311
Has anyone tested the ArduinoBLE library with the ESP32-S3 Feather? I've been working with that library on a couple ESP32 Feather V2 boards, and my project eventually needs USB-HID support. The idea is that an S3 would be a Peripheral-based BLE Transmitter connected to a computer that the other ESP32 boards, as Centrals, would write to.
That works at run time, and I suppose I can grep the sources inside the Arduino libraries for it. What I was hoping for was something in the Arduino BSP repo for ESP32 that indicated which IDF it pulls in (it’s not part of the repo afaict)
Yeah they've been pretty religious about mentioning the IDF version in release title, but also the System PR section of what's changed always links the latest arduino-lib-builder / idf version including components, like https://github.com/espressif/arduino-esp32/pull/10599
Hi, I asked the following question in the hw-design channel a couple of days ago but maybe this one is more appropriate. I greatly appreciate any help and direction.
Due to "circumstances", I need to try using the UPDI/Reset/PA0 pin on the ATtiny816 as an analog input. I believe this is possible using the High Voltage UPDI Friend for programming. Normally, I'd use 'ss.analogRead(PIN_NUMBER)' with the Seesaw library, but is there a 'PIN_NUMBER' for the UPDI pin? Is this possible, even with Seesaw firmware modifications?
did the "circumstances" lead to the UPDI pin being reconfigured? preventing non-HV UPDI programming? the seesaw firmware would generally have nothing to do with HV UPDI programming.
Nope, the ATtiny is still set up for low-voltage programming. I mentioned the HV programmer because the store page says it's needed when using the UPDI pin as reset/GPIO, which is what I'm trying to do. I've followed the instructions to edit boards.txt so the Arduino IDE lets me configure the UPDI pin as such. My issue is figuring out how to reference the UPDI/PA0 pin after I re-upload the Seesaw firmware. I can reference other pins (like PA1 as pin 14, as I tried to mark up in the attached screenshot), but what pin number would PA0 be now? Or, is it possible to modify the ATtiny's Seesaw firmware to let me reference it with a pin number? The reason I'm doing this is because my board only has the UPDI pin exposed, and I now need to read an analog voltage, which it wasn't originally designed to do.
oh. ok. hmm....wonder if thats even possible in seesaw firmware. let me look.
if you're curious, this is the firmware running on the attiny's:
https://github.com/adafruit/Adafruit_seesawPeripheral
and can be easily re-programmed using arduino - it supports updi uploading
it looks like the UPDI pin is added to the invalid pins:
https://github.com/adafruit/Adafruit_seesawPeripheral/blob/7461e5c615d9a89590fe0d13186613b640f418fd/Adafruit_seesawPeripheral.h#L180
PA0 = 0
Yeah I think removing that zero from INVALID_GPIO could work. At first glance I don't see any other blockages. I'd try doing a digitalRead on PA0 with a button to see if that works, then try analogRead
And to answer the other question, from pins_arduino.h in megaTinyCore, looks like PA0 == arduino pin 17 on the ATtiny816 https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/variants/txy6/pins_arduino.h#L161
You can use low voltage programming to set the fuse that changes the function of the reset pin. However, thereafter I think you need to use high programming if you want to program it without the reset pin.
Thank you all immensely! That is exactly what I needed. I will give it a go!
yep, that's my understanding also, even though i've never used HV or re-assigned the UPDI pin
HV helps get you out of the situation where if you do change the UPDI pin, HV is the only way to get back in
Please help, I just got my pico and I'm trying to get it to work with the tutorial but I wired the screen to different SPI pins (I had to, I'm using a plain pico and the tutorial was made for the 2040 feather variation of the pico), but I thought this wouldn't be a problem because according to the documentation, any SPI pins should be able to be configured appropriately, but in the script in the tutorial, it doesn't specify the SPI pins, it seems to rely on some built-in Adafruit configuration.
Please help, how do I convert this tutorial script to work on the plain pico?
The tutorial script: https://learn.adafruit.com/mini-gif-players/coding-the-mini-gif-players
the tutorial is in Arduino script so I was pointed to this channel to ask for help
Does anyone have experience with listening to a J1939 network with a feather CAN M4? I'm using the adafruit library, I am getting some of the broadcast messages from the network but they seem kind of disjointed like I'm not parsing them correctly.
There are 2 hardware SPIs on the pico, defined as SPI0 SPI and SPI1 objects in Arduino https://arduino-pico.readthedocs.io/en/latest/spi.html
See https://pico.pinout.xyz/ which pins can be used for either of the interfaces, and then define them as described in the documentation
Then you should be able to use the SPI object in the display init call https://github.com/adafruit/Adafruit-ST7735-Library/blob/62112b90eddcb2ecc51f474e9fe98b68eb26cb2a/Adafruit_ST7789.cpp#L29
So I would un-comment out one of those variable-declaration blocks... would it be the one under the if !defined(ESP8266) ? on line 27?
And then the first commented line, does it need any changing? I'm not sure if it's asking for something by saying " @brief Instantiate Adafruit ST7789 driver with selectable hardware SPI" I'm not familiar with @brief. And my only other question is would I just say &SPI0 (since I'm using GP20 thru 18 where it says 'pointer to an spi' in the line "@param spiClass Pointer to an SPI device to use (e.g. &SPI1)"
This is Arduino = C/C++ ... # does not mean comment. @brief is just a marker, because the comment is included in the auto-generated documentation for the library
And you don't need to change the library at all, just the call to the display init in the learn guide code
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST); should be Adafruit_ST7789 tft = Adafruit_ST7789(&SPI, TFT_CS, TFT_DC, TFT_RST); and add your pin definitions before.
It might work without changing the call at all, just by selecting the correct pins, since I think SPI is used by default
Edit: the object is SPI, not SPI0.
I was just about to ask what line you were referring to, thank you! I'll give that a try and see if that works, and if it does I'll report back with a thank-you gif 🙂
oh, what's pin_size_t mean? Do I put (GP20 pin) ? What's the code format for the pins?
I think the pin mapping in arduino is just the number, without the GP ... like SPI.setRX(20);
pin_size_t is just the variable type to the function parameter pin
yep, just pass integer pin number
add those SPI.set calls before this line:
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
no need to alter that call. don't need to add the &SPI reference
the library will use SPI by default. and the calls to SPI.set() will set what those pins are
not need for the Feather since it has known specific pins used for SPI
I'm on a plain pico, not feather, but I've made the changes as described:
But when I go to run it it says it's missing the AnimatedGIF.h library.
These are the libraries I got from various tutorials trying to do the same thing:
Is the animatedGIF.h library somewhere else? Where do I find that
the gif code is arduino, not circuitpython
I got these libraries from a handful of tutorials in circuitpython and arduino code so where do I find the libraries this one needs? It doesn't seem to have a link to them on the tutorial page: https://learn.adafruit.com/mini-gif-players/coding-the-mini-gif-players
do you have arduino setup already? and tested uploading a basic sketch to the pico?
hmm I haven't tested a basic sketch from arduino IDE, I just got a test working on circuitpython through Mu.
I installed the arduino IDE, and it recognizes the pico but beyond that, i don't think I've done anything else on the arduino side. Do I need to do anything else to get it going?
that should be enough to try a basic upload
you'll need to install some arduino libraries for the ani gif project
but for now, try just uploading a simple sketch to verify the general arduino setup is working
int count = 0;
void main() {
Serial.begin(115200);
}
void loop() {
Serial.print("count = ");
Serial.println(count++);
delay(1000);
}
upload that, open serial monitor, verify can see the serial prints going by
oops. yah. i typed that in without verifying since i'm not setup right now.
one sec
oh. duh. setup not main. sry.
int count = 0;
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.print("count = ");
Serial.println(count++);
delay(1000);
}
It verified without errors but when I uploaded I saw it pop up a folder then closed it automatically and then the output window showed this:
And I don't see the pico in my folder menu anymore so I can't check if the file was uploaded to it or not
yes here's a screenshot
I just closed Mu (I still had it open) and tried uploading again and got no errors. The output just says this:
Does that mean it's working? It's still not appearing in my folders as an accessible drive any more though
mu was probably interfering with the com port access
so, yah, close mu
there should be more output for an upload
that looks like just a verify
nope, just tried it again, I'm for sure hitting the upload button and it says "Done uploading" in a pop-up in the bottom right (too fast to take a screenshot)
ok. maybe it did. try opening serial monitor.
how do i do that
you don't get a drive when the code is in arduino, so that's fine
looks like it's working there
yep. working.
so basic arduino usage is good
now back to the gif guide...
the mixed use of circuitpython and arduino is potentially confusing
CP is only being used as an easy way to load .gifs onto the pico
since CP firmware presents the pico as a CIRCUITPY folder you can easily drag/drop .gif files onto
but once the .gifs are copied, you switch to arduino
I see, and the gifs remain but inaccessible after that switch to Arduino? I already put a gif while in circuitPy mode
it's accesible to the arduino code
"inaccessible" to your PC - like you won't see a folder or the files anymore
you don't see them
but...yah...what snakey just said
makes sense, so it's there, just I can't touch it after the change to arduino
yep
there's a version of the gif player that shows a drive (but uses CP to format it)
to add more, etc. you'd reload circuitpython to get the CIRCUITPY folder back
ok, so from here, it looks like I just need these libraries. Is there an easy way to get them all at once?
yah, i'm looking at the guide now....
it doesn't provide info on installing the libs it uses
#include <AnimatedGIF.h>
#include <SdFat.h>
#include <Adafruit_SPIFlash.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
exactly, I've been up and down that guide and it doesn't mention the libs
can't install them all at once, but can use the Arduino library manager to install them
how do I do that?
Tools -> Manage Libraries...
SPIFlash will also bring in SdFat library (say "yes" to any "install dependencies?" like questions)
i think if you install those three libraries, that will get what you need
After doing that I clicked Verify and got this error message:
In file included from C:\Users\convo\Documents\Arduino\gettingTheScreenToWork\gettingTheScreenToWork.ino:3:0:
c:\Users\convo\Documents\Arduino\libraries\Adafruit_SPIFlash\src/Adafruit_SPIFlash.h:37:2: error: #error USE_BLOCK_DEVICE_INTERFACE must be defined to 1 in SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
#error USE_BLOCK_DEVICE_INTERFACE must be defined to 1 in SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
^~~~~
In file included from C:\Users\convo\Documents\Arduino\gettingTheScreenToWork\gettingTheScreenToWork.ino:3:0:
c:\Users\convo\Documents\Arduino\libraries\Adafruit_SPIFlash\src/Adafruit_SPIFlash.h:54:2: error: #error FAT12_SUPPORT must be set to 1 in SdFat SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
#error FAT12_SUPPORT must be set to 1 in SdFat SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
^~~~~
exit status 1
Compilation error: exit status 1
ok. one sec. ive got arduino up now. let me check.
im not getting that
double check you sdfat library. make sure its the fork.
both are installed. remove the top one.
Now I'm getting errors from the code we added earlier ([ ](#help-with-arduino message)):
C:\Users\convo\Documents\Arduino\gettingTheScreenToWork\gettingTheScreenToWork.ino:62:1: error: 'SPI' does not name a type
SPI.setSCK(18);
^~~
C:\Users\convo\Documents\Arduino\gettingTheScreenToWork\gettingTheScreenToWork.ino:63:1: error: 'SPI' does not name a type
SPI.setTX(19);
^~~
C:\Users\convo\Documents\Arduino\gettingTheScreenToWork\gettingTheScreenToWork.ino:64:1: error: 'SPI' does not name a type
SPI.setRX(20);
^~~
C:\Users\convo\Documents\Arduino\gettingTheScreenToWork\gettingTheScreenToWork.ino:65:1: error: 'SPI' does not name a type
SPI.setCS(5);
^~~
there's more but it's too long to send on discord
comment out those lines just to verify the original sketch compiles ok
not sure what's happening here
it looks like it doesn't recognize printf but idk if it's supposed to be that way or not
not sure
just checked and the tutorial has it written that way on the site so it's not a copy/paste formatting error
Are you testing on the pico ?
yes
there are
I don't follow, what does that mean?
I don't have that installed but I'm on a plain pico.
When I click that, this is what comes up
type "rp2040" in the filter search
yep, got different core
remove that one. install the last one.
by the last one, you mean the one under it in that screenshot?
yes, the raspberry pi one
aka the "philhower" one
installed that, uninstalled the other one I had, and now when I verify it stops right away and gives this error
may need to reselect board?
did that, re-verifying... it's taking longer so I think we're passed that error which is good
now this error:
In file included from C:\Users\convo\Documents\Arduino\gettingTheScreenToWork\gettingTheScreenToWork.ino:3:
c:\Users\convo\Documents\Arduino\libraries\Adafruit_SPIFlash\src/Adafruit_SPIFlash.h:37:2: error: #error USE_BLOCK_DEVICE_INTERFACE must be defined to 1 in SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
37 | #error USE_BLOCK_DEVICE_INTERFACE must be defined to 1 in SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
| ^~~~~
c:\Users\convo\Documents\Arduino\libraries\Adafruit_SPIFlash\src/Adafruit_SPIFlash.h:54:2: error: #error FAT12_SUPPORT must be set to 1 in SdFat SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
54 | #error FAT12_SUPPORT must be set to 1 in SdFat SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
| ^~~~~
exit status 1
Compilation error: exit status 1
this looks similar to the error from before
didn't this get fixed earlier?
yeah but it's back, oddly. Do I need to reinstall the library?
check if you don't still have both sdfat libraries
huh... 🤔
weird
maybe manually delete it?
not sure whats different with your setup at this point
yea, at this point i'm going with "try turning it off and then back on again"
maybe I should do a reinstall of arduino IDE? I might've said no to the first pop-up asking for permissions because it was unintelligible last night.
just try restarting it first, might have gotten confused over the core change
check manually what is in this folder
c:\Users\convo\Documents\Arduino\libraries\
so close and reopen the program?
like what all folders have "SDfat" in the name?
I'll take a look
no. that looks ok.
dunno
close arduino
delete SdFat_-_Adafruit_Fork folder
run arduino
reinstall
also delete Adafruit_SPIFlash folder
and reinstall
same error with deleting sdfat manually and reinstalling after reopening arduino ide.
I'll try deleting adafruit_spiflash, but I'm wondering if maybe it's hiding on the circuitpython side? maybe a bad version of it was installed on that side and that's why it's still giving errors?
no arduino libraries would be in the circuitpy file system
maybe just delete all those folders and reinstall
just need to install three libraries (scroll back), others will come in as deps
I noticed that with spiflash, it said it needed to install sdfat since it was missing but it wasn't, at that moment I had just reinstalled sdfat and verified it was in the folder, so maybe that's a clue to the issue at hand?
spiflash needs sdfat adafruit fork but it doesn't recognize the sdfat adafruit fork that's installed separately.
and deleting sdfat adafruit fork and just letting spiflash install it along with itself gives the same error
I'll try this, just installing those 3
the spiflash lib has the sdfat ada fork as a dep:
https://github.com/adafruit/Adafruit_SPIFlash/blob/2daa9e83157383bb8f257233d74b8a2bd63968ed/library.properties#L10
right but should it recognize that I already had that or would it still warn me it needs it and ask to install it again, because it did that
still going to delete all the libs and install just those 3 you mentioned
hmm...yah...any pre-existing folder might confuse it
you could also try to delete the project, and just create a new .ino
Still getting this immortal error
In file included from C:\Users\convo\Documents\Arduino\gettingTheScreenToWork\gettingTheScreenToWork.ino:3:
c:\Users\convo\Documents\Arduino\libraries\Adafruit_SPIFlash\src/Adafruit_SPIFlash.h:37:2: error: #error USE_BLOCK_DEVICE_INTERFACE must be defined to 1 in SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
37 | #error USE_BLOCK_DEVICE_INTERFACE must be defined to 1 in SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
| ^~~~~
c:\Users\convo\Documents\Arduino\libraries\Adafruit_SPIFlash\src/Adafruit_SPIFlash.h:54:2: error: #error FAT12_SUPPORT must be set to 1 in SdFat SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
54 | #error FAT12_SUPPORT must be set to 1 in SdFat SdFatConfig.h. Make sure you use the Adafruit Fork at 'https://github.com/adafruit/SdFat'
| ^~~~~
exit status 1
Compilation error: exit status 1
not sure what you mean
the code, it's in a .ino file and sits in the gettingTheScreenToWork folder ?
just delete the whole project and recreate it in the IDE (save your text code changes first)
just looked and yes it is (i'm pretty new to the arduino ide)
so copy/paste the code into a new sketch?
yep
and when you save the new sketch, it will be in a folder with the same name as the sketch, cos that's how the IDE works 🤷♀️
I just verified the code in a new sketch and it still gave the error. I could try saving it if there's a good reason you think that part of the process might fix it
compare your file c:\Users\convo\Documents\Arduino\libraries\SdFat_-_Adafruit_Fork\src\SdFatConfig.h
to the one here:
https://github.com/adafruit/SdFat/blob/master/src/SdFatConfig.h#L37
check line 37
It's set to 1 automatically, like the error says to set it to
no idea
I would look for where another SdFatConfig.h file might be ?
how to do that?
check both boxes there
then recompile
in the output, look for a line like Multiple libraries were found for "SdFat.h"
compiling now...
can also look for line like that
I don't see a Using Library line. Just a lot of compiling libraries with 2 potentially interesting errors:
(the second one came before the first one pictured)
The lines for the libraries themselves are humongous but I don't see multiple sdfats in there.
... can't really tell what is sdfat in there actually. 3rd pic is showing the very end of the lines so you see it's not very obvious what's sdfat since a few mention it near the end but don't end with it
how did this end up with a .cpp extension?
you made a new skech, and then saved it as gettingTheScreenToWork ?
I went back to the original when the new sketch didn't show anything different.
not sure what that means
I went back to the gettingTheScreenToWork sketch instead of saving the new sketch with the copy/pasted code in it because it sounded like the new sketch didn't offer any solution to the problem and that saving it would just be another thing to delete later. If it makes a difference I could make a new sketch again and verify in there but I don't see what difference a new sketch makes, what are we hoping it does?
Because I already made a new sketch and copy/pasted and tested that and got the same error.
try again with a new sketch. i'm not sure what you have for your current sketches.
and the sketch code, for now, should be same as from guide, no changes
we were hoping it would delete all the potential cached data errors ... and it's better if you save it locally first
also, your sketch really should not have the .cpp extension
idk how that happened
I didn't type the .cpp so idk where it came from
arduino will make a foo folder and save it as foo.ino in that folder
foo = sketch name
I copy/pasted straight from the website into a new sketch and verified that and got the same error. Saved as foo and verifying again now.
Same error.
dunno. your arduino setup is in some weird state.
might be easeist to try starting over on a second PC
or trying to start from scratch on that PC
are these libs stored on the pico ever or are they just on the pc? When it compiles and uploads, does it put them on there or does it compile it all together in a file that gets overwritten each time it gets uploaded to?
just pc
ok I'll try this on another pc and see
remember to install the philhower core (not the mbed os one)
and then for the library install, same as was attempted above - those three with others brought in as deps
i don't know what that is, i didn't see "philower" on there but Iremember you mentioned that was what something's sometimes called
ah, ok
looks like the Arduino IDE 2 hides that info
yeah, didn't see it on there
what core version do you have ?
what's shown in screen caps above
hmmm
it's working on yours @leaden walrus ?
yah. i'm not getting the compile error.
but not sure whats different
afaict i'm latest version with everything. BSP and libs.
from my compile output:
Using library AnimatedGIF at version 2.1.1 in folder: /home/user/Arduino/libraries/AnimatedGIF
Using library SdFat - Adafruit Fork at version 2.2.3 in folder: /home/user/Arduino/libraries/SdFat_-_Adafruit_Fork
Using library SPI at version 1.0 in folder: /home/user/.arduino15/packages/rp2040/hardware/rp2040/4.2.0/libraries/SPI
Using library Adafruit SPIFlash at version 5.0.1 in folder: /home/user/Arduino/libraries/Adafruit_SPIFlash
Using library Adafruit GFX Library at version 1.11.11 in folder: /home/user/Arduino/libraries/Adafruit_GFX_Library
Using library Adafruit BusIO at version 1.17.0 in folder: /home/user/Arduino/libraries/Adafruit_BusIO
Using library Wire at version 1.0 in folder: /home/user/.arduino15/packages/rp2040/hardware/rp2040/4.2.0/libraries/Wire
Using library Adafruit ST7735 and ST7789 Library at version 1.11.0 in folder: /home/user/Arduino/libraries/Adafruit_ST7735_and_ST7789_Library
and this seems like some other issue. before it even tries to compile the libs. but could be related.
It looks like you might be on an old core copy, maybe left over and you don't have the board manager urls added?
Earle Core's latest release should be 4.4.3 not 4.2.0.
There was a problem with Adafruit SDFat having conflicting defines for us on wippersnapper with v4.4.2, so we pinned at 4.4.1
My board urls are:
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json,https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json,https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
oh...indeed. let me update that.
We've not retested with latest 4.4.3, still building with 4.4.1
i got the urls in 1.8.19....i haven't started using 2.x yet (it does not have the urls)
was using 2.x to match whats being done here
and didnt consider 2.x not having the bsp urls 😦
The latest v2 allows you to abort compiles, about time one might say...
was wondering why @polar imp changed core, and suddenly crazy error... 4.4.1 builds fine does NOT build fine, but gives different error 😅
@dusk orchid is there an open issue for that?
Does this mean I should reinstall the board? which url would lead to a board that'd make this work, this one here or one found elsewhere
same url
different version
No, I dropped the ball on that one, and was hoping the defines would be resolved in later release of pico earle core. Meant to retest 4.4.3 as they fixed some defines then
ok. i'm getting the error now.
so it's the bsp.
@polar imp try reinstalling the BSP but an older version
uninstall 4.4.3 and you can select from drop down list another version ... 4.4.1 gives
gives... ? so 4.4.1 is the one to use or should it be older?
Fatal Python error: initfsencoding: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007644 (most recent call first):
Multiple libraries were found for "SdFat.h"
Used: C:\Users\\Documents\Arduino\libraries\SdFat_-_Adafruit_Fork
Not used: C:\Users\\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\4.4.1\libraries\ESP8266SdFat
oh, that's not good
gives different errors 😆
so something older then
That's a strange one, python errors usually imply dodgy system setup (python/arduino) or corrupt platform(BSP/arduino-cli)
going back to computer 1. I tried it on 4.3 on a different computer and it seemed to verify without errors. Will try 4.4.1 on main pc since being most up to date is probably best
4.4.0 compiles for me
trying that one then to be safe since you had problems with 4.4.1
4.4.0 gave me the sdfat error on my main pc
going to 4.3 since that worked on my other pc
hmm on main pc getting this error now
..I think I'll go back to the other computer and continue trying to make this work from there since we got at least passed the verification stage on there
double check all the other versions are fully uninstalled ... it takes a while for each to do so 😑
not sure where to see that, in board-manager it just says "install" after uninstalling
if you select different versions from the drop-down, it will say either "install" or "update" if that version is not installed
"remove" if it is
I'll check that out when I'm back on the main computer. Since I got the verification to work of the tutorial script on this pc, I'll just try to get this working on here for now.
Now, when putting back the code modification of specifying the SPIs (Since there's no point uploading to it as-is straight from the tutorial since it won't know the spi connectors, right?) it just gives this error for each of the SPI designation lines:
"error: 'SPI' does not name a type; did you mean 'PI'?
66 | SPI.setSCK(18);
| ^~~"
I had followed the suggestion of using SPI.setSCK(18); etc for each of the pins one after another, put right before the line that goes "Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);"
my info on that was wrong
you most likely need to add an #include <SPI.h> at the start, since it was not needed / used in the guide code
those lines need to be in setup()
before or after begin?
put them there. indented one indent over. compiling...
i'll try adding the include Snakey mentioned if this fails, but I assume that's another library to hunt down?
no, it's included in the core
oh! it compiled without error. the verification worked! so I guess all that's left to do now is upload and see if it works... holds breath
It said it uploaded successfully but the display isn't displaying anything (I know the display works after re-wiring it because I tested it this morning in circuitpython so I know I have the correct pins now and that the screen, at least on the hardware side of this, works).
The animated gif was put on it last night and according to the tutorial i didn't need to specify a file name or path in the code if put at the root when in circuitPy mode (idk what you call it, circuitPython... folder... drive... mode?)
Any way to check that's still there or is there something in the code that makes it so the gif actually does need to be specified?
check the serial console, the code has some prints
holy-! When I opened serial monitor, it popped up on the display! The width and height probably need to be tweaked but it's there and it's animating!
Why didn't that pop up earlier? Will there be any issues using this away from pc on a litho battery?
oh, yea, it was probably waiting for the serial connection, that makes it look like it's frozen
you need to comment out the prints and reupload to run it on battery
and everything about serial
like Serial.begin(115200); while (!Serial);
do you just need to comment out the while ?
Isn't everything a serial or print? the code is largely that.
And there are a few while's.
try with the while first
while (!Serial); waits for the PC serial monitor connection
yea, this one
ok so the one in setup
yea
that's the one blocking the code
it just waits forever for a serial connection
reuploading...
hmm hard to tell if that worked or if it was just playing cuz the serial monitor was still in the ide even if not open at that moment. I closed the monitor and am trying it again
ok awesome! now I just need to tweak either the gif itself or the display size to get the gif to display without cropping, right?
yep!
oh, to make changes to the gif to fix that size issue, how do I access it? I'd need to get back to circuitPy folder-mode right? how do I do that non-destructively?
you just reinstall circuitpython, change the files as wanted
then come back and reupload the arduino code (which is why it's best to save the sketch on the computer, to have the code and settings for next time)
circuitpython and arduino installations do "destroy" each other, but the data on flash should be safe barring any errors
if I could just rotate the gif 90 degrees in this script that might solve the issue too hmmm what would be easiest
sooooo... not sure if i should mention it after all this... but the guide you're following was written before there was .gif support in CircuitPython
you can skip the arduino part these days, and just code it all in python https://learn.adafruit.com/using-animated-gif-files-in-circuitpython
nobody seems to have asked if you were aware of that ... 😅
I...was not
there's a version of the animated gif project that also mounts the drive on USB, I don't know how hard it would be to port to RP2040 (I assume the libraries are port-agnostic) or if it has already been done
https://learn.adafruit.com/pyportal-animated-gif-display
welp... you learned some Arduino today! plus! 🥳
but that used a different microcontroller and display, so would that still be viable?
it needs to be adapted, for sure, but yea, it will work
yeah just setup the display instead of board.DISPLAY
it uses a button too, so you can remove that or change it to a pin on your board
same with this one.
I'll take a look at its guts and see if it'll be relatively painless to switch things for this board but idk, any tips for things to look for to make changing the board type not take hours of trial and error? I know the pins on the pico, but just... the software is something i don't understand
you mean replace board.DISPLAY with display?
oh you mean under width and height put the pixel width/height?
I'm talking about the Circuitpython one, if the board doesn't have a builtin display you have to set it up with the display's driver library
hmm maybe this is related but I don't see any mention of SPI pins here.
https://learn.adafruit.com/using-animated-gif-files-in-circuitpython/feather
no SPI because the display is built in
for the display you have, you need to init by hand and the code should be smth like this https://learn.adafruit.com/adafruit-1-14-240x135-color-tft-breakout/circuitpython-displayio-quickstart
(with your pins defined,like you posted in CircuitPython channel earlier)
oh yeah, I did that tutorial and got it to display. In fact it switched back to that code file when I went back to circuitpython and is displaying "hello world" so do I set the display exactly the same way again as I did there? replace display with the display_bus line?
(convo carried to circuitpython channel: #help-with-circuitpython message)
Does anyone good c or c++ pfc RFID lib exist that doesn't get stuck
I think I found one actually nvm
I'm trying to make my ESP32-S3 Reverse TFT Feather into a character LCD simulator using LVGL (and UnifontEX as the font. I chose the S3 so I could have the 2MiB of RAM that the font needs), but I installed CircuitPython trying to go for the Weather Station example to work from and can't reset the board
I last worked with Arduino IDE in 2014
(Also funny seeing you here but that's besides the point)
Also the factory reset firmware doesn't work
what do you mean you can't reset the board ?
if you have trouble getting into UF2 bootloader mode with double pressing reset, you can press reset, then D0 (which is the boot button) when the LED is purple
I can get to that mode, but the factory reset uf2 never works
what do you mean by "never works"? The factory reset UF2 is a test program. Is it not displaying anything?
I loaded the factory-reset UF2 and got the above.
Make sure your board is a REVERSE TFT S3 and not the regular one, or an S2.
It's the right board but it doesn't display anything
It almost seems stuck in bootloader mode
Unfortunately I'm at uni right now and can't do further tests until I get home in several hours
np, ttyl
Got a weird issue here that I could really use help decyphering. I'm trying to use the multi-core support within arduino-pico (https://arduino-pico.readthedocs.io/en/latest/multicore.html#communicating-between-cores), but I'm getting consistently unexpected values when popping from the fifo. Thought it may be some sort of bit shift/flip, but that doesn't seem to line up. Any idea why this would be happening?
core1:
rp2040.fifo.push(3000);
// 00000000 00000000 00001011 10111000
core0:
rp2040.fifo.pop() == 3758157184
// 11100000 00000000 11101101 10000000
(all variables I'm using in this process are uint32__t)
It must be something in the rest of my code. The following test works:
void setup() {
Serial.begin(115200);
while (!rp2040.fifo.available()) { }
uint32_t value = rp2040.fifo.pop();
Serial.print("Received = ");
Serial.println(value);
}
void setup1() {
delay(1000);
uint32_t value = 3000;
Serial.print("Sent = ");
Serial.println(value);
rp2040.fifo.push(value);
}
void loop() { }
void loop1() { }
// Result:
// Sent = 3000
// Received = 3000
Sorry 🤷
https://github.com/elechouse/PN532?tab=readme-ov-file#readme
how would one use this library? doesn't seem to have example code i can test before going
ion know want my buggy graphics library for the esp32 (compatable with all arduno's taht support ug8lib really)
it doesn't work tho lol
it's busted
i think
whatever
Nvm I can work this out tomorrow
Two things I can think of:
- is the fifo system guaranteed to be working within setup()/setup1() or only after?
- have you tried sending repeatedly? Maybe the fifo needs to be “cleared” on startup, like sending eight zeros
In my application, this is all running during loop/loop1. I'm pushing a true during setup1 to indicate that it's ready at the very beginning. I think that may be causing some sort of offset.
Turns out that my handshake at the beginning was triggering this problem in some way. I determined it wasn't really necessary for my application, so I've removed it, and everything works as intended. Thanks for looking into it!
hi, i recently flash circuitpython on my nano esp32 but i wanna go back to previous firmware is there any way to do it?
Just flash it again with the new firmware - To enter bootloader-mode, press the reset button, and then press it again once you see the RGB LED flashing. You'll know that you've successfully entered bootloader-mode if you see the green LED pulsing slowly. from https://docs.arduino.cc/tutorials/nano-esp32/cheat-sheet/
Hello, Has anyone tried to make the adafruit mini gif player from YouTube?
I have the code, it’s on their page and GitHub, you only have to download the libraries but it gives me an comp error, I think it is bc one drive
It uses circuit python for the gifs, sorry I’m new at this
with the error your posted in the other channel, I believe the issue is the same as what was talked in that discussion: #help-with-arduino message (pointing to the end)
That was messy....
there's like 2 issues I believe ? one is to make sure you have the adafruit version of the SDFat library, the other being that the RP2040 earphilower board support package needs to be set to 4.4.1 because .2 and .3 have an issue with those defines
that's my take from it, I might have it wrong
and pointing at the initial error, which is the same as yours #help-with-arduino message
Sorry for the dm, I didn’t see your bio
that's fine
https://support.arduino.cc/hc/en-us/articles/9810414060188-Reset-the-Arduino-bootloader-on-the-Nano-ESP32 that's the solution btw, remember this in case someone has the same issue
I have a question... on the can m4 with the single on board neopixel, if I'm listening to a can network at 250k and I set the neopixel color before I process the message and again after I process the message how much time am I adding? Is it enough to potentially miss a message?
At 250k? It seems like it to me. The NeoPixels use a serial protocol too, 800k or so, and have to send at least 32 bits (maybe more?) even for a single NeoPixel. You might be better off with a separate direct drive LED or DotStar style one, which supports a much faster protocol.
800k, 32 bit frames last I looked at a datasheet with the RGB LED protocol laid out. 8 bits of global control, 24 bits of color control. Weee
how do i fix my neopixels turning on with specific colors when my esp32-wrover-b starts up? im using ws2812 rgb leds with the type being NEO_GRB + NEO_KHZ800.
i can change the pixels just fine after the device started up, but everytime it starts up it turns on with specific colors, and i cant seem to stop it with clear(); or setPixelColor(0..2, 0, 0, 0, 0); then show();.
i also tried waiting for canShow() to be true before calling show();, but that didnt work
the only hacky solution that sort of works is that i need to call clear(); show(); 2 times, but i can see the light turn on for a split second when the device starts.
pixels = Adafruit_NeoPixel(LED_COUNT /* 3 */, LED_PIN /* 13 */, NEO_GRB + NEO_KHZ800);
pixels.begin();
for (int i = 0; i < 2; ++i) {
pixels.clear();
while (!pixels.canShow);
pixels.show();
}
Have you tried an I2C scan?
It doesn't look like the headers are soldered. You won't get good connections without soldered headers
yes : I2C-apparaat gevonden op adres 0x74!
I2C-apparaat gevonden op adres 0x75!
I2C-apparaat gevonden op adres 0x76!
I2C-apparaat gevonden op adres 0x77!
I2C-apparaat gevonden op adres 0x78!
I2C-apparaat gevonden op adres 0x79!
I2C-apparaat gevonden op adres 0x7A!
I2C-apparaat gevonden op adres 0x7B!
I2C-apparaat gevonden op adres 0x7C!
I2C-apparaat gevonden op adres 0x7D!
I2C-apparaat gevonden op adres 0x7E!
I2C-scan voltooid.
thx. but this also means that I can't remove them from the breadboard anymore?
so I have to do this for the feather m0 and the bno055
you solder the headers to the boards. You can plug them in and out of the breadboards. See https://learn.adafruit.com/adafruit-guide-excellent-soldering, the specific page I linked above, and also https://learn.adafruit.com/how-to-solder-headers
yes. There are also specific directions in the Learn Guide for each part about soldering the headers.
If you have not done soldering before, take it slowly. Use good electronics solder, not plumbing solder, a good iron, and don't use acid flux if you use flux
we do sell some boards with pre-soldered headers, AND, on many newer boards, you can use STEMMA/QT cables between the microcontroller board and the I2C boards, for a no-solder experience. But the older boards were designed before then.
the STEMMA/QT sockets are the things on each end of the BNO055
I have them
But like this and can't connect on the feather
another note: BNOxxx boards don't work well with Espressif and some other boards. See https://learn.adafruit.com/i2c-addresses/troublesome-chips
newer boards like this come with STEMMA/QT: https://www.adafruit.com/product/4884
Also there are jumpers like this: https://www.adafruit.com/product/4209
so at least you don't have to use solder on both ends
Buying this will be the easiest fix maybe?
buying which?
yah sure, if you want that form factor and the battery connector/charger circuitry
Yeah. I chose feather m0 because for this data storage and battery feature
also there smaller ones like https://www.adafruit.com/product/4900
What a cutie pie! Or is it... a QT Py? This diminutive dev board comes with one of our new favorite chip, the RP2040. It's been made famous in the new Raspberry Pi Pico and our ...
so this one if you want an SD card socket: https://www.adafruit.com/product/5980
note for Arduino the best is the philhower Arduino core
This looks exactly what I need
When was this released?
Alsof cheaper than feather m0 😭
Huh. Where is this used for? No clue
It's the "Board Support Package" you would download into the Arduino IDE to use RP2040 boards
also you can use CircuitPython to program these boards
And is there a better motion sensor on the market? Now I have the BNO055
that's fine to use for now
https://learn.adafruit.com/adafruit-feather-rp2040-adalogger/arduino and the whole guide will get you started
Thx for the help!
Is this the best on the market right now? @stable forge . Because there is also 085 which is cheaper and newer
Hey, so after updating the adafruit GFX library after calling the drawRGBbitmap method the program crashes. The error i get is the following
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x4203ebf4 PS : 0x00060530 A0 : 0x82009274 A1 : 0x3fca5580
A2 : 0x00000010 A3 : 0x00000000 A4 : 0x000003c0 A5 : 0x0000000f
A6 : 0x00000000 A7 : 0x00000040 A8 : 0x60024000 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x00000000 A12 : 0x000000f0 A13 : 0x00000010
A14 : 0x00000040 A15 : 0x00000000 SAR : 0x0000000e EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x40056f08 LEND : 0x40056f12 LCOUNT : 0x00000000
Backtrace: 0x4203ebf1:0x3fca5580 0x42009271:0x3fca55b0 0x4200a0dd:0x3fca55d0 0x4200a20d:0x3fca55f0 0x420062cc:0x3fca5640 0x42011c1a:0x3fca56a0 0x4037d546:0x3fca56c0
Before updating the library the method worked fine, and i call it as follows:
tft.drawRGBBitmap(0,0, canvas.getBuffer() , 480, 320)
Any help is appreciated. The screen im using is the adafruit 3.5'' TFT screen
We have a bunch: https://www.adafruit.com/search?q=9-dof. I don't know which is "best". I'd suggest reading the product pages and the Learn Guides for each one carefully to make sure they have the specs you want.
I'll also remind you about https://learn.adafruit.com/i2c-addresses/troublesome-chips. If you eventually want to use, say a WiFi board, then some chips don't work well or at all.
i need help with feather rp2040 with usb host a on arduino when i upload a sketch for exemple a blink test the usb host a get disabled unless i factory reset it i need help
If you’re talking about a sketch like a basic blink that doesn’t include any code for the USB host, that’s the expected behavior.
The USB type A port is just connected to GPIO pins; you have to have code that uses the RP2040’s PIO capability to emulate a USB host device on those pins.
can anyone help me?
need to share full code being run. if its from some larger projects, then a short example code to demonstrate the issue.
i did show an example code though didnt i?
it's in the message that i replied to, it's exactly the same code that my project uses
you say they start with specific colors, is it before your code runs or even with code that doesn't use the LEDs ? Some sort of interference ?
if i don't initialize the neopixels, the lights just stay off as intended, but when I initialize it, they start with random but specific colors (same colors every time it runs, but unknown why these colors are shown). my other code cant be interfering with it, cause when i set the type to NEO_RGB, the lights do stay off on start and they do turn on when i tell it to, but the colors are not right.
so if you just do pixels.begin(); it does that ?
I developed a HID mouse logger that directly forwards mouse reports from a USB host to a connected PC with minimal latency and fast response time but i cant get the scroll up and down working any contributors from main adafruit?
the serial prints.
tested on rp2040 with usb host.
hi can someone help me with my sensor. It seems like it can detect invalid temperature
this was also the image generated by the sensor
hello, can anyone help me?
Could be a communication problem
how could i possibly resolve this problem
cause I thought it is caused by the pins that I solder
I really don't have enough information to say. It could be a soldering/wiring problem, it could be a power supply issue, or interference, or something in one of the code libraries. My usual approach is to divide the problem into smaller pieces and get them to work individually.
well I definitely used my esp32 power supply and it is connected properly, so I guess it's not it.
I'm not sure if I solder it properly. Is this okay?
I'm not sure if I accidentally make a mistake
are you reffering to the microcontroller I used?
I use ESP32 the generic one
I run it in with command prompt
the command prompt is where? that doesn't seem to be on the ESP32 itself.
your setup is confusing. need more info.
I used thonny ide for running the esp32, adafruit mlx90640, my sim800l module and relay module. For the alphaa.py, I used command prompt to run the code so I can view the thermal image from the sensor through using my pc
whats running on the ESP32?
wait I think it's beyond my knowledge, what do you mean by that?
some form of software must be running on the ESP32 to interface with the MLX
and you would have loaded that program onto the ESP32 at some point
are you using arduino? or circuitpython? or something else?
I program my esp32 with micropython
is arduino being used at all?
wdym by that?
well. that's probably a no. if you were using arduino, you would have installed the arduino ide and other stuff.
asking since we are currently in an arduino channel
let's move this conversation to #help-with-projects (since you using micropython and not circuitpython)
A while ago I told you about an ESP32-2424S012 watch
It keeps giving me errors because I spent several days trying to put an image or something similar and I wasn't able to, I was only able to print a Hello world and that's something that's fine, but I want to do more things
yes
also sorry for the late reply
if anyone have a solution to read mouse scroll wheel up down for rp2040 with usb host post it.
What fields are in the mouse report frame?
A standard USB mouse report frame usually contains the following fields:
Button states
X-axis movement
Y-axis movement
Wheel movement (scroll wheel) but cant get it working
here is hid mouse log no filter that retrive and send mouse data to computer, scroll up and down not working
So what happens? Are the wheel values set in the frame?
cant extract the values its been 1 day its the the default hid mouse log exemple. added prints the x y and scroll click worked but no scroll up and down...
Hmm, so it may be a mouse problem, not a decoding problem
i tested with 5 diffrent mouse including dell old mouses
does the mouse wheel work when plugged directly into the host?
it might depend on whether the USB host mode on the RP2040 is putting it in boot mode
its not about boot mode. the mouse moves all perfect even scroll click except scroll up and down.
i dunno
so HID reports theoretically have to be interpreted according to what the device reports as its report descriptor, unless it’s in boot mode. i wouldn’t be surprised if a host mode report descriptor parser had some quirks
The report descriptor parser has quirks, like not properly reporting scroll up/down events even though the data updates.
try to test it and if you find a solution let me know.
To test it, I'd need a Pico, a USB mouse with a scroll wheel, a USB wiring adaptor, and some time and energy. I lack at least one of these.
sorry, probably won’t get to it for a while. i lack the relevant hardware. i could probably find such bugs by inspection if i had additional reasons to be looking at that code
That boot comment may be relevant: it could be the mouse needs to be sent some sort of configuration command to enable scroll wheel reporting
uh i thought you had an Adafruit RP2040 with USB host to test it.
Any chance someone here has has success making an esp32-s3 a composite hid device with CDC communications? I have only been able to get one or the other working not both together through the same port
CDC uses two of the four pairs, each composite HID uses one pair. Perhaps something else is configured, or present by default and needs to be explicitly disabled?
who made adafruit tinyusb library?
im willing to pay just to retrive scroll up and down from a mouse i need help for https://www.adafruit.com/product/5723
the probleme persist with adafruit tiny usb it doesnt send the full correct mouse data of scroll wheel
Hey, i'm trying to create a GFXcanvas16 object on My arduino code globally (outside of setup) but i get a null pointer when i try to access it during the setup section. Do i need to do something else to access it on setup?
can't say without seeing the code, and having details about the hardware you're using
Im using the UM FEATHERS3 micro controller with Adafruit TFT 3.5'' screen (HX8357 library). Need a bit to send the code that is using the canvas class
If I am trying to power my ESP32 from a battery (3.6v or 7.4v). I have both buck and boost for whatever battery I use. What is the general concensus for which power bus I should inject the power into? On arduinos it had a default VIN, but esp doesn't. Is it best practice to regulate my voltage to 5v and go on the 5v bus, or 3.3v and inject on the 3.3v? Also what are the specs on regulation for each system and is more robust in terms of spikes or fluctuation?
This talks about CircuitPython, but the discussion about the limited number of endpoints on Espressif chips may be helpful: https://learn.adafruit.com/customizing-usb-devices-in-circuitpython/how-many-usb-devices-can-i-have#hardware-limitations-3096627
This would depend on the voltage regulators used, including the one on the esp32 board itself. Unfortunately, different boards use different regulators, so without more details there isn’t a way for us to answer that with any confidence.
ESP32-E devkitC
Official model
The one on the buck or boost I'll say is inevitable because you need to regulate somehow.
Assuming you're talking about ESP32-DevKitC for ESP32-WROOM-32E, I don't think it is. Truthfully, it might get a little hotter, but it looks like you can connect up to 12V to the 5V pin and it will still provide the ESP32 with 3.3V.
The devkit doesn't need 5V, that's just what it typically gets from the USB port. The port is diode protected, so there's little risk of backpowering, and the only place the 5V goes to after the diode is that pin and the AMS1117-3.3.
Oh, and an LED, which could be a problem for 12V....
Looks like the current limiter is 2k, so even with 8.4V into the 5V pin, you get (8.4-2)/2000 = 3.2 mA? Doesn't seem to be a problem.
I'd generally use the more efficient regulator to 5V, and connect that to the 5V pin, but honestly the 7.4 may very well just work directly as well.
I'm still guessing some sort of configuration has to be sent to the mouse to enable sending scroll wheel data
from the quick tests I did, it seems like the mouse presents a different descriptor when connected to my computer and connected to a (Circuitpython) USB host microcontroller. That might be also something like boot mode 🤷
Any advice on a decently accurate and efficient FFT library for Arduino? I'm working with rp2040/2350 using arduino-pico, and I'm currently working with ArduinoFFT, but I'm aware of Adafruit_ZeroFFT. Is ZeroFFT completely M0+ specific? I tried installing the library from the library manager, but it required a lot of dependencies that I'm not interested in.
My current goal is root frequency detection, btw.
Depending on what you want to detect, something like the Goertzel algorithm might be suitable. https://github.com/jacobrosenthal/Goertzel
I think that's a really good starting point. I'm not a fan of how it has the analogRead built in rather than just providing it with samples directly, but the algorithm seems simple enough to implement without the need of the library. Thanks, I'll give it a shot!
Hi All,
I have a matrix portal s3 I'm using to run 2 32 LED matrices. I'm seeing some weird behavior in arduino IDE. It will start on one COM port, I will be able to upload, then it will switch to another COM port after the upload and I'm unable to upload.
On win11 x64
IDE 2.3.4
Assume I've tried everything but a factory reset/firmware update because I can't get webserial to connect. Happy to share all the troubleshooting I've done so far, it's just a long list
I've been reading up more on this algorithm, and I think I better understand its purposes. I don't actually think it will work for me, because I am looking to identify a tone with an unknown frequency rather than a pre-determined one. However, if the algorithm could be modified to be sensitive to the octaves of a base frequency as well, then I could potentially find a use for it. Ie: a tone at 220, 440, 880, etc would all produce a similar magnitude if the base frequency is 110.
There are always 2 com ports, one for code loading mode, and one for code running. Usually arduino IDE can swap between modes automatically, but sometimes it doesn't work -- and there seems to be more issues with esp32-s3 in particular
That makes sense, if you're looking for an unknown frequency, another algorithm might make more sense.
thanks for this! It looks like this may be the fix for the time being,
I ended up figuring out how to get the ArduinoFFT library working, and I'm happy enough with the result so far. Thank you for making me aware of the other algorithm! Was definitely an interesting deep dive.
In an effort to debug some issues on my MatrixPortal S3, I'm trying to run my code on different boards, including the ESP32-C6 DevKitC1. Unfortunately, when I select that board in the Arduino IDE, it fails to compile:
In file included from /Users/rmann/Library/Arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.4-bcb3c32d-v1/esp32c6/include/esp_system/include/esp_task.h:24,
from /Users/rmann/Library/Arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.4-bcb3c32d-v1/esp32c6/include/lwip/port/include/lwipopts.h:20,
from /Users/rmann/Library/Arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.4-bcb3c32d-v1/esp32c6/include/lwip/lwip/src/include/lwip/opt.h:51,
from /Users/rmann/Library/Arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.4-bcb3c32d-v1/esp32c6/include/lwip/lwip/src/include/lwip/ip_addr.h:40,
from /Users/rmann/Library/Arduino15/packages/esp32/hardware/esp32/3.2.0-RC1/cores/esp32/IPAddress.h:25,
from /Users/rmann/Documents/Arduino/libraries/Async_TCP/src/AsyncTCP.h:10,
from /Users/rmann/Documents/Arduino/libraries/RESTServer/src/ESPAsyncWebSocketClient.h:10,
from /Users/rmann/Documents/Arduino/libraries/RESTServer/src/ESPAsyncWebSocketClient.cpp:3:
/Users/rmann/Library/Arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.4-bcb3c32d-v1/esp32c6/include/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h:139:6: error: #error Missing definition: configNUMBER_OF_CORES must be defined in FreeRTOSConfig.h
139 | #error Missing definition: configNUMBER_OF_CORES must be defined in FreeRTOSConfig.h
| ^~~~~
/Users/rmann/Library/Arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.4-bcb3c32d-v1/esp32c6/include/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h:153:6: error: #error configNUMBER_OF_CORES must be defined to either 1 or > 1.
153 | #error configNUMBER_OF_CORES must be defined to either 1 or > 1.
| ^~~~~
That's defined in Arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.4-bcb3c32d-v1/esp32c6/include/freertos/config/include/freertos/FreeRTOSConfig.h:98, which depends on CONFIG_FREERTOS_NUMBER_OF_CORES, which is defined in Arduino15/packages/esp32/tools/esp32-arduino-libs/idf-release_v5.4-bcb3c32d-v1/esp32c6/qio_qspi/include/sdkconfig.h:911.
I've spent a couple of hours trying to track down why this error ocurs; it's baffling. FreeRTOS.h include FreeRTOSConfig.h includes sdkconfig.h, and I don't see any conditional compilation statements. I wrote a dead-simple file test.cpp that only has #include "freertos/FreeRTOS.h", and put some #error statements in various places in the code, like before and after the #include "FreeRTOSConfig.h" statement. The #error directives next to the include generate output, but not the ones inside the included file. wut.
I think I've figured it out. For some reason, the Arduino IDE is adding an include path to the SAMD21 version of FreeRTOS.
I think having the slightly broken FreeRTOS installation was avoiding another problem, as now I'm running into an IDF run-time error with code that was working fine before. A while back I added PDM input support on ESP32-S3 to CircuitPython, but then had to switch my project to Arduino because of performance issues. I implemented a new PDM input library based on what I learned doing the CP implementation, and it was working great. Then I cleaned up my Arduino installation (last few messages), and now all of a sudden I get run-time errors in my ESP-IDF PDM setup calls:
22:21:46.702 -> E (2938) gdma: gdma_register_rx_event_callbacks(513): user context not in internal RAM
22:21:46.702 -> E (2939) i2s_common: i2s_init_dma_intr(809): Register rx callback failed
22:21:46.702 -> E (2939) i2s_pdm: i2s_channel_init_pdm_rx_mode(485): initialize dma interrupt failed
22:21:46.702 -> i2s_channel_init_pdm_rx_mode() failed with 258: ESP_ERR_INVALID_ARG
This is happening in the i2s_channel_init_pdm_rx_mode() call (code here), which is internally setting up some DMA callbacks (this is before my own call to the queue overflow callback). I can't figure out how to get it to put things in the right RAM.
Any ideas?
Anyone have LVGL insight? I have an issue with my Arduino code with LVGL 8.3 libraries. https://forum.lvgl.io/t/objects-was-not-declared-in-this-scope-error-esp32s3-arduino-ide-lvgl-8-3-eez-studio-0-15-1/20480
Hey guys, David here. I’ve been having some trouble with getting LVGL to display png images from an SD card. When trying to do so, I ended up with an unexpected error that I haven’t seen documented much. I put “lv_img_set_src(objects.at1010, “A:test8bit.png”);” in my void setup(), and I get a not in scope error and I don’t quite understand why. ...
help mouse scroll up and down not working using hid_mouse_tremor_filter.ino exemple of Adafruit_TinyUSB_Arduino
Try this, it works for me, it's a modified version (lines 119-124 plus include on line 33) of the HID Device Report example in the parent folder where your tremor one came from (link in file comment). examples/DualRole/HID/hid_device_report/hid_device_report.ino Running on Adafruit RP2040 Feather with USB Host, I'm using a logitech M150 mouse, and I see the W value change when scrolled.
https://gist.github.com/tyeth/8f1ad51c3616e7e22a91d4596a897cfe
I had to install pio-usb library (https://github.com/sekigon-gonnoc/Pico-PIO-USB), or an error about missing pio_usb.h, but presumably you may already have done so.
Also I'm on latest for everything, i.e. 4.5.0 of Earle Philhower arduino core for rp2040, and v3.4.3 of Adafruit TinyUSB Arduino.
everything works except scroll up and down i try it with lenovo m300s and dell school mouse ms116
Ah what a shame, there may be issues with some types of (composite?) devices etc. Can't offer much more advice I'm afraid.
I half read about a boot version for HID devices, like a boot mouse mode and keyboard mode for when your pc is starting up (like for BIOS setup screens), maybe it mentioned it in the tremor one or another example.
You also might not see the wheel and x/y change at same time necessarily so check the logs carefully (or avoid moving the mouse in x/y)
i checked all working and the scroll shows 0 always
i tried also in diffrent computer and it does not work
You could change the code to print something if the new_report.w is not equal to zero
Might be worth trying a different style of mouse, if they were still easily around I'd say buy a logitech M150 mouse (wireless with dongle), and test it. You might be able to find the difference, or at least have a project working with one mouse.
Otherwise you need to get into more complexity (what and how I don't know), which is unlikely to be done for you already.
mouse 2 dell cheap mouse used in schools ms116
Can't offer anything else sadly...The only other interesting thing was my mouse appears to connect/mount twice, and I did hear some devices connect first as one type then if not interacted with by host within set period they reconnect as second style of same device.
You might be able to go deep down the rabbit hole and see about such things
Curious, and you've updated the libraries and arduino core to latest?
Maybe some remapper or something like that could better show what your devices are doing. Todbot linked you to a good one worth playing with: https://github.com/jfedor2/hid-remapper
yes i updated it to lastest, i guess it only works on 1 out of 50 mices
yes it works with hid remapper
ok great!
but its just .uf2
now you can look at the code there on github and explore how it does the recognition, or ask in that repository maybe (but you will need to eventually get your hands dirty and understand if you then want to fix it for tinyusb or circuitpython)
it's not just a uf2. Looking in the firmware folder there is a src folder there, and it looks like it's a cmake/pico-sdk project. If you want to build the software there was mention in the readme of how.
great remapper_feather.uf2 works perfectly
can you link me the c++ code
ok i guess i need to port that code to arduino and see if it works
i made an entire project for mouse and still cant find the solution for it the root cause seems to be the reported data i think its filtered.
hi, ive been trying to display text on 2 8*16 matrix displays but it always appears jumbled up
not sure why, data in is going to data out
im using an arduino mega
im also new to this so help would be appreciated
Can you share your code and a picture of the back of the matrices?
#include <Wire.h>
#include <RTClib.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_GFX.h>
#define LED_PIN 53
#define MATRIX_WIDTH 32 // 2 matrices side by side (16 + 16)
#define MATRIX_HEIGHT 8 // height is 8 for both matrices
RTC_DS3231 rtc; // Initialize the RTC module
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(MATRIX_WIDTH, MATRIX_HEIGHT, LED_PIN, NEO_GRB + NEO_KHZ800);
int countdownMinutes = 10; // Set the countdown minutes
int countdownSeconds = 0; // Set the countdown seconds
void setup() {
matrix.begin();
matrix.setBrightness(10); // Adjust brightness for visibility
matrix.clear();
// Initialize RTC
if (!rtc.begin()) {
matrix.fillScreen(matrix.Color(255, 0, 0)); // Red if RTC is not connected
matrix.show();
while (1);
}
if (rtc.lostPower()) {
rtc.adjust(DateTime(F(DATE), F(TIME))); // Set the RTC to the time the code was compiled
}
matrix.setTextWrap(false); // Disable text wrapping
matrix.setTextColor(matrix.Color(255, 255, 255)); // Set text color to white
}
void loop() {
// Check if the countdown is over
if (countdownMinutes == 0 && countdownSeconds == 0) {
matrix.fillScreen(matrix.Color(255, 0, 0)); // Red screen for "TIME'S UP!"
matrix.setCursor(0, 0);
matrix.print("TIME'S UP!");
matrix.show();
delay(2000); // Display for 2 seconds
return; // Stop the countdown
}
// Format the countdown time as mm:ss
String countdownString = String(countdownMinutes) + ":" + String(countdownSeconds);
matrix.fillScreen(0); // Clear the matrix
matrix.setCursor(0, 0); // Set cursor to top-left corner
matrix.print(countdownString); // Display the countdown
matrix.show(); // Update the matrix display
// Decrease the countdown time by 1 second
delay(1000); // Wait for 1 second
// Update the seconds
if (countdownSeconds > 0) {
countdownSeconds--;
} else {
if (countdownMinutes > 0) {
countdownMinutes--;
countdownSeconds = 10; // Reset seconds to 59
}
}
}
one thing I found odd is that the data out pins on one of the displays didn't work
don't know if that's of any help
have you tried a basic test just to verify the panels are nominally working? like the strandtest example:
https://github.com/adafruit/Adafruit_NeoPixel/blob/master/examples/strandtest/strandtest.ino
set LED_COUNT to 128 and verify the first panel lights up entirely
yes, both panels light up entirely ive checked them both
patterns run perfectly its just when i try to display time
is there info available on the panels?
it scrambles it up
such as?
product page? schematic?
they're custom made
by my lab ta
dont have a schematic but i do know what each pin represents
the led mapping is important for when you want to display characters
not just the end pins
ah i see
"progressive" vs "zigzag" layout using the terms from that guide
yeah ive come across those terms before
would i need the schematics or could i just test it using code?
you could test with code
could loop lighting up one LED at a time and watch progression
or light up some specific indexes
like 0 and 8
do i test just the one matrix or both matrix
just work with a single panel for now
looks like there's an option flag to use for that:
https://github.com/adafruit/Adafruit_NeoMatrix/blob/7b612d10d3101db91ab66df1b14ab9d8ff9fd562/Adafruit_NeoMatrix.h#L62
would i define that flag in this code then?
nope, just use it
idea is you logically OR the various options to describe the physical layout of your specific panel
like shown in the guide:
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(5, 8, 6,
NEO_MATRIX_TOP + NEO_MATRIX_RIGHT +
NEO_MATRIX_COLUMNS + NEO_MATRIX_PROGRESSIVE,
NEO_GRB + NEO_KHZ800);
and guide has some discussion about that as well
scroll down to where it says "The next argument is the interesting one."
the code is using + , which is effectively same as ORing
so by ORing all of those, it determines the location of the first pixel?
it determines various things. like how the rows are connected.
oh yeah the zigzag too
but also orientation, pixel color order, frequency, etc.
so you'd want to add NEO_MATRIX_ZIGZAG to your code
and possibly others
but at least NEO_MATRIX_ZIGZAG so it knows how the rows are connected
neopixels (ws2812b, etc) are always just one long string of LEDs
all the work to treat the string as a 2D matrix is done in code
by that library
would you suggest to get it working on one of the matrix first before adding the other?
i think knowing that helps to understand what's being done via the library options
yah, work with one first, then move to the tiled setup
alright, thanks again
Ive got it working on one display, thanks cater!
issue im facing now is when i tile them it jumbles up again, do i continue doing the same thing with the args? also it turns out i didnt need the NEO_MATRIX_ZIGZAG
you'll need a different constructor when things are tiled:
https://learn.adafruit.com/adafruit-neopixel-uberguide/neomatrix-library#tiled-matrices-2894566
and may need to play around with the various options that are added up
ty
help scroll not working rp2040 usb host
I am losing my mind and could use some help. This should be super simple but I cannot for the life of me figure it out. I've created a matrix out of a strip of neopixel LEDs. When I use the Adafruit_Neopixel.h library, this code works just as expected:
strip.fill(strip.Color(255, 215, 0));
strip.show();
setMode(NOOP);
}
However, when I switch to using Adafruit_NeoMatrix.h and try using:
matrix.fillScreen(matrix.Color(255, 215, 0));
matrix.show();
setMode(NOOP);
}```
I get random colors. The first is always a fill of the expected color, but subsequent calls can fill it with something entirely different. This is using an ESP32 and the Arduino programming environment. Any ideas?
Could you share your definitions for “strip” and “matrix”?
NEO_MATRIX_BOTTOM + NEO_MATRIX_RIGHT +
NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG,
NEO_RGB + NEO_KHZ800);```
I copied this code from a video where it was How to control a servo motor with a joystick. The code does indeed work really well, but in the video he doesn’t explain how it works. So can someone explain the code to me.
Please paste code as text. See #welcome message. Screenshots are hard to read and can't be copied from.
The analog joystick presents a voltage which is read as an integer betwen 0 and 1023. That is mapped to an integer between 0 and 100. The servo object takes that value as a position. It's worth looking up the documentation for each of the function calls for details.
Thanks
Hello, Im working on my first C++ project including a SCD30 CO2 Sensor board (from Adafruit) that's controlled by an ESP8266 wroom02 over I2C (I2C Ports are getting switched between a display and the Sensor). Currently Im trying to implement a solution for the fact that the first reading is not giving back a real value and that there is no reading before the whole interval is over (Which in my case is 60 seconds). My plan to solve this is by just setting the the interval for the first 2 readings (Or alternatively the first 5 Seconds) to 2 seconds and afterwards to the normal interval of 60 seconds automatically. And that would work, the problem now is, that it does not work when I do a "Cold-start" of the Controller, it only works when I'm uploading the compiled code and having a soft start. I tried many different things now, delays, different function call orders etc. and nothing seems to work, it feels like the Sensor is set to the speed of 60 seconds even before that function is called. Maybe somebody here has an Idea why this might be the case and maybe even knows a way to solve this (Or at least can tell me if its a hardware defined 'difficulty'). Thank you in advance 🙂
it does not work when I do a "Cold-start" of the Controller
It's unclear to me what the bad behavior is
is setting the interval to 2 seconds what doesn't work ? (as in the interval isn't 2 seconds)
or are you getting a bad value when you expected a good one ?
Exactly the interval cannot be set
Well it looks like its set (the command goes through) but the sensor doesn't use it (as it would be visible by the shining light)
Are you using the Adafruit's Arduino library for the sensor?
You can post your code like this #welcome message
#include <Arduino.h>
#include <SensorDataReceiver-CO2-Temp-Hum.h>
#include <DisplayDriver.h>
#include <Wire.h>
#include <string>
// put function declarations here:
//int myFunction(int, int);
std::string OldData = "Test";
bool Coldstart = true;
int MeasurementIntervallInSec = -1;
int DesiredMeasurementIntervallInSec = 60;
void setup() {
Serial.begin(115200);
// while (!Serial) delay(10); // will pause Zero, Leonardo, etc until serial console opens
InitializeSensor();
OtherSettings();
delay(200);
DisplayInitialize();
delay(200);
}
void loop() {
if (Coldstart == true)
{
SetSpeed(2);
delay(5000);
Coldstart = false;
MeasurementIntervallInSec = GetSpeed();
}
else if (!Coldstart && MeasurementIntervallInSec != DesiredMeasurementIntervallInSec)
{
SetSpeed(DesiredMeasurementIntervallInSec);
delay(200);
MeasurementIntervallInSec = GetSpeed();
}
// put your main code here, to run repeatedly:
std::string Data = ReadData().c_str();
if (Data != OldData && Data != "FALSE") {
Serial.println("IF DATA TRUE");
DisplayValues(Data);
OldData = Data;
}
}
I tried it here even with the if else statement
I hope it doesn't look too messy, like I said, its my first C++ project 😅
void InitializeSensor() {
Wire.begin(4, 5);
delay(50);
Serial.println("Adafruit SCD30 Sensor adjustment test!");
// Try to initialize!
if (!scd30.begin()) {
Serial.println("Failed to find SCD30 chip");
while (1) { delay(10); }
}
Serial.println("SCD30 Found!");
}
void SetSpeed(int IntervallinSec){
Wire.begin(4, 5);
delay(50);
/*** Adjust the rate at which measurements are taken, from 2-1800 seconds */
if (!scd30.setMeasurementInterval(IntervallinSec)) {
Serial.println("Failed to set measurement interval");
while(1){ delay(10);}
}
GetSpeed();
Serial.println("(SetSpeed)");
}
int GetSpeed() {
Wire.begin(4, 5);
delay(50);
Serial.print("Measurement interval: ");
int Speed = scd30.getMeasurementInterval();
Serial.print(Speed);
Serial.println(" seconds");
return Speed;
}
Yea, using the Adafruit library with some of the example code 🙂
CO2 sensors need to be preheated
They work by some sort of tiny metal bit that has to be warm (done so with a tiny bit of constant power)
Your issue is with thermodynamics. Not code
Either give it time to heat or ignore the first couple readings till they return a nonzero value
SCD30 is a NDIR sensor, it has nothing to do with heated metal.
Hoi, will esp32 be strong enough to be a midi "instrument" processor for piezo elements? As i got an idea for a whack project, but need to find out if it would be able to process a full drumkit, and maybe power a loudspeaker.
Ah I thought it was a voc sensor
Yes
If you optimize
Just used fixed point
Fixed point meaning what? Same force register with any tap strength? As i want it to be dynamic.
https://www.youtube.com/watch?v=ccONpgYz_Sw
I'm just rambling sorry
You'll be fine
Cause i was more thinking of not using garage band on a mac, but a software i install on top that handles the processing and translation to midi drums being all on-device. And need to find out how beefy device i'd need :P
Id really do proscessing on ur computer for complex effects
But otherwise you're probably fine
Not so much complex effects, just what that software does, but more than one snare :P
And it's why i'm slowly trying to find out exactly how beefy computer is required to accomplish the task.
In that case you're fine
Gotcha. Also, for esp32's, i see a good few different looking ones on ali, what's the main difference between them? Just different components? Or some being able to handle higher power and such?
Get the new one and you're fine
Don't get the 2666 it sucks
Fair warning. If you call me fine one more time, i'll evolve into gorgeous at this point 
Sounded like a threat, but just a random joke x)
Holy hecc, esp32's has tensorflow now? o.O
But should it lamfo
If it wasn't for the uber smol storage and ram, i'd be tempted to install a super tiny llm/image gen
Image gen as in capable of a few pixels sprite xD
That's... Not possible
I mean, give it enough ram and storage to hold a model, with time, it could lol
waits 200 h
Output: " Your code sucks"
Yep xD
Pain but funny
Microsd
Yep lol. Could you link to the esp32's you'd recommend? Can only seem to find 20+ buck ones.
That's how it is
Buy a 3pack
Ah, as the ones on ali are 2-5 buck range :P And wanna also find out what makes them that cheap, as well as what makes adafruit's cost 20.
Oh nvm, gpt provided the answer lol. QC, support, no shady components/manufacturer rejects and whatnot
Avoid buying chips from adafruit
Buy sensors from them
No Chinese lie sensors
Because it's too expensive
Gotcha, where do you buy chips from?
Amazon prime lol
Ah, no prime eligible for me lol
What are you
Hello ! I have a problem with my arduino nano 33 ble rev2.
I am new to arduino, and I encountered a problem with trying to simply light on a led.
I appears that I am able to trigger all the pins on one side (from D13 to D21) but not on the other side (D2 to D12)
Here is my code :
import machine
import time
p15 = machine.Pin(15, machine.Pin.OUT)
p15.on()
When I put "15" it works, but when I put "12" my led does not emit light
I assume you are using LEDs on a breadboard, could you have wired the LED the wrong way on one side ?
Well if it is the case then the pins on one side are delivering the opposite of the other side
Seems strange to me
can you show your wiring maybe ?
I can
Mmh wait
Now it does not work on pin 14
I have 2 questions then
1 ) are my numbers correct (am I suppose to type "14" to control D14)
2) does just executing "pin.on()" without a loop puts on the pin on just for a short moment or for a long time ?
Just to be sure that my tests are fair
that's a good question, I believe that Micropython will keep the pin in the same state until you reset, as for the pin numbers I don't know
Well in fact the 13 triggers the pin D13
I think you can use pin names with strings ? like Pin("A1")
It works
I mean the string naming works
That's practical
And now it works fine !
Thank you !
hii, I have this feather esp32-s2 with the stemmaqt ano rotary encoder with buttons, and I'm trying to make a USB HID device. The default sketch for the rotary encoder works fine, and it recognizes the stemmaqt input but when I try the sketch below, it triggers the "seesaw not found at default address" error. I can't figure out what I'm doing wrong, code below 🙏🏻
#include "USB.h"
#include "USBHIDMouse.h"
#include "USBHIDKeyboard.h"
USBHIDMouse Mouse;
USBHIDKeyboard Keyboard;
// set pin numbers for the five buttons:
#include "Adafruit_seesaw.h"
#define SS_SWITCH_SELECT 1
#define SS_SWITCH_UP 2
#define SS_SWITCH_LEFT 3
#define SS_SWITCH_DOWN 4
#define SS_SWITCH_RIGHT 5
#define SEESAW_ADDR 0x49
Adafruit_seesaw ss;
int32_t encoder_position;
void setup() { // initialize the buttons' inputs:
Serial.begin(115200);
while (!Serial) delay(10);
Serial.println("Looking for seesaw!");
if (! ss.begin(SEESAW_ADDR)) {
Serial.println("Couldn't find seesaw on default address");
while(1) delay(10);
}
Serial.println("seesaw started");
uint32_t version = ((ss.getVersion() >> 16) & 0xFFFF);
if (version != 5740){
Serial.print("Wrong firmware loaded? ");
Serial.println(version);
while(1) delay(10);
}
Serial.println("Found Product 5740");
ss.pinMode(SS_SWITCH_UP, INPUT_PULLUP);
ss.pinMode(SS_SWITCH_DOWN, INPUT_PULLUP);
ss.pinMode(SS_SWITCH_LEFT, INPUT_PULLUP);
ss.pinMode(SS_SWITCH_RIGHT, INPUT_PULLUP);
ss.pinMode(SS_SWITCH_SELECT, INPUT_PULLUP);
encoder_position = ss.getEncoderPosition();
Serial.println("Turning on interrupts");
ss.enableEncoderInterrupt();
ss.setGPIOInterrupts((uint32_t)1 << SS_SWITCH_UP, 1);
Keyboard.begin();
USB.begin();
}
void loop() {
// use the pushbuttons to control the keyboard:
if (! ss.digitalRead(SS_SWITCH_UP)) {
Keyboard.write('u');
}
[ETC ETC]
int32_t new_position = ss.getEncoderPosition();
if (encoder_position != new_position) {
if (new_position > encoder_position) {
Keyboard.write(']');
} else {
Keyboard.write('[');
}
encoder_position = new_position;
delay(100);
}
delay(5);
}
it doesn't look like there is anything wrong with the code, and since it's failing in setup, the connection to the breakout is probably flaky
are you using the Stemma QT connector ?
It would be worth running an I2C scanning sketch to see if the seesaw is visible as another address.
Aha, note on this board you have to enable the I2C power and pullups with a pin change. See https://learn.adafruit.com/adafruit-esp32-s2-feather/i2c-scan-test
I am using it, and the sketch included in the ano encoder documentation works completely fine, so I don’t know if it’s related to the connection.
and i basically just mashed together that example script verbatim with the keyboard & usb libraries
but yes headed to studio & will start by trying an i2c scanner sketch, but its still confusing that it would have no problem finding the device with the example script but once i add the usb / keyboard it cant find it
Your mashup above doesn't include turning on the i2C power:
// turn on the I2C power by setting pin to opposite of 'rest state'
pinMode(PIN_I2C_POWER, INPUT);
delay(1);
bool polarity = digitalRead(PIN_I2C_POWER);
pinMode(PIN_I2C_POWER, OUTPUT);
digitalWrite(PIN_I2C_POWER, !polarity);
ahhhh ok!!
I don't know why the ANO sketch worked if that wasn't included. But that is to turn on the power at the STEMMA_I2C socket. If you were wiring it up not with STEMMA, but powered separately then that might work
hmm ok so I tried putting this in my setup and got this error:
Compilation error: 'PIN_I2C_POWER' was not declared in this scope
the original sketch I modified doesn't have that i2c power bit, but it seems to be usiung the arduino's i2c pins instead of the built in stemmaqt input?
https://learn.adafruit.com/adafruit-ano-rotary-navigation-encoder-to-i2c-stemma-qt-adapter/arduino
The STEMMA connector and the SCL/SDA pins are connected together. But the STEMMA power is controlled by the power pin.
What board are you choosing in Arduino? Adafuit Feather ESP32-S2?
im flashing to the dev module
in the docs it said dont ever flash firmware on anything but that?
could you point to where it says that? You should choose the board in the drop-down