#help-with-arduino
1 messages · Page 19 of 1
Chances are, they published both libraries
Can you please show me where did they publish the other library?
Assuming you're talking about SoftwareSerial, you would just add it through the "Manage Libraries" dialog
I don't think that's what they do in the demonstration video. UPDI must use hardware serial. And Arduino Uno only has 1 Serial interface so I agree that the only way to read serial message in Arduino IDE is using another software serial interface. However, how can they wire this software serial back to the USB cable so that IDE can read? I don't think the shield in the video can do that
Also, from the source code, they use Serial for serial monitor, and Serial1 for UPDI, and the Arduino Uno is used in the video. I'm really confused like how can they make it work unless they secretly modified the code from the library and didn't even publish that code after all
I just looked it up, UART0 should be connected to the usb port on the Uno, and UART1 would be connected to the RX and TX pins. So that means there are 2 hardware serial interfaces actually
But in Arduino, when I compile it doesn't recognize Serial1
All that SoftwareSerial allows you to do is turn any pair of pins into a serial port
I'm using Arduino Uno the official board
So really SoftwareSerial is probably just the simplest way to go
I'm trying to make their original code work with minimal modification first
Or the board in the video isn't an Arduino Uno after all?
Can you link me to the video?
I wish they can give more detail about the hardware and the schematic
I may be wrong but I think thats a mega
I actually having both Mega and Uno on my hand right now and the ratio between width and length makes me think it's Uno and not a Mega
Also the size compared to her finger
And usually the Mega has a third row of header on the opposite end of USB cable
Heres a minimal example of SoftwareSerial. It'll almost certainly fix what you're running into, you just need to add SoftwareSerial Serial1(RX_PIN, TX_PIN); to the top of your code to define Serial1
#include <SoftwareSerial.h>
// Define the RX and TX pins for SoftwareSerial
#define RX_PIN 10
#define TX_PIN 11
// Create a SoftwareSerial object
SoftwareSerial Serial1(RX_PIN, TX_PIN);
void setup() {
// Start the hardware serial port (connected to USB)
Serial.begin(9600);
// Start the software serial port
Serial1.begin(9600);
// Print to the hardware serial port
Serial.println("Hello from hardware serial!");
// Print to the software serial port
Serial1.println("Hello from software serial!");
}
void loop() {
// Read from the hardware serial and send to the software serial
if (Serial.available()) {
char c = Serial.read();
Serial1.write(c);
}
// Read from the software serial and send to the hardware serial
if (Serial1.available()) {
char c = Serial1.read();
Serial.write(c);
}
}
And then RX_PIN and TX_PIN are just the pins that you want to use serial on
Allows you to use pretty much any pins
Thank you but I still don't understand why they publish a code that doesn't work
Again, most likely just a slightly different processor which has multiple hardware serial ports or something. Very hard to publish something that works on multiple different embedded devices so its expected to run into issues like this sometimes
Welcome to embedded haha 🙂
Yeah I agree. I mean it was a bad job on the library owner to public any kind of library without specifying the board it is supposed to be used with, causing unneccessary confusion for user 🙂
Ladyada clearly specifies in the video that the code is running on a Metro M0 board (so a samd21 chip), not any kind of arduino original.
And this is not a guide meant for confused end users, it's a demonstration of how they build testers / programmers for their own hardware. It's published, because Adafruit publishes everything.
I didn't know about the existence of Metro M0 board, and she speaks that part too fast, so I don't think anyone without knowing about this board can understand what board she said. And if you said Adafruit publishes everything, then at least on the video page of Adafruit, or library owner must provide a link to the M0 board, or similar project, or the original project that use Arduino as AVR programmer
😮
I personally don't believe the owner of any free code provided to you "must" do anything.
Hmm, I thought this library belongs to Adafruit?
Just like any other Adafruit libraries, they were very well documented so I expect this is the same
Again, this is not a library. It's the code they used to program a tester / flasher for their own hardware.
They give it away for free, because that's what they do.
My bad. I thought they sold the shield and the Metro M0, and this library is companion library
The Metro M0 is for sale.
The shield used in the video is not for sale, it's a tester they use internally... but most likely the HW schematic is published somewhere, so you could make your own.
Yes. I indeed tried searching for the shield schematic but came to a dead end
No schematic, since you can use any perfboard, but there is~~ a guide ~~ 2 guides
They also sell the kind of clamp used in the video https://www.adafruit.com/product/2457 and some sizes of pogo pins, but you can get those in other places too.
I actually can build my own PCB. I just want to know the schematic of everything used in the video but I guess it isn't available online
Can someone please help me understand how the programming fuse, normal fuse and fuse verify mask work? This snippet is from images.cpp of an example from the library Adafruit_AVRProg
// zero are untouched.
{0x00, 0x00, 0x00, 0x00}, // {lock, low, high, extended}
// Normal fuses, written after writing to flash (but before
// verifying). Fuses set to zero are untouched.
{0x00, 0x0, 0x0, 0x0}, // {lock, low, high, extended}
// Fuse verify mask. Any bits set to zero in these values are
// ignored while verifying the fuses after writing them. All (and
// only) bits that are unused for this atmega chip should be zero
// here.
{0x3F, 0xFF, 0xFF, 0x07}, // {lock, low, high, extended}```
When I checked in Microchip Studio, Attiny816 has 8 bytes of fuse, which are the same amount with programming fuse and normal fuse. But how do I know which one is programming fuse, which one is normal fuse?
That's a little confusing. Perhaps it's the same fuses, but some bits are written before programming (to set up the chip to make it programmable, for example), and some of them are written after programming (to configure features the software uses when it's running, security bits, etc.) So I'm guessing it writes them twice, with different values (fuses only go one way, you can set them to 1 but not back to 0 without erasing everything, so effectively the values are OR-ed)
Thank you. If I understand correctly, the definition of lock/low/high/extended fuse bit isn't applicable for ATtiny816. And since in the example code, they didn't modify the fuse so it was an issue. But I think the correct code should be 8 bytes for programming fuse, 8 bytes for normal fuses an 8 bytes for fuse mask?
And can I assume the programming order for these fuse is from low index to high index?
Doesn't look like it...
Er, programming order might be, but the list you posted above is not in order
So I think there are 9 bytes in total for fuse, including 1 byte for lockbit?
Yes the image I captured is just from Microchip Studio so they may order it alphabetically instead
hello, Is it really possible to connect with 3.5 inch SPI TFT(ILI9488) with ESP8266 ?
i've searched and tries many way ... until i see SMOKE, i don't which part is smoking (either ESP8266 or the screen) but both at least still functioning (?). I panicked and quickly unplugged the power
I seem can't put a text and color to the screen
even, i dont know if it still usable just because it still turn on.
I've come here to search for rescue 😅
My Pinout From Screen -> ESP / Power Supply
VCC -> 5V
Gnd -> GND
CS -> D1
RST -> D2
DC -> D3
MOSI -> HMOSI (D7)
SCK -> HSCLK (D5)
LED -> 3.3 V
MISO -> HMISO (D6)
Any idea or help is very gratefull. Sincere from bottom of my heart 🥹
Some TFTs don't have a backlight current limiting resistor, so hooking the LED directly to power would be bad on those units.
c++ question
I have a class that controls a motor driver. it has a function TB6612FNG::SetSpeed that takes an int as input
I have another class that does closed loop control of a motorized potentiometer. you tell it an ADC pin and some other info and it calculates a speed
I want to pass that class a function when I set it up - so like
MotorizedPotentiometer motorPot(28, motorDriver.setSpeed(speed))
how I'm doing it right now is like this:
MotorizedPotentiometer::MotorizedPotentiometer(uint adcPin, std::function<void(int)> callback, int minSpeed, int maxSpeed)
and then I call the callback like
callback(speed);
here's where I set up the object in my main code:
MotorizedPotentiometer motorPot(
28, // ADC Pin
[&](int speed)
{ motorDriver.setSpeed(speed); },
-100, // Min Speed
100 // Max Speed
This works, but I don't know why, or if it is a good solution. What is the "best" way to do this?
I suppose it depends on what you mean by "best". You could use PID, but that can be complicated.
I am using an esp32-s3 Reverse TFT Feather and there is something wrong with the serial monitor. I get these messages:
[0;32mI (612) esp_image: segment 0: paddr=00010020 vaddr=3c0a00[0;32mI (650) esp_image: segment 3: paddr=00040020 vaddr=42000020 size=972f8h (619256) map[0m
[0;32mI (748) esp_image: segment 4: paddr=000d7320 vaddr=40379b60 size=0a878h ( 43128) load[0m
[0;32mI (764) boot: Loaded app from partition at offset 0x10000[0m
[0;32mI (764) boot: Disabling RNG early entropy source...[0m
E (783) esp_core_dump_flash: No core dump partition found!
E (783) esp_core_dump_flash: No core dump partition found!
And then nothing else
Try erasing the flash completely with esptool.py (there may be a way to do that in Arduino itself). it sounds like the partition table may not be what Arduino is expecting
it was used with wippersnapper before, does that matter? do i need to do anything going from Wippersnapper to using arduino?
im using the adafruitio_13_rgb.ino from the adafruit IO library. I want to change the screen color with the value i get from the feed:
...
Serial.println(data->value());
display.fillScreen(data->value());
Since i cant print out the received value in the serial monitor (see above) i cant see the format of what i receive; data->value()
must i do some conversion? like:
uint16_t IOColor = strtol(data->value().c_str(), NULL, 16);
or
uint16_t IOColor = (uint48_t)data->value();
?
i'd suggest erasing just to make sure. I think Wippersnapper may have a different partition scheme than standard arduino
I tried erasing it and the serial monitor instead sent this message:
invalid header: 0xffffffff
After I uploaded the sketch again I got the same message as earlier and the serial monitor still isn't working
Hi guys, programming ESP32 C3 Supermini in Arduino IDE and getting a Guru Meditation Error: Core 0 Panic'ed (Interrupt wdt timeout on CPU0) error.
In general what should I be looking for?
The interrupt code is fairly short, around 10 lines, only calling Serial.println inside of it, other than that, just basic operations.
Other diagnostics writeouts suggest that the error occurs outside of the interrupt routine, because some serial text is interrupted by the error which is written outside the interrupt code.
I'd look for things the interrupt routine modifies that are not declared as volatile, wild pointers, divide by zero, etc.
Thanks for the input. The problem was solved by commenting out the diagnostics serial print from within the ISR.
looking for help with the RP2040 using Arduino …. i have a sketch that controls a SMS module to send text messages…. i’ve gotten it to work with an ESP32 .. just don’t understand the pins on RP2040 to connect to the module ?
and then the 2nd question is .. i need Serial for printing to the serial monitor .. would it be Serial1 or Serial2 for setting up pins for the module to get TX/RX ?
apparently there are three sets of TX/RX-1 ?
is there a default set?
In general, Serial.print is not something you want in an ISR. It can be sllllooow, making the ISR take a lot longer than it looks like. I think (not sure) that serial print uses interrupts under the hood, which might not work so well while processing an interrupt. Set a flag, or fill a buffer, but do not initiate the actual print from inside an ISR.
Indeed, lesson learned 🙂
update —- i figured it out Serial1 prints to pins marked with tx/rx-0 was thinking it would be a matching “1”
assignment
Many chips have built-in USB serial, and Arduino maps that to Serial, so the first UART becomes Serial1
Question:
I use two ESP32 C3 Superminis with ESP NOW, specifically one master and one slave.
When they're both connected to the PC with their respective USB cable, sending data works. When one is powered by a battery, it doesn't work (other code works ok tho).
I'm sure there's some analog wizardry or other error 40 reason for this, anyone got some ideas what might be up?
If the code tries to use the USB serial port, it can hang trying to open it when USB isn't connected.
Good observation, however, the program doesn't hang, at least not on the master, the data just doesn't get through.
Is it necessary to force the WiFi channel to be the same on both boards?
could the battery be too small to supply the current spike on wifi transmit? does it work when one is battery-powered and one is on USB? or the reverse? or perhaps try connecting them to USB power without data, like a phone charger.
I don't think the battery is, it's a 3S lithium ion Molicell P45B able to supply a lot of current. But maybe on the 5V side after the LM317? I only have a 100nF decoupling cap there.
Hmm, when I connect the ground planes with a single wire, it works.
did you have vs code running at the same time? it might hog the serial port.
Hi - Is there an updated version of this guide https://learn.adafruit.com/adafruit-arduino-ide-setup/overview
Arduino Docs themselves might be the best bet.
https://docs.arduino.cc/software/ide/
There are Arduino setup guides in many of the dev board guides. For instance Feather so-and-so will have its own Arduino setup pages.
Thanks - I was at https://learn.adafruit.com/introducing-pro-trinket/setting-up-arduino-ide but that directs to the obsolete older guide at https://learn.adafruit.com/adafruit-arduino-ide-setup/overview
and https://learn.adafruit.com/bike-wheel-pov-display/code also links to that old guide
There is a lot of great content on the adafruit website, but as a newbie it is frustrating running into so many old references
Sorry about that. The first part of the setup here https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-circuitpython/arduino-ide-setup I think will help, and then you can choose the Arduino AVR Boards package. But the uploading info is not for your board. In the left sidebar on each guide is a "Feedback? Corrections?" link. Let us know about obsolete sections there.
Hello i joined this discord today, i need some help in Arduino and LCD, i have "DC 3.3V 1.28 Inch TFT LCD Display Module Round RGB 240 * 240 GC9A01 Driver 4 Wire SPI Interface 240x240 PCB for Arduino" and i want to code this with Arduino uno r3 or Arduino Mega , i found some library of adafruit and nothing worked for me. I need a round LCD that i can code with Arduino uno R3 and i also need a working library. pleaseany help is really appriciate. i can buy new LCD if the above LCD is not the coerrect choice
I'm not sure which display you're using (I see several round ones of 2.1, 2.8, and 4"), but I suspect that such displays don't work with an Arduino Uno. The product description points out "The SPI is only for configuring the display - you cannot draw pixels over SPI!", as well as "To make stuff light up you'll need a chip that can perform TTL RGB TFT driving, which means a powerful microcontroller such as the ESP32-S3 with octal PSRAM" and "You cannot use these with an every day microcontroller unless it specifically has support for RGB-666 displays"
Thanks for your response, can u please suggest what combination i should use then , i can order ESP32-S3 and the LCD i need the model number or the link that i need to order please . really appriciate your help.
Do you have a link to the specific display you have?
I don't think Adafruit has any display with this driver, but with a quick google search I found https://dronebotworkshop.com/gc9a01/ ... hopefully it works
i tried that and it did not work , please recommend something i can buy
When you say "it did not work", what happened? Did it compile? Did it run?
Note that many of those displays are 3.3V only, hooking them to a 5V Arduino could destroy them
what speaker amplifier does the adafruit pygamer use
I can't play sounds on it with arduino
and I'm trying to find another library
Are you using it with the Adafruit Arcada? https://learn.adafruit.com/adafruit-pygamer/arcada-library
You need the enable the speaker for it to work
I know, but I just want to play audio samples, not from files
The exact components are on the schematics in the downloads section https://learn.adafruit.com/adafruit-pygamer/downloads
thanks
I also found something in the full boards test
it plays an audio file but the audio file is just a header file full of audio samples
maybe I can use that
Do you know what the default analog write resolution is of the pygamer? because in the full boards test, it is set to 8 but Idk if it can be set higher for better audio quality
I think the 8 is just the default for back compatibility, the samd51 on the pygamer has a 12 bit DAC
ok thanks
I have an esp32 that I want to use to control my usongshine tb6600 stepper driver, but the 3.3v gpio pins are inadequate to trigger the driver it seems. I was wondering if I could use my PCA9685 (which as far as I can tell, has 5v signal pins) as gpio pins to control the stepper?
Anyone have any advice for troubleshooting a failure to connect via SSL using wifi101? I'm on a Feather M0 and can't for the life of me get this thing to work. I updated root certificates and have gotten other websites to connect. Meanwhile I also tried using an old RootCertificates library to see if I could even download the certificate directly but even that wouldn't work. I'm assuming the site (https://bustime.norta.com) is just rejecting the connection outright for some reason?
Update: Nothing to do with SSL, everything to do with the fact that I can't even get the Arduino to ping the server. It seems like connecting to literally anything other than https://bustime.norta.com will not work. That includes the IP address.
Guess it's time to figure out a reverse proxy unless anyone else has any ideas
Let's see, that redirects to https://bustime.norta.com/bustime which in turn redirects to https://bustime.norta.com/bustime/ which then redirects to https://bustime.norta.com/bustime/home.jsp. It could be the second redirect (HTTP code 302) is not supported by the Arduino web interface. However it could be some transport problem if you can't even ping it.
Hey all, I'm trying to get blinkenlights working on my CH552 QT Py and I'm getting the following error when attempting to upload the sketch to the device:
Sketch uses 4838 bytes (33%) of program storage space. Maximum is 14336 bytes.
Global variables use 104 bytes (11%) of dynamic memory, leaving 772 bytes for local variables. Maximum is 876 bytes.
Cannot perform port reset: TOUCH: error during reset: setting DTR to OFF: cannot send after transport endpoint shutdown
------------------------------------------------------------------
CH55x Programmer by Deqing
Updated on: 2023/10/10
------------------------------------------------------------------
usbRertySeconds 2
target: CH552
config bytes: 3
Load file as hex
Loaded 4760 bytes between: 0000 to 12E5
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
No CH55x USB Found, retry...
Found no CH55x USB
Time limit reached, exit process
Failed uploading: uploading error: exit status 1
I followed the instructions on the learn guide and my board is recognized by my PC
I tried uploading the code in bootloader mode as well, but the same error comes up.
I tried on my Windows laptop as well to the same results.
On Linux, I was able to fix the issue by performing the following steps:
1.) cd /etc/udev/rules.d
2.) sudo touch 99.ch55xbl.rules
3.) sudo vi 99.ch55xbl.rules
4.) copy and pasting the following into the file:
# CH55x bootloader
# copy to /etc/udev/rules.d/
SUBSYSTEM=="usb", ATTRS{idVendor}=="4348", ATTRS{idProduct}=="55e0", MODE="0666"
5.) save the changes and quit.
6.) reboot
You guys know any good alternatives to the powerboost 500-1000 for arduino
Cause I need something to power my nano with a lithium battery
Why do you need alternatives ?
Adafruit stuff tends to be pricy for my liking and I need multiple
You may not need to boost the voltage to power the nano, as a lithium cell is generally enough voltage to supply a 3.3V LDO regulator.
But there’s no ports to plug into the nano with a lithum cell
So, I'm trying to do some stuff with a random TFT/SPI board connected to a Pi Pico using the Arduino C++ environment and the Adafruit ILI9341 library.
I've got it working, as long as I initialize it using the full set of argument:
tft = new Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
I think this is using a bit-bang SPI implementation, instead of the onboard hardware. I'm not super concerned about that except that the refresh rate is super-duper slow. Like, takes a second or more to clear a 320x240 display.
I'm not sure if it is slow because of the SPI implementation or if that's a red herring. I've tried specifying just the CS and DC lines in the constructor, which I think is supposed to use hardware SPI, although I'm not sure if that's expected to work on the RP2040, although I'm pretty sure the pins I'm using correspond to the default SPI, and in that mode I can see MOSI doing stuff in my logic analyzer. I just see nothing coming back from the display during the initialization, and I don't see anything on the display.
So I guess my questions are:
- What kind of performance should I expect from this display, anyway. I didn't expect buttery-smooth 160fps, but this seems really slow.
- How likely is it that my slowness is caused by the SPI protocol, vs something else?
- Anything I can do to make things faster? Tunable parameters? Make hardware SPI work?
- Is it because I'm clearing the whole screen? Should I just bite the bullet and be smart enough to only clear and refresh the part of the screen containing new data? Any double-buffering libraries out there?
Hmm. Looks like a quick implementation of #4 was not so terrible and is super-faster, so maybe that's the way I should do things. Or find a higher-level graphics lib (or learn how to use the one I have, which I've spent like 20 minutes learning, I guess.)
I'm pretty sure the pins I'm using correspond to the default SPI
You can check here if you do use the default SPI pins
https://github.com/earlephilhower/arduino-pico/blob/master/variants/rpipico/pins_arduino.h
The HW implementation call requires 3 parameters, CS, DC **and ** RST
https://github.com/adafruit/Adafruit_ILI9341/blob/master/Adafruit_ILI9341.cpp
/**************************************************************************/
/*!
@brief Instantiate Adafruit ILI9341 driver with hardware SPI using the
default SPI peripheral.
@param cs Chip select pin # (OK to pass -1 if CS tied to GND).
@param dc Data/Command pin # (required).
@param rst Reset pin # (optional, pass -1 if unused).
*/
/**************************************************************************/
Adafruit_ILI9341::Adafruit_ILI9341(int8_t cs, int8_t dc, int8_t rst)
: Adafruit_SPITFT(ILI9341_TFTWIDTH, ILI9341_TFTHEIGHT, cs, dc, rst) {}
I just see nothing coming back from the display during the initialization
The display is write only, it doesn't send anything back to microcontroller
Huh, ok, I'll take a look at the instantiation, then, I don't think I was including RST -- thanks!
The demo/benchmark includes this code, which would seem to indicate that there's a way to read:
Serial.print("Display Power Mode: 0x"); Serial.println(x, HEX);
x = tft->readcommand8(ILI9341_RDMADCTL);
Serial.print("MADCTL Mode: 0x"); Serial.println(x, HEX);
x = tft->readcommand8(ILI9341_RDPIXFMT);
Serial.print("Pixel Format: 0x"); Serial.println(x, HEX);
x = tft->readcommand8(ILI9341_RDIMGFMT);
Serial.print("Image Format: 0x"); Serial.println(x, HEX);
x = tft->readcommand8(ILI9341_RDSELFDIAG);
Serial.print("Self Diagnostic: 0x"); Serial.println(x, HEX);
I also assume that the graphics libraries are finding the screen dimensions somehow because I'm not telling it. 🙂
(oh, nevermind, finally looked at the datasheet: the ILI9341 only supports 320x240)
Nice! Yeah, that seems to make it work in hardware mode, and also seems much faster for clearing the entire screen (although I should probably make the graphics bits more efficient). Thanks!
There isn't any way to view the cert being uploaded in the firmware updater, is there? A part of me is wondering if it's uploading properly. Does the firmware updater check to make sure it's a valid cert before uploading?
I was just able to connect to the site on a borrowed ESP32 board with a hardcoded cert.
Most Nanos (I'm not sure which specific one you have) have a few power pins that might be useable, but it might take some reference to the schematics/documentation.
If you don’t need the boost converter, https://www.adafruit.com/product/5397 might do the job. I’d personally pair them with some Schottky diodes to connect to the 5v bus and divide the clock by 2 to keep it within the 328p specification at the lower voltage.
Is your QT Py all alone, lacking a friend to travel the wide world with? When you were a kid you may have learned about the "buddy" system, well this product is kinda like that! A ...
Adafruit feather M0 bluefruit LE.. What a mouthfull. How does one specify serial in/out pins? I'd like to do IDE 11 - TX and IDE 10 - RX
S1.0 & S1.2 and I have no idea what this notation is trying to tell me.
Or how it would map to my c++ world.
Hey everyone! I purchased one of these https://learn.adafruit.com/adafruit-led-backpack/1-2-inch-7-segment-backpack-arduino-wiring-and-setup 7 segment backpacks and i'm trying to display a countdown in minutes and seconds. I was trying to write a function that used the writeDigitNum(location, number) but I cant get it to work. Any idea how I can achieve this?
The pinout diagram in the learn guide covers a lot of this https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le/pinouts
Have you tried some of the example code? While you can use writeDigitNum(), it's sometimes easier to just use print().
My problem is getting output in minutes and seconds to display in print()
Ah, it's more of a formatting problem than a display problem. I guess with a 4-digit display, the maximum would be 59:59, which would be a count of 3599. To display the minutes digits, divide by 60, to display the seconds digits, modulo 60.
In python, divmod 60 give both minutes and seconds.
minutes, seconds = divmod(361,60)
print(f'{minutes:02}:{seconds:02}')
06:01
True, but since this is the Arduino channel, I was thinking C-like approaches
printf can do equivalent output after integer division and mod
maybe mix with sprintf to preformat
Well no.. That doesn't seem to help. This is as close as I got.
Uart GPSPort(&sercom1, 10, 11, SERCOM_RX_PAD_2, UART_TX_PAD_0 );
void setup(void) {
pinPeripheral(10, PIO_SERCOM);
pinPeripheral(11, PIO_SERCOM);
GPSPort.begin(9600); // And this is where we read in GPS data.
}
void loop(void) {
if (GPSPort.available()) {
aChar = GPSPort.read();
Serial.print(aChar);
//other stuff..
}
}```
Does this look right? Is there an example I can look at? Do I need to check my wiring?
Wait, am I supposed to use IDE-pin0 & IDE-pin1? For a hardware serial that is NOT USB debugging?
Hopefully quick question for ya folks: I have a Grand Central Express board using the SAMD51P20. I would like to use a SAME54P20 for its ethernet capabilities. Will the arduino library for the D51 work for the E54? They have the same pinout, and even share a datasheet, with the difference seemingly coming down to the E54 having ethernet capabilities where the D51 doesn't
You could try compiling it and see if there are errors as a first test. If it won't even compile, you have some work ahead of you. If it compiles, it may work the way you want (but no guarantees)
Gotcha, thanks. I was hoping to see if someone knew before buying the chip, but what do ya do. Looks like I'd have to get another chip to make the ethernet work with the E54 anyway, so I'll probably just end up using something like a WIZ5500 breakout board and call it a day 😂
Yes, it will work. But were you thinking of replacing the chip on the board? That's a tricky business
Is there a library for the Feather RP2040 with USB Host board so I can read from a USB Xinput controller? I'm hoping to translate inputs from a logitech steering wheel to a nintendo controller.
im having a little problem with a arduino uno rev 2 wifi and arduino io comunication, the arduino is reciving this response, can someone help? Conectando ao Wi-Fi... Conectado!
Status: 200
Response:C�/���:"0FPB9XMKVFMBXD4Q90DSFT86DF","value":"1013.25","feed_id":2
885374,"feed_key":"pressure","created_at":"2024-09-11T16:48:09Z"
,"created_epoch":1726073289,"expiration":"2024-10-11T16:48:09Z"}
Response Body (raw):
{"id":"0FPB9XMKVFMBXD4Q90DSFT86��b���Օ�:"1013.25","feed_id":2885374,"feed_key":"pressure","created_at":"2024-09-11T16:48:09Z","created_epoch":1726073289,"expiration":"2024-10-11T16:48:09Z"}
It would probably help if you mention what you are trying to do, and what exactly is the problem.
i was testing the comunication betwen arduino and adafruit io and the response from the server is corrupted
Good to know it will work! Yeah, I was gonna try and replace the onboard chip. I've got experience replacing chips on boards, and I've got a hot air station/soldering iron. Like I said, though, I'll probably just end up going with the WIZ5500 if I'm gonna have to have an external component anyway. Saves me the tricky business!
It is possible the response is not corrupted and you're overrunning the serial buffer with your debug printout (this has happened to me)
i don't think, the arduino im using don't support debug
Hmm, how did you get that text?
from the serial monitor via serial print if i find it i will send the code
void sendDataToAdafruitIO(float value) {
String path = "/api/v2/" + String(ioUsername) + "/feeds/pressure/data?x-aio-key=" + String(ioKey);
String jsonPayload = "{"value": " + String(value) + "}";
client.beginRequest();
client.post(path);
client.sendHeader("Content-Type", "application/json");
client.sendHeader("Content-Length", jsonPayload.length());
client.beginBody();
client.print(jsonPayload);
client.endRequest();
int statusCode = client.responseStatusCode();
String response = client.responseBody();
Serial.print("Status: ");
Serial.println(statusCode);
// Imprimir resposta em partes
Serial.println("Response:");
for (int i = 0; i < response.length(); i++) {
Serial.print(response[i]);
if (i % 64 == 63) { // Ajuste o número conforme necessário para o seu monitor serial
Serial.println();
}
}
// Exibir a resposta completa para diagnóstico
Serial.println("\nResponse Body (raw):");
Serial.println(response);
}
What baud rate is your serial output?
btw am I the only person that uses chat gpt to help write arduino code.
it's so amazing. It almost feels wrong.
@woven lintel Ladyada did a video on this a while back. There are some really good tips in it.
https://www.youtube.com/watch?v=mQwZTo6c_yU
One of the big tasks that Ladyada still has to spend a lot of time on is writing Arduino libraries for all our devices and sensors, particularly all the I2C & SPI chips out there! These ICs use register maps and sub-byte addressing to set dozens of configurable knobs and switches, and a good driver lets folks set and get all of the noodly bits. ...
Was this meant for someone else?
oops! yeah. Fixed. Thanks!
Hi, im making a robot with the help of adafruit PCA9685 board (actually two of them with 25 servo motors in the entire body) i connected the VCC to the 3.3v and V+ to 5v of the arduino (i cannot use the extra two socket pins used to supply the servo motors because i have no access to them due to tight space, and i dont want to remove/disconnect all the pins i spent hours connecting) So my question is can i supply the servo voltage from the V+ pin using an arduino?
and also im trying to get it to work using the code i wrote but doesnt work at all
#include <Adafruit_PWMServoDriver.h>
#include <Wire.h>
Adafruit_PWMServoDriver rightpwm = Adafruit_PWMServoDriver(0x40);
Adafruit_PWMServoDriver leftpwm = Adafruit_PWMServoDriver(0x41);
void setup() {
Serial.begin(9600);
rightpwm.begin();
rightpwm.setPWMFreq(50);
leftpwm.begin();
leftpwm.setPWMFreq(50);
}
void MoveServo(Adafruit_PWMServoDriver pwm, int channel, int startAngle, int endAngle, int duration) {
// Define min and max pulse lengths for the servo (based on 50Hz)
int pulseMin = 150; // Pulse length for 30 degrees
int pulseMax = 600; // Pulse length for 150 degrees
// Calculate the pulse lengths for the start and end angles
int startPulse = map(startAngle, 30, 150, pulseMin, pulseMax);
int endPulse = map(endAngle, 30, 150, pulseMin, pulseMax);
// Calculate the number of steps for smooth movement
int steps = abs(endPulse - startPulse); // Number of steps from start to end
int stepDelay = duration / steps; // Delay between each step
// Move the servo incrementally
for (int pulse = startPulse; pulse != endPulse; pulse += (endPulse > startPulse ? 1 : -1)) {
pwm.setPWM(channel, 0, pulse);
delay(stepDelay); // Wait before the next step to create smooth movement
}
}
// Function to move servos on the right board (rightpwm) to 90 degrees with smooth motion
void position_rest() {
int duration = 1750; // Set duration between 1500ms to 2000ms (1.5 to 2 seconds)
// Smoothly move servos on channels 1 and 2 to 90 degrees over the defined duration
MoveServo(rightpwm, 0, 90, 90, duration); // Move channel 1 to 90 degrees
}
This is my code that im trying to work with, i call the position_rest using a serial.readString function but the servo never moves, i see the lights glowing on the two boards, and i know they both work due to the test i did before putting them all together. Is it the power problem or the code?
What arduino board are you using exactly?
UNO
UNO has 5V logic, so Vcc on the PCA9685 should be connected to the 5V pin https://learn.adafruit.com/16-channel-pwm-servo-driver/pinouts#power-pins-2980404
And you definitely cannot power 25 servos from the 5V pin on the Arduino, you need an external power supply.
You can connect the power supply to the V+ , you don't need to use the terminal blocks
Just remember to also connect the ground from the power supply
okay since the V+ pin can accept 5-6V max can i power that through an external powersupply (5V 2Amps)
sure, what about the code, is that alright?
I'm on a phone, so i didn't look too closely at that 😅
oh its okay 😅 i have some doubts on my code too so i had to confirm that
Did you try the code with just one servo?
no i didnt unfortunately i forgot about that, but i did try the default example code on either of the boards before i mounted them
It should work from the 5V pin
okay ill try it from a 5V 2A power supply
if you test with less servos, it will tell you if it's a power problem
i really dont want to get myself in the pain of connecting each of the servos back again in a tight space
oh, no, i just meant in code
you don't have to disconnect them
test with less servos from the code?
im just trying to move channel 0 which is the first servo motor connected to the right board
ah, gotcha
then try changing Vcc to 5V (that's your logic lvl on arduino, might be issues on I2C )
but since all servos are connected (even tho not used in the code) wont they still draw the power just without the signal
and the external power
sure i will give it a try now
still nothing
says this but nothing actually moves
let me try some other code to check if its working or not
for some reason @eternal cloud when i connect the SCL and SDA pins to the arduino board's pin A4 and A5 it freezes my board
and the TX pin goes off
when i remove the pins it comes back to normal
wait, why are you connecting the SCL and SDA to the A4 and A5 ? 🤔
SCL and SDA are the I2C pins ... they need to be connected to the I2C pins on the arduino
but every tutorial on youtube tells me to connect them to the A4 and A5 pins
look at this
https://learn.adafruit.com/16-channel-pwm-servo-driver?view=all infact this, says the same
now im trying to figure out where are the I2C pins
this says SDA and SCL are pins A4 and A5 tho
Do you have the UNO rev3 ?
it Arduino UNO R3
from official arduino its not a clone or anything
https://forum.arduino.cc/t/issues-with-pca9685-and-servos-arduino-uno/949811/3 maybe im facing this?
R3 has dedicated pins for I2C, so it's probably better to use those https://learn.adafruit.com/16-channel-pwm-servo-driver/hooking-it-up
let me try that
there are literally no pin out images on the R3 board, i have an old model of arduino (its a clone but its just UNO) ill try on that
you can't find the scl / sda pins or ?
okay wait let me try that then
it dims all the lights on the arduino board
and it freezes it
if i remove the SCL and SDA pins out it starts working normally
When did it start doing this?
May i please see some pics of your wiring? both the uno and the PCA9685
sure hold on
This is frozen at the moment
But if I remove the SDA SCL pins
Starts working back
I can see the outputs showing up on the serial monitor with the pins removed
(i have removed the V+ connection to first figure out this issue, but even when that is connected the same thing happens)
GND -> GND
OC -> NONE (not connected)
SCL -> SCL
SDA -> SDA
VCC -> 5v
V+ -> external
i have also bridged the two boards as shown in the learn.adafruit website, with the I2C solder joints connected
can you not take pics of the PCA9685 boards ?
oh not sure u can see them in the hips of the robot fully mounted inside a 3D printed case
Not the best idea to fully assemble a project before fully testing it 😆
Did you connect the ground from the external power supply?
but i did test it before and it was working fine
yes i have
Those two white boxes
Inside the joints
Are the two boards
when i reset the board it says this and stops
this with the pins removed
it starts working
@eternal cloud i dismanteled everything, now its the moment i connect SCL it stops responding
Does anyone know if the neopixel lib can work with esp32s3?
My guess is it's miswired inside the robot
i tried looking inside it
i removed everything
tried again with only one servo connected, doesnt work
tried with a single board (without the other one connected) that doesnt work either
This seems like a pretty basic problem. So you have an Arduino, and a servo board, and nothing else?
115200
hello guys
need help
can i use Arduino PRO-MICRO for LED
my LED is 5v
and im not sure which hole to connect to battery 5v
in uno is a rounded hole i dont know if yours have that
hmm i never worked with one of that but i will try to serch on web
I have several adafruit esp32s3 reverse tft feather boards. Things seem to work ok with the board until I plug in a SPI device into the QT port, in this case a SHT41 temp/rh sensor. Then the display backlight never turns on during a boot, it seems to boot loop 10 times, then go to safe mode. Does anyone have suggestions on what I'm doing wrong?
Gemini told me this:To connect an Arduino Micro to a 5V battery, you'll need a few components:
1. Arduino Micro: This is the microcontroller board you'll be using.
2. 5V Battery: This is the power source for your Arduino.
3. Battery Holder: This will securely hold the battery in place.
4. Wires: These will connect the battery to the Arduino.
5. Resistor (optional): If your battery voltage is higher than 5V, you'll need a resistor to regulate the voltage to 5V.
Steps:
-
Connect the Battery:
- Place the battery in the battery holder.
- Connect the positive terminal of the battery to the positive terminal of the Arduino (labeled "VIN" or "5V").
- Connect the negative terminal of the battery to the ground terminal of the Arduino (labeled "GND").
-
Add a Resistor (if necessary):
- If your battery voltage is higher than 5V, calculate the appropriate resistor value using Ohm's Law: R = (Vin - Vout) / I.
- Connect the resistor between the positive terminal of the battery and the "VIN" or "5V" pin on the Arduino.
-
Check Power:
- Connect a LED to the Arduino's digital pin and ground.
- If the LED lights up, the Arduino is receiving power from the battery.
Note:
- Ensure that the battery you're using can provide enough current to power the Arduino and any connected devices.
- If you're using a rechargeable battery, make sure to use a suitable charger.
- For safety reasons, it's recommended to use a battery holder and wires that can handle the current of your battery.
By following these steps, you should be able to successfully connect your Arduino Micro to a 5V battery.
but i cant find the label "VIN" or "5v"
Probably port vcc Will do the same
....
so ....
the positive battery connect to the "VNN"
and the negative to the "GND"
?
is it correct?
Yup
What are you trying to do exactly?
trying to program a LED prop.
using 5v LED strip , light up with a battery 5v using Arduino pro micro
now i cant find the port to connect with the 5v battery positive
What type of LED? Can you show a pic of the strip / link ?
And what type of battery ?
yes, we call these "neopixels", you control them with 1 pin of data.
and the battery ?
Please take note of the ChatGPT advisory when using any chatbot for technical advice. An image is shared here for convenience but the original message can be found in the #welcome channel.
Unless you can personally verify the contents, please do not share chatbot results as technical advice, either.
Presumably your Arduino Pro Micro has a pad labeled something like "5V" or "VIN" or somesuch.
5V should go to VCC. VIN is the 7-12V input on the UNO, and it appears to be labeled RAW on the pro micro.
This seems to be a clone of the Sparkfun pro micro, i hope it can take 12V in RAW
I'd hope so too
Turns out I only have 9v battery 😭
It didn't label any port
I wouldn’t use a 9V battery as a power source due to its high ESR, aka low current capability.
Oh it's call neopixel alright got it, I will noted it down
9V battery isn't a great option for powering outside of things designed to run using micro amps of current. Low power capacity, low max current delivery make it a bad choice for anything power heavy like running LEDs.
Several AA batteries in series would work best, if you have a battery holder for them.
How about a power bank?
Power bank via USB works great.
No soldering required.
The output and in put is 5v
With a USB cable, yes. USB carries 5V power.
You can solder a switch to RST and GND. Connect the two to power off, disconnect to power back on.
If you really want to cut all power though, it’ll have to be inline to the cable.
And how do I connect my Arduino pro micro with the neopixel strip?
Which cable to which port?
So sorry asking to much question and advice, this is my 1st time 🙇♀️
Trying to learn
Weird, it's not lighting up
Did you try your arduino with a computer? Did it light up then?
And is the power bank charged?
Yes is changed
The Arduino only light 1 red. The back it doesn't
That red LED should be on if you plug it in the power bank too. Probably the power bank doesn't start yet, since the current consumption is too low -- some power banks do that, they turn off when there is no charge on them
hrmmm i would charge my power bank longer
It should work fine when you connect the neopixel strip
i see
If your power bank can charge a phone, it should work fine once you add the lights.
alright
got it
so which ardunio port need to connect to thje neopixel wire?
Too add the neopixel strip, you connect
- the power from the strip (probably called VIN) to VCC on the Arduino ,
- GND on the strip to a GND on the Arduino, and
- DIN on the strip to any data pins on the Arduino
I recommend reading this guide, it explains a lot about these LEDs https://learn.adafruit.com/adafruit-neopixel-uberguide/basic-connections
I see that your board doesn't have any headers, so you will need to solder the wires, or some headers to the board.
And you will specify in code what data pin you used... these types on LEDs do not light up without code.
https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library-installation
yes this i understand
"The power from the strip? means the wire from the 5v strip?"
The one +5v?
Oh, yea, it's labeled +5V on this strip
yep, that's the one
It can be labeled differently, sometimes it's VIN or smth
same thing 🙂
Alright got it
watch the colors, cos you seem to have many wires there
i will test it on a breadboard
2 reds, 2 whites, and a green?
got it sir.
No idea
I think the green is for the DIN
yea, there are 2 red for power, 2 white for ground and the green one for data
the extra power and ground are if you want to use a separate battery for the LED strip -- if there are too many of them, they cannot be powered directly from an Arduino
but you can ignore them
Can someone help me? i have been trying to do an rc car code
which uses a NRF24 module ,a tb6612fng driver and a servomotor to control the direction
and for the controller im just using 2 joystick module one to make it advance forward and backward an the other one to control de servo
What do you need help with? Do you have any issues with your code?
Adafruit doesn't have any guides using these modules, but you can get some basic introduction here: https://learn.sparkfun.com/tutorials/tb6612fng-hookup-guide/all#library-and-example-code and here: https://learn.sparkfun.com/tutorials/nrf24l01-transceiver-hookup-guide#arduino-code
There are also full projects https://howtomechatronics.com/projects/diy-arduino-rc-transmitter/ and other tutorials https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/
https://www.instructables.com/search/?q=nRF24L01
yeah the servo and the motor doesnt do anything
Is the microcontroller starting up?
does anyone know how to get the arduino protomaker working with a 64x64 screen? having issues with same sample code
i've set the address lines variable to 5
but it's all glitched
Which screen? Do you have the jumpers set correctly?
I think you need to install the NeoPixel library
yes, please guide me
figured out the issue, i changed the # of address pins but didn't actually specify the last pin number haha, thanks for the troubleshooting though
had to cross reference between programs that did and didn't worked
There's a learn guide here that explains how to install the NeoPixel library https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library-installation
Smart!
is it possible to get the matrix portal m4 to work over bluetooth in arduino? it theoretically should be possible given that it's possible with circuitpython and it's an esp32 chip, just not sure how to do it/where to start
Are any of you guys familiar with a service like Fiverr or similar small task marketplace for getting help with coding tasks?
Specifically ESP32 / Arduino IDE?
I'm working on a project which needs to transfer a small amount of data over ESP NOW and I have some trouble which might take me a long time to figure out by myself (even with the wonderful advice often available online), so I'm trying to find a quick way to implement this functionality so I can finish my work in a reasonable amount of time.
It's hobby, by the way, not school or work 🙂
but i still confused with this
You can see here: https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/all#hardware-overview-pro-micro
Your board is a clone of the Sparkfun pro micro, so it should work the same -- there isn't a regular enable / disable pin.
But there is a RST pin that says:
RST can be used to restart the Pro Micro. This pin is pulled high by a 10k&Ohm; resistor on the board, and is active-low, so it must be connected to ground to initiate a reset. The Pro Micro will remain "off" until the reset line is pulled back to high.
So if you connect an on/off switch between RST and GND, it should work to power the board off when the connection is closed, and back on when the connection is open (it's the opposite way an on/off button usually works, but it will work)
Has anyone worked with the MPR121's interrupt pin? I am trying to know when to get a reading from the chip, and am seeing it trigger when it detects a change, but I can't figure out how to get it to reset. All the documentation I have found says it should rest after the data is read, but I am receiving the data and the interrupt pin is not resetting itself. I am struggling to find exmplaes online of anyone using the interrupt pin.
It should reset after sending a read command over i2c. How are you receiving the data?
Like this
if(cap.touched() == 1){
//code goes here
}
This is my complete code
#include <Wire.h>
#include "Adafruit_MPR121.h"
//Set interupt pin
int irqpin = 5;
//Create MPR121 Device
Adafruit_MPR121 cap = Adafruit_MPR121();
void setup() {
Serial.begin(115200);
Serial.println("Starting.....");
//Setup interupt pin
pinMode(irqpin, INPUT);
digitalWrite(irqpin, HIGH);
while (!Serial) {
delay(10);
}
Serial.println("Adafruit MPR121 Capacitive Touch sensor test");
// Default address is 0x5A, if tied to 3.3V its 0x5B
// If tied to SDA its 0x5C and if SCL then 0x5D
if (!cap.begin(0x5A)) {
Serial.println("MPR121 not found, check wiring?");
while (1);
}
Serial.println("MPR121 found!");
}
void loop() {
Serial.println("Starting Loop");
delay(1000);
if(!(digitalRead(irqpin))){
Serial.println(cap.touched());
if(cap.touched() == 1){
Serial.println("Starting Audio");
}
}
}
Try adding something like cap.readRegister8(0); in your touched block
hey all - I'm using AccelStepper in a project and just realized I should probably use a timer to call stepper.run() on a regular basis while movement is in progress.
So I made a volatile Boolean to tell the timer handler whether it was necessary or not (it's set in the code which also determines direction and target). Then I thought, should I disableTimer when it's not moving? And then...
I realized, I don't need the Boolean flag, just enable and disable the timer. Then - hey, why not make the timer handler the stepper.run() command itself, rather than some IRAM_ATTR function?
Suggestions? Maybe I can't reliably call stepper.run right from the timer constructor, I dunno. But this is a project that will typically be idle for hours if not days at a stretch, no need to keep the timer running every ~5ms at any rate....
Just tried this. It still doesn't seam to clear the irq pin
I am using a pico as a usb mouse for a project, I want to quickly make it wireless. Is there any adapter that can act as a USB reciever/tranciever that is relatively small and cheap
There are inexpensive USB Bluetooth adapters, but I don't know if a Pico can talk to one. However, a Pico W can support Bluetooth so that might be a way forward.
I was trying to use bluetooth but I haphazardly wrote most of my code in CircuitPython before checking how well it can handle bluetooth, and turns out adafruits official ble library doesnt support the pico w
Well... you did ask in the Arduino channel, I guess people assumed you'd use that, haha
yeahhh I couldnt find a better channel for it so opened saying pico both times. (the closest is linux-sbcs but the pico fits best under arduino imo)
I'm not able to connect to my feather rp2040 via the arduino IDE except when it's in bootselect mode.
I can put the board in bootselect and see the drive appear in my OS, then in the IDE under Tools > Port: I can select 'UF2 Board', and then uploading a sketch works fine.
But after that I don't see any connection to the board, and I don't seem to be able to upload another sketch. There aren't any selections available in Tools > Port: anymore, and trying to upload sketch fails with Scanning for RP2040 devices No drive to deploy.
Am I right to think I shouldn't need to manually put the board in bootselect mode every time I want to upload a sketch?
I'm using the Arduino IDE v 1.8.19, on Linux Mint 21.3, to program my Feather RP2040 (id: 4884). I was following this guide [https://learn.adafruit.com/rp2040-arduino-with-the-earlephilhower-core/overview] at first but I've looked at a few others trying to figure this out.
How did you install Arduino on Linux? Reading https://github.com/earlephilhower/arduino-pico there may be some permission issues when installing Arduino through an App Store.
I installed Arduino as a system package, not as a flatpak.
See this explanation: https://arduino-pico.readthedocs.io/en/latest/install.html#uploading-sketches
Hey folks,
I purchased 2 Adafruit OV5640 breakout boards.
Im having a hard time finding a wiring diagram that shows how to wire it up to a ESP32 Dev Kit V1 (WROOM) chip.
Does anyone have any insight on this?
There aren't wiring diagrams for all the possible boards out there, but this is the pinout for the breakout board, with explanations, and some examples of usage https://learn.adafruit.com/adafruit-ov5640-camera-breakout/pinouts
Thanks. Will take a look
I got the camera wired up and connected, however, I'm unable to capture an image.
It seems to not be getting the frame buffer
If fails in this condition
camera_fb_t* fb = esp_camera_fb_get();
if (!fb) {
Serial.println("Camera capture failed");
esp_camera_fb_return(fb);
return;
}
I was originally using a ESP32-WROOM chip and figured it could be a memory issue.
Now I'm trying a WROVER chip and enabled PSRAM, but still no luck.
Could it be a wiring issue even though the camera is being detected successfully?
After a lot of time spent, i found the issue.
pixel_format = PIXFORMAT_JPEG
The format does not seem to work.
Seems like it's a known issue based on Github
https://github.com/espressif/esp32-camera/issues/43#issuecomment-808745113
Good catch
@worthy thistle if you can get the xbox 360 host working. can you add the ability to turn the HID out, into a nintendo switch wired pro controller please?
Good question, @violet oak I know the GP2040-CE firmware can output Switch control, just not sure about the host side of it as input from Xbox 360
I'm trying to get a TinyUSB example that lists my device info to work with the RP2040 USB Host feather and a Logitech steering wheel, but for some reason it's just not displaying the information. I got it to display information about a USB receiver and an SD card adapter but not the wheel. How can I get the steering wheel to connect with the feather? I think the wheel model is a Logitech G920.
On my PC, it displays as an Xbox peripheral:
is this (https://github.com/OpenStickCommunity/GP2040-CE/tree/main/headers/drivers/switch) what i need to emulate switch controller with tinyUSB?
hey all im making a rocket and need to select a breakout 9-DOF Orientation IMU board but cant find one that has a accelerometer rating of 32g, could yall help me pick a board out
hi, can please seomeone help me use arduino uno r4 with l293d motor driver?
https://www.adafruit.com/product/4692 with separate magnetometer board https://www.adafruit.com/product/4479 ?
Behold, the ST LSM6DSO32: The latest in a long line of quality Accelerometer+Gyroscope 6-DOF IMUs from ST. This IMU is like a big sister to the LSM6DSOX; it has the same pinout and ...
?
What help do you need? Wiring? Software? What are you driving? Solenoid? DC motor? Stepper? Something else? Have you looked at https://learn.adafruit.com/adafruit-raspberry-pi-lesson-9-controlling-a-dc-motor?
Er, for a Uno, this might be more relevant https://learn.adafruit.com/adafruit-arduino-lesson-15-dc-motor-reversing
so i am controlling 4 dc motors, i also have this driver, i tried controlling it with arduino uno and it works but it doesnt work with arduino uno r4 as i see that the afmotor library isnt compatible
Hmm, that shield uses a shift register, so you'd presumably use the shiftout library to send data to that
The afmotor library is archived,~~ try the new version https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/install-software~~
Ah, didn't know that, that's a much better idea
is this compatible?
i tried it, it didnt give me an error like the last one but it said in the serial monitor: "Could not find Motor Shield. Check wiring."
The DK motor shield is different from the AdaFruit one. The AdaFruit one uses an I2C chip to control the motor drivers. The DK one uses the aforementioned shift register.
I guess not
The DK motor shield seems to be a clone of the Adafruit's "now ancient V1 Motor shield"
then what driver shield should i use that is compatible with the arduinouno r4?
The library isn't compatible with R4, the shield itself is -- just not as easy to code as using the library. You can look into what madbodger said about the shiftout lib.
If you want a different shield, with library, this one https://www.adafruit.com/product/1438 uses different chips and communicates to the Arduino over I2C
so that shield will work with my r4 and through that library?
isnt there a cheaper shield?
i just wanna make a simple wifi car
Does anyone know if there's a way for me to store data on internal flash memory using littleFS?
Yep that’s exactly what I decided to do
I'm working with an esp32 WiFi airlift breakout: https://www.adafruit.com/product/4201 and note that while the WiFiServer class has a begin() method, there's no corresponding end() call to shut down the server. What options, if any, exist to close down the server so it's no longer listening.
One possibility I've considered is to make the WiFiServer a function scope variable, so that its dtor() gets called on return from the function that handles incoming connections. Would this work?
If the old library depends on shiftout, it should be simple enough port it to the R4 - I'm pretty sure the R4 supports shiftout
ok i will try it but i have not done it before
i dont know if i will know how to do it
How can I send a raw report to an HID device from TinyUSB? tuh_hid_set_report() and tuh_hid_send_report() don't seem to send just raw data but rather HID specific data, I could be wrong though and my commands just aren't working.
do you mean "from" or "to" an HID device?
Sorry, "to" a device.
so sending from a host to a device, via a feature or OUT report
"raw" HID is usually just 64-byte reports, without a report ID
how is tuh_hid_send_report() making the data HID specific?
I think so, but I can't figure out how I would do that with tinyusb.
I'm not sure, the commands specified in the Logitech documentation weren't working with that command.
RP2040 Feather with USB Type A Host, and the device is a Logitech G920 Xbox Steering Wheel.
It has an Xinput mode, but also a HID++ mode which I am trying to use.
I'll see if I can find the PDF again with the command I need, but it said the command was 0x05 to disable the centering spring, combined with bits 11110000 which are mapped to each "slot" in the device.
If I want to send a custom HID command, would I do it like this?
const uint8_t autocenter_off[] = {0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
tuh_hid_send_report(dev_addr, instance, 0, &autocenter_off, sizeof(autocenter_off));
I'm not really sure what report_id is supposed to be
Alrighty
Need some help with a Df player mini problem
I’m following this person guide in a Samus arm canon led/sound fx build
I followed the diagram but it seems like the Df player mini just turns off the entire circuit when I plug in the pins to the corresponding pins on the board
But it works with the led animations with the button presses work n everything when I exclude the Df player mini (ofc it won’t play the sound fx)
Turns off the entire circuit sounds like a wiring problem where it's short circuiting the power supply somehow
Gotcha
Already did
I’m just confused
Idk if the arduino needs more power or solder a capacitor to the 5V and grnd wires
Do you have a multimeter?
That makes it trickier. You can try powering the DF separately with something like a USB charger
You don't have a random USB charger around?
Note: the $5 multimeters at Harbor Fright are actually usable
I do
I found these in pcb files. How can I find connectors for them?
It would be helpful if you mentioned what exactly is that board, and check if there are ready made cables for it.
You can search for the connector on component sites like DigiKey, but you will most likely have to crimp the cables yourself.
This is probably better suited for https://discord.com/channels/327254708534116352/656770973852237844
Does anybody know if a fingerprint sensor (such as https://www.adafruit.com/product/751) which operates via UART and has libraries made for Arduino and CircuitPython, can be easily integrated to work on Raspberry PI 4/5? How much work would it be to rewrite the library from these two into RP?
It works fine with Raspberry pi, and the product guide describes how to do it https://learn.adafruit.com/adafruit-optical-fingerprint-sensor/circuitpython
You can use the CircuitPython lib through Blinka https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
(not the best channel for this question tho, since not Arduino related)
the associated guide shows rpi usage example:
https://learn.adafruit.com/adafruit-optical-fingerprint-sensor/circuitpython
Thanks i'll post it over there!
Anyone know how I can translate this function to work in TinyUSB as host? I tried replicating hidpp_ff_queue_work() with tuh_hid_send_report() but it didn't work.
https://github.com/torvalds/linux/blob/68e5c7d4cefb66de3953a874e670ec8f1ce86a24/drivers/hid/hid-logitech-hidpp.c#L2738
I managed to recreate most of it, it's just the actual fuction for sending the report seems to be very different
Here's what I have so far:
#define HIDPP_FF_EFFECT_SPRING 0x06
#define HIDPP_FF_EFFECT_AUTOSTART 0x80
#define HIDPP_FF_EFFECTID_AUTOCENTER -2
#define HIDPP_FF_DOWNLOAD_EFFECT 0x21
static void set_autocenter(uint8_t dev_addr, uint8_t instance, uint16_t magnitude)
{
uint8_t params[18];
Serial.printf("Setting autocenter to %d.\n", magnitude);
/* start a standard spring effect */
params[1] = HIDPP_FF_EFFECT_SPRING | HIDPP_FF_EFFECT_AUTOSTART;
/* zero delay and duration */
params[2] = params[3] = params[4] = params[5] = 0;
/* set coeff to 25% of saturation */
params[8] = params[14] = magnitude >> 11;
params[9] = params[15] = (magnitude >> 3) & 255;
params[6] = params[16] = magnitude >> 9;
params[7] = params[17] = (magnitude >> 1) & 255;
/* zero deadband and center */
params[10] = params[11] = params[12] = params[13] = 0;
params[0] = HIDPP_FF_DOWNLOAD_EFFECT;
tuh_hid_send_report(dev_addr, instance, HIDPP_FF_EFFECTID_AUTOCENTER, params, sizeof(params));
}
I don't know how to fix that but you could use bitfields to make the code a little more readable
Context: Itsy Bitsy M0 onboard SPI Flash
I am attempting to use the Adafruit_SPIFlash arduino library with the Itsy Bitsy M0 board. When I check teh results of getJEDECID() it returns 0xFFFFFF indicating the flash interface did not initialize. Checking the reported flash size returns 0.
Below is the code snipet with configuration:
#define CUSTOM_MISO PIN_PB03
#define CUSTOM_MOSI PIN_PB22
#define CUSTOM_SCK PIN_PB23
#define CUSTOM_CS PIN_PA27
#define CUSTOM_SPI SPI1
#include "SPI.h"
#include "Adafruit_SPIFlash.h"
Adafruit_FlashTransport_SPI _flash_transport(CUSTOM_CS, CUSTOM_SPI);
Adafruit_SPIFlash _flash_device(&_flash_transport);
static bool _flash_inited = false;
void flashInit() {
if (_flash_inited) return;
_flash_device.begin();
DEBUG_PRINTF("flashInit():\n");
DEBUG_PRINTF(" JEDEC ID: 0x%06X\n", _flash_device.getJEDECID());
DEBUG_PRINTF(" Flash size: %d\n", _flash_device.size());
_flash_inited = true;
}
The output is:
Unknown flash device 0x0
flashInit():
JEDEC ID: 0xFFFFFF
Flash size: 0
Suggestions, code changes, and advice is appreciated.
I don't see your CUSTOM_MOSI, etc. pin defs used anywhere. Are they checked in the .h files you're including? I'm thinking it's not using the pins you want it to
@stable forge - I have them for my own reference but there does not appear to be any way to specify them when configuring Adafruilt_SPIFlash().
You are passing CUSTOM_SPI, so you can customize that instance of the SPI class.
@stable forge - I cound not find how to customing SPI other than what the Itsy Bitsy M0 example code does which is to use SPI1.
and read the whole guide to make sure you can use the pins you want to
because which pins you can use is limited
Let me cross check teh datasheet with the pins used on the itsy bitsy m0 to determine which sercom it is attempting to use
This might be handy:
some discussion of SPI pins here: https://learn.adafruit.com/introducing-itsy-bitsy-m0/pinouts#spi-flash-and-dotstar-2989068
see last paragraph. Maybe that is what you are doing already
based on the itsy bitsy m0 schematic, the pins being used for the SPI flash all belong to SERCOM5. I will create an SPI interface on SERCOM5 with the given pins. 🤞
https://learn.adafruit.com/introducing-itsy-bitsy-m0/using-spi-flash says SPI1 should be the right pins for the flash chip
there is an example program there
yes, I was using that learning guide.
#define FLASH_SS SS1 // Flash chip SS pin.
#define FLASH_SPI_PORT SPI1 // What SPI port is Flash on?
Adafruit_SPIFlash flash(FLASH_SS, &FLASH_SPI_PORT); // Use hardware SPI
note it is not using Flash_transport
did you try any of the example programs in the library?
I did try several permutations from the exmples.
did the examples work?
you should not need to edit them, I think, except maybe choosing SPI1
no examples worked.
BTW: the constructor no longer takes a CS pin and SPI
so at least some of the content is out of date.
the examples use the transport to change configuration
so it's jsut the learning guide which is out of date.
Could you open an issue and give guide feedback as appropriate? I'd have to start from scratch on debugging this then, sorry. But I think SPI1 out of the box should work for you.
let me get things working first 🙂
there may be other working uses of that library you can crib from. Maybe a GitHub search or a search of https://github.com/adafruit/Adafruit_Learning_System_Guides will help
I have been looking. I only came to this channel because - after 4 hours of reading and trial and error - I hoped someone had a lightbulb for me. I'll keep digging.
I suspect it is a configuration issue because I am having similar issues with other SPI flash libraries (although they are much older and may have other issues).
@stable forge - when I finally get to opening a ticket on the learning guides, it will likely hit most of the M0 boards as I am seeing the same cut/paste error on several.
The page may be shared ("mirrored"), so fixing it one place will fix all. You can use the "Feedback? Corrections?" link in the left sidebart
there is a small amount of board-specific content on the pages which is why I was guessing a copy/paste scenario.
we have a "templating" system for Learn Guides; that page may or not be templated
Well, first task is getting the onboard SPI flash working. Then I will have accurate data for any errata to the learning guides.
@stable forge - the more I dig, the more confused I get ...
I looked at the variant.h file for the Itsy Bitsy M0. this is part of what gets loaded by the Arduino board manager.
In the file, it assigns the physical pins to teh definitions. Here is what it shows for SPI1:
#define PIN_SPI1_MISO (36u)
#define PIN_SPI1_MOSI (37u)
#define PIN_SPI1_SCK (38u)
#define PERIPH_SPI1 sercom5
#define PAD_SPI1_TX SPI_PAD_2_SCK_3
#define PAD_SPI1_RX SERCOM_RX_PAD_1
static const uint8_t SS1 = 39 ; // HW SS isn't used. Set here only for reference.
static const uint8_t MOSI1 = PIN_SPI_MOSI ;
static const uint8_t MISO1 = PIN_SPI_MISO ;
static const uint8_t SCK1 = PIN_SPI_SCK ;
The problem is the SAMD21G18 does not have a physical pin 36. Further, the Adafruit schematic shows the FLASH_MISO on physical pin 48.
So, I have no idea how the example(s) are working. (more digging will ensue)
... but to be clear, I can get example(s) to work ... hence my confusion 🙂
The pin numbers are not the pin numbers on the package. In the attached screenshot, the pin numbers inside the box are uninteresting unless you are designing a circuit board.They instead represent PAxx or PBxx pins. Also they can be remapped. I'm looking for the reampping
so that, for instance, pin 13, which is very often the red LED blinky pin, is not necessarily PA13
hence all of my confusion. the schematic is using physical pin 48, which on that picture is PB03. I have not idea what mapping is being used if it is not physical pins.
yes, I'm saying that 36 is not the 36 in the Arduino code.
that's just counting the pins around the package.
look in the variant.cpp file. In there, there is a table of pin numbers to actual pins. For instance, the very first one, [0] in g_APinDescription[], is PORTA, 11, aka PA11. So on this board, pin 0 in Arduino code maps to PA11.
const PinDescription g_APinDescription[]=
{
// 0..13 - Digital pins
// ----------------------
// 0/1 - SERCOM/UART (Serial1)
{ PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // RX: SERCOM0/PAD[3]
{ PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // TX: SERCOM0/PAD[2]
...`
I am not looking at the high leverl "user" arduino code. I am looking at the board configuration which is the low level mapping of the chip to things the high leverl user code can reference.
yes, you have to refer to the PAxx and PBxx pin numbers for that. And those numbers can be completely different from the integers used as Arduino pin numbers. And those numbers also have nothing to do with the physical pins on the chip.
I think I just need to accept that I can get teh example to work, regardless of the confusion
there are three different designations for a particular pin.
it's important to understand this
- The physical pin number on the chip, counting around the outside
- The PAxx or PBxx (or other) pin number that the physical pin is connected to
- The arduino pin number (an integer), which is yet another number.
yes. tht is my understanding as well.
here is part of the table in variant.cpp for the itsy m0 board:
// 36..38 - Secondary SPI
// ----------------------
{ PORTB, 03, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SPI Flash MISO
{ PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SPI FLash MOSI
{ PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SPI FLash SCK
// 39 Secondary SPI SS
{ PORTA, 27, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_15 }, // SPI Flash SS
it is my understanding that each board configuration (it's variant.* files) map the physical pins to the arduino numbers.
so 36 in Arduino is PB03, 37 is PB22, etc.
and that 36 has nothing to do with the white numbers in the screenshot above
but "36" was not an arduino number. it was a physical number.
just as was 37 and 38 and 39 (which correspond to PB22, PB23, and PA27)
No, the 36 .. 38 in the code I pasted above are the arduino pin numbers. Nobody is using the physical numbers in the arduino code
36 etc. are just the index value of the table in variant.cpp
sorry, I do not think I am being clear
I am not in the "user arduino code". I am looking at the board configuration "variant.h" file.
that doesn't use physical pin number
#define PIN_SPI1_MISO (36u)
look up the 36th entry in the table in variants
variant.h also is arduino. It doesn't know anything about the metal pin number
if you want physical pin number, you'd want to take the resulting port value and find it in the pinout diagram
OK. that was my incorrect interpretation
// 36..38 - Secondary SPI
// ----------------------
{ PORTB, 03, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE },
the purpose of variant.* is to map an arduino integer pin number to an actual PAxx or PBxx number
so 36 would be whatever physical pin PORTB03 ends up on
which can vary depending on chip variant
on the board, not the chip
well, the good news is that (1) I have working code; and (2) I can now go look at the learning guides and see if there are any errata to submit.
sorry, it is very confusing. There are pin numbers on the chip package, the chip itself (tiny wires internally from chip to package), and the board
you're welcome!
pin nomenclature is a never ending source of confusion, unfortunately. for everyone.
pin nomenclature gets even more confusion when a person is board developer and firmware developer ... which is where I sit most of the time.
it was a mistake for Arduino to use integers instead of names for pins. They have A3 for an analog-capable pin, but 3 for a digital pin, and they are different! If the digital pins had been called Dx it would have helped a little.
It's even more confusing on a Pi where there are (at least) two different GPIO pin numbering schemes in use.
Create this folder move the file.
The "OK" button will do this for you
https://learn.adafruit.com/adafruit-128x64-oled-featherwing/arduino-code I'm using this guide for an OLED featherwing and I think I'm missing something simple about the SH110X library. display.clearDisplay() turns everything printed on the screen black but it doesn't return the cursor to the top left, so after printing out a few lines of data I can't see anything new on the screen unless I power the device off and start the program again. I want the screen to display a few data points and update them each time the program loops, is there a method that I'm missing?
is there a method that I'm missing?
Yep, it's right there in the code example: display.setCursor(0,0); 🙂 @wise barn
I swear that wasn't there 30 seconds ago. Thank you!!
Welcome to the L298N Arduino tutorial. In this video, we are going to learn how to control a DC motor using an Arduino board. We are going to use a small and inexpensive module that features the L298N motor driver chip.
🛒 Arduino Uno ▶ http://educ8s.tv/part/ArduinoUno
🛒 L298N Driver ▶ http://educ8s.tv/part/L298N
🛒 2 DC Motors ▶ http://educ8s...
Using this dc motor sample code but when I try to run it all I’m getting is redefinition errors
Like answered before, each Arduino main code file -- the one containing setup() and loop() -- needs to be in a folder with the same name, and that is one Arduino sketch.
You have two main files in the same sketch there, and both are trying to run at the same time.
You need to create a new sketch, and move one of the code files.
Hi everyone, I'm really struggling to get JTAG debugging working on the Qualia ESP32-S3 RGB666 with PlatformIO. https://forums.adafruit.com/viewtopic.php?t=213533
Does anyone know how to get it running. It is so difficult to develop on this board when there is no GDB available
We also have found this difficult when debugging CIrcuitPython. We end up doing a lot of logging.
I tried it with a J-Link
Hullo. Does anybody know whether its possible to use all of the 3 buttons on a ESP32 REV TFT to wake it up from deep sleep?
do you mean press any of the buttons, or must press all?
any. (will do different things depending on which was pressed). i forget, but they have to be listed in as RTC buttons in esp32 and then theres something about pullup or down (EXTernal wakeup). the reason i ask is that on the adafruit OLED (128x32) one button had a physical pullup to my memory.
do you mean ESP32-S3 reverse TFT?
yes sir
These two pins are pulled LOW by default, e.g. when not pressed, the signal is low. When pressed, the signal goes HIGH. This is required to wake the ESP32-S3 from deep sleep.
which means you cant use D0 for weak up?
D0 is also used to get into boot mode, so D1 or D2 are better choices
I don't remember if going high is required. I need to look
some discussion of PinAlarm here: https://learn.adafruit.com/deep-sleep-with-circuitpython/alarms-and-sleep#pinalarm-deep-sleep-3081649
you may be able to use D0 as well, but it triggers going low rather than high
the code handles both cases. There are some restrictions: only one pin can go low to set off an alarm, but multiple pins can go high. There is a message in the code "Can only alarm on one low pin while others alarm high from deep sleep.". I wrote this code, but it was years ago.
ESP32 and ESP32-S2/S3 are different.
well, this is now arduino not cpy. its this part i have trouble understanding:
you can use ESP_EXT1_WAKEUP_ANY_HIGH on D1 or D2.
is there an arduino library for this? I would think there would be
Here is the CircuitPython code if it would serve as an example for you: https://github.com/adafruit/circuitpython/blob/main/ports/espressif/common-hal/alarm/pin/PinAlarm.c
Trying to get an SSD1306 OLED screen working with an Arduino Opta via its expansion port using this adapter [https://www.tindie.com/products/35482] and the Adafruit_SSD1306 library [https://github.com/adafruit/Adafruit_SSD1306]. Works well (with different code) when it's just the Arduino Opta brick, but when I add the SSR expansion module via code listed below, it compiles, loads, then gives me a blinking red light which indicates a problem. Have tried different I2C addresses, and it still gives me this issue. Any ideas on how I can get around this would be appreciated.
#include <SPI.h> //needed??
#include <Wire.h>
// Took out display code per apparant I2C conflict
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
#include "OptaBlue.h"
using namespace Opta; //not sure what this is for, but in examples
DigitalStSolidExpansion stsolidExp;
void setup() {
OptaController.begin(); //maybe needed for SSR expansion? Not sure.
stsolidExp = OptaController.getExpansion(0); //expansion at index 0 is solid state relay needed???
pinMode (LED_BUILTIN, OUTPUT); // Set Arduino board pin 13 to output
// Took out display code per apparant I2C conflict
display.clearDisplay();
display.setTextSize(1); // Normal 1:1 pixel scale
display.setTextColor(SSD1306_WHITE); // Draw white text
display.setCursor(0, 0); // Start at top-left corner
display.cp437(true); // Use full 256 char 'Code Page 437' fon
display.setRotation(1); //rotates the screen 90 degrees
}
void loop() { // Main loop
}
Looking at this a bit further, this sets things up to run, but doesn't actually do anything with the SSD1306 OLED:
#include <SPI.h> //needed??
#include <Wire.h>
// Took out display code per apparant I2C conflict
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_RESET LED_BUILTIN // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
#include "OptaBlue.h"
using namespace Opta; //not sure what this is for, but in examples
DigitalStSolidExpansion stsolidExp;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
OptaController.begin(); //maybe needed for SSR expansion? Not sure.
stsolidExp = OptaController.getExpansion(0); //expansion at index 0 is solid state relay needed???
//display.clearDisplay(); //TAKE THIS OUT AND RUNS (BUT DOES NOTHING W/ SSD1306)
display.setTextSize(1); // Normal 1:1 pixel scale
display.setTextColor(SSD1306_WHITE); // Draw white text
display.setCursor(0, 0); // Start at top-left corner
display.cp437(false); // Use full 256 char 'Code Page 437' fon
display.setRotation(0); //rotates the screen 90 degrees
}
void loop() { // Main loop
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
How did you handle segfaults in absolutely random places. I found some flags to which has allowed me to backtrace the source of crash -DARDUINO_USB_MODE=1 but full GDB functionality would be great!
Having a similar problem myself with the Feather ESP32-S2 and PlatformIO. I'm not trying to do JTAG, but I can't even get a backtrace to print to the console or figure out how to output a core dump. It's driving me nuts because everything I look up online seems to indicate I should see a backtrace in the console whenever there's a crash, but instead the MCU just silently reboots.
The UART serial COM port is different to the USB-CDC COM port. Now I don't quite remember what setting it is to see the COM port where the back trace occurs but you want to have some of these flags in platform.ini ```[env:adafruit_qualia_s3_rgb666]
platform = espressif32
board = adafruit_qualia_s3_rgb666
framework = arduino
build_flags = -O2 -DDEBUG -std=c++17 -DARDUINO_USB_MODE=1
upload_speed = 2000000
upload_port = COM8
monitor_port = COM10
monitor_filters = esp32_exception_decoder, log2file
monitor_speed = 115200
debug_tool = esp-builtin
debug_init_break = break setup
debug_load_mode = manual
build_type = debug
You're probably onto something that I need to know which port the back trace occurs on, but I haven't been able to figure out how to do that. I think I've got the relevant settings in my platform.ini (other than the monitor_port, because I have no idea what it should be).
(For what it's worth it also doesn't print the backtrace in Arduino IDE either, and again, from everything I see online it just...should?)
Apparently I didn't call display.begin() as shown in Adafruit's library example. Here's the fixed code for your edification: https://github.com/JeremySCook/arduino-experiments/blob/main/opta/opta-ssdexpansion-ssd1306.ino
Not nessesarily, it depends which COM port
Hmm. I'm pretty much out of ideas sadly. I spent about 8 hours yesterday just trying to figure out how to print out a dang back trace with no luck. I literally don't see any other com ports available (using a Mac if it makes any difference) and of the scant few posts on the internet I've found of other people with this issue, nobody seems to have found a solution. And the rest of the posts are like "I keep getting this backtrace but I don't know what it means" and boy would I sure love to at least have that problem right now lol
Hmmmm... sorry yeah. I use a windows machine and device manager usually lists a COM port for me. I have the S3 and I know the S2 has different behaviour. The S3 has thing thing where you have to hold the boot button and the power button to enter bootloader mode. Then it enters COM8 (on my machine)
I somehow set it up in a way (I think with the debug arduino flag) which allows my arduino to print to the UART for logging and print to the COM8 port the ESP32 backtrace and debugging dumps
It's a weird thing where the UART (COM11) is the USB to serial converter and the COM8 is the USB CDC connection
But again the S3 and S2 are different. Might have to look at ESP-IDF docs or the PlatformIO docs and see if there's anything of interest there.
I've been trawling them and I haven't been able to find much helpful. The Espressif docs don't care about PlatformIO and the PlatformIO docs are...not helpful at best, and are incorrect at worst. I tried the ARDUINO_USB_MODE flag but that gave me a bunch of compiler errors related to Serial not being defined. I would gladly just use the ESP-IDF but I need several Arduino libraries.
Have u tried redefining serial?
I haven't, not sure how I would go about doing that
Nothing I put in sdkconfig.defaults (or any other variant) seems to do anything at all, and setting the appropriate build flags directly in platformio.ini produces loads of warnings about those particular flags already being defined in the baked-in sdkconfig.h included with the SDK. Only idea I have left to try is to see if I can use a USB to TTL serial cable to see if the "Debug TX" pin on the feather outputs anything useful, but I am skeptical. Also there is very little info about how to actually use that pin and what it actually outputs.
Yeah I'm not too sure but if there's a debug TX pin then I'm sure that's important and worth investigating. Because that could be the serial that actually has the backtrace on it
That's my hope! 🤞
Sorry for the incoming wall of text...
I did not yet find a solution to the PlatformIO/ESP32-S2 traceback issue, but I seem to have solved the crash I originally needed the traceback for, before I even got a chance to try using the Feather's "Debug Tx" pin. It occurred to me that even though I wasn't able to get a trace, I could maybe use esp_reset_reason() to get a clue about why we were rebooting. It yielded the reason ESP_RST_INT_WDT, which apparently is the interrupt watchdog timer.
Log story short, I am using 3 SPI devices: a LoRa featherwing, an SD card reader, and a 320x240 TFT display. Also, I am using LVGL for my UI. The crash occurred whenever a device received a LoRa message right in the middle of LVGL re-drawing the screen when moving from screen to screen. I know that the Radiohead RFM95 driver uses interrupts when it receives a payload and when it finishes sending a payload. So, I poked around in RH_RF95.h source and lo and behold I find this comment:
/// The RH_RF95 driver uses interrupts to react to events in the RFM module,
/// such as the reception of a new packet, or the completion of transmission
/// of a packet. The driver configures the radio so the required interrupt is generated by the radio's DIO0 pin.
/// The RH_RF95 driver interrupt service routine reads status from
/// and writes data to the the RFM module via the SPI interface. It is very
/// important therefore, that if you are using the RH_RF95 driver with another
/// SPI based deviced, that you disable interrupts while you transfer data to
/// and from that other device. Use cli() to disable interrupts and sei() to
/// reenable them.
So in my lvglFlushDisplay callback, I wrapped the line:
display.drawRGBBitmap(area->x1, area->y1, (uint16_t*)pixels, w, h);
with a cli() and an sei(). That seems to work around the crash. For whatever reason I guess there is some conflict when trying to receive data and draw at the same time that was causing one of those libraries/hardwares to hang, eventually tripping the interrupt watchdog timer.
Since I'm using the RHReliableDatagram I think (hope) it's okay to disable the interrupts for the few ms it takes to draw a batch of pixels, since the retry/timeout logic should be in effect, and the receiving device should be able to again receive once the screen finishes drawing. I also bumped up the SPI rate for the display to 80mhz which about halves the drawing time, hopefully further reducing the chances of missed transmissions.
Having trouble with this Elegoo nano
Recognizes the board as arduino nano with its com port and uploads the led code successfully but it’s not really playing anything
My elegoo uno works in comparison
Using an SSD1306 OLED display with the Adafruit_SSD1306 and Adafruit_GFX.h libraries to display new lines of text that represent inputs from another device.
What I'd like to do is have the latest line on the top, and have every new line replace that with the previous line advancing one line down. So sort of a Twitter/blog (reverse?) chronological setup. I'm sure I can hack something out, but is there an easy/standard way to do this?
Here is my current code, FWIW: https://github.com/JeremySCook/arduino-experiments/blob/main/MIDI/AutoDrums/OptaAutoDrums.ino
@tawdry sluice - I did the opposite (like a terminal) but the processing is the same. I also had a rolling (using a text line buffer) You might find some of the PortaProg code to give some hints for implementation.
Look at the code in io.cpp.
https://gitlab.com/bradanlane/portaprog
If all you want is OLED support with lines that scroll away, take a look at my PortableISP code.
https://gitlab.com/bradanlane/portableisp
Thanks @supple egret !
No worries. Based on your goal, I think the code from the PortableISP is likely easier to follow.
Suggestions on where to look there?
@tawdry sluice - look at oled.cpp and the oledPrint() function which adds lines to the text buffer. The refresh gets called periodically.
Thx!
can someoen help me to install esp now library
@surreal kayak it looks like maybe you have a typo in the URL
can you help me with the link
are you following instruction from somewhere?
that looks like info for installing basic ESP32 support into arduino - aka the Board Support Package
they say to just clone the repo
but it might be available in library manager?
look for "WifiEspNow" in library manager
try an example from the library
what does your board manager show?
i think the base esp now stuff is meant to be used with esp idf (not arduino)
so for arduino, you'll need the library and code will need to be different
Arduino can be mixed with esp-idf
oh, ok, it works to make direct includes / calls?
change board type to an ESP32 board
neat! yah, this complied fine for me:
#include <esp_now.h>
void setup() {
}
void loop() {
}
for board = ESP32 Dev Module
WifiEspNow is a simple wrapper of ESP-NOW functions in ESP-IDF.
and the library is just a wrapper
can use / not use depending on how you want to code things
The %20 is a space, which should be a newline. The packages should be listed, one per line. You can click on the list to open it in a text area where it's easier to edit multiline input like that.
fixed thanks guys
Hi guys, I'm currently trying to move an arduino project over to platformio in vscode, and it's having a problem finding Adafruit_DRV2605.h, which I had previously installed on the arduino ide. I thought platform.io was supposed to automatically find all the installed arduino headers, but it doesn't for this one. Does anyone have an idea of why this is or how to fix it?
@civic jungle - I have not had much luck with VSCode+PlatformIO automatically setting up my Arduino projects.
I manually add libraries to my projects by:
- switching to the PlatformIO tab
- Selecting libraries
- Searching for the library
- Copying the recommended install line
- Adding the installation line to my
lib_deps =of myplatformio.ini
Oh, it's built in, but not automatically included
Hello, I am trying to use free fonts, sans to display temperature, but I'm unable to get degree (º) sign
all fonts I checked only have 127 chars, and º sign is 176... where can I find full font to use the º sign?
I used u8g2 before and I'm porting my code, and I'm stuck on this...
only gets 7bit TTF
Are you using adafruit_gfx lib? It doesn't seem to support anything but 7 bit https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts
Yes
This guide about creating custom glyphs might be helpful https://learn.adafruit.com/creating-custom-symbol-font-for-adafruit-gfx-library/
Thanks
Pico Mouse/TinyUSB question:
I'm coding the pico in arduino ide. Please tell me if there is a more relevant place and/or platform and/or channel to ask this question.
My project requires mount output and I want to make my mouse output be 16 bit because 8 bit is simply not enough for what I'm doing.
I tried to do what this guy did on his teensy (with regards to changing mouse output to 16 bit): https://github.com/Trip93/teensy4_mouse/blob/main/teensy4_cores_patch.md
From what I could tell the code I changed was fine. The output still was limited at 127 tho. In the mouse library (which I downloaded from the library manager), there was some code that would clamp the range to 127 if it exceeded it. Removing this limit made the mouse output I was testing with become smaller.
I then saw that in the pico board libraries there is a hid_mouse, tinyusb and mouse library, which all have some mouse stuff so I'm not sure which to look at and what to change.
Any help is appreciated 👍
Not sure if this helps, but...
I used this source to make an arcade spinner. It uses mouse.move() to send +/- incremental movements to the connected computer. Since it's sending a relative movement, it's up to the computer to determine the absolute position, so 16 vs 8 bit shouldn't matter within the microcontroller code. https://github.com/jmtw000/Arcade-Spinner/blob/master/Arcade_Spinner.ino
Thanks for the help, but the problem is that somewhere in the "mouse.h" library, the values get clamped down from -127 to 127 and are sent to the pc in 8 bit as set by the descriptor
I edited the descriptor to be 16 bit and the code looked fine, but then I saw that in my board package, there was also a "mouse.h" library there, a "mouse.h" library built into the arduino ide itself alongside the mouse.h library I downloaded from the library manager. Then I saw the TinyUSB library as well and just got mega confused
I'll probably just need to make sure only 1 is there and only that one is being used to keep it simple
The usual way to get around the 8-bit mouse values is simply to send multiple mouse reports. The host computer is going to do mouse acceleration anyway, which will make the movements imprecise (more than what you expect). So you have to turn off acceleration or use an absolute mouse.
And did you replace the code in usb_mouse.c as well?
anyone know how to get the arduino ide v2 to see my git cloned arduino lib?
I've added a symlink to it into ~/Arduino/libraries
got it. had the symlink wrong
hi everyone !
Being quite new to the RP2040, I recently started having fun with it, for a little project I have in mind ( driving two identical spi st7799 240x280 displays to show some images/animations ). after managing the setup of hw spi for the displays, I switched to using dma to go faster & sync the displays ( learning curve but it went well 🙂 ), and now I am digging how to add SD card storage ( to pick the pixels data from ). Since I wish to use SDIO to read-only data fast, I looked for a library supporting it on the RP2040 and found the following:
https://github.com/carlk3/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico
Now, since I am currently using Earl Philower’s Arduino Core, I am not quite sure how I should « tweak stuff » to be able to use that lib correctly within the Arduino IDE.
In the meantime, I had the chance to try using PIOs instead of hw spi peripherals ( to free at least one hw spi bus for the SD card while I don’t know yet how to use SDIO ) and had it working with my dma setup with only few tweaks and a globally defined flag, all working flawlessly 🙂
So, if anyone has knowledge regarding this, please let me know 😉
thanks in advance
So I have the Adafruit ESP32-S2 Feather with BME280 Sensor, I have a Adafruit 3.7V 420mAh battery connected to it. Following the code here: https://learn.adafruit.com/adafruit-esp32-s2-feather?view=all#using-with-arduino-ide I monitor the temp etc including battery %. In the code, I set the battery pack size to this LC709203F_APA_500MAH as that is the closest to my battery pack size. My issue is that the battery percentage is does not even come close to what it really is. At 4.2V 100% ... then 3.75V 25% but then at 3.6V 4.4%. I haven't fully tested the minimum yet but the ESP32 still runs at 2.6V. How can I ensure I get a better approximation of the battery percentage.
I did not wait until there was no power left to run the ESP but my battery discharge graph looked like this. Last lowest reading was 3.42V
Did you check if you're using the correct library?
If you bought the board recently, you most likely need to use https://learn.adafruit.com/adafruit-esp32-s2-feather/max17048-simple-data
Thanks but it is the older board I have. It has the LC709203
Hi - I am looking for a library, that would allow me to build a BLE Joystick on Xiao BLE Sense - I want to use it as a wireless headtracker for sim gamng, using onboard IMU sensor as input for joystick... Any pointers?
do you want an analog joystick or a gamepad-style 4-direction switch?
I need two analog axis...
I found this lib https://github.com/lemmingDev/ESP32-BLE-Gamepad butnot sure if it will work with xiao.
hm... actually - I need three axis ;]
Axes movement (6 axes (configurable resolution up to 16 bit) (x, y, z, rZ, rX, rY) --> (Left Thumb X, Left Thumb Y, Right Thumb X, Right Thumb Y, Left Trigger, Right Trigger))
you can vary the number of axes, it looks like. It's settable.
hi, I use the Adafruit_SH110X display library. Is there a way to reverse the text contrast dynamically when a rectangle is over the text?
yeah, that lib is really nice - I am just wondering if I can use it for nrf52840 instead of esp32. NimBLE which is a dependency for that lib looks like could be run on nrf52840....
Hi all! I'm using the Adafruit soil moisture sensor (https://www.adafruit.com/product/4026) for my arduino project. I had it working with my circuit once but now it won't even work when plugged into my arduino. Please help!
I don't think nimble would work in the Arduino world -- it requires FreeRTOS.
Hi guys, I am new to arduino and really need some helo with a project. I am trying to create a simple device that reads VOCs from a Adafruit BME680 - Temperature, Humidity, Pressure and Gas Sensor and displays the information on a Adafruit FeatherWing OLED - 128x64 OLED Add-on For Feather connected to a Adafruit ESP32-S3 Feather with 4MB Flash 2MB PSRAM. Everything is connected in arduino IDE, and I can sucessfully get readings from the gas sensor, but whenever I attatch the OLED, the device seems to turn off completely. I have tried everything, I even switched to circuit python, and the same issue occurred.
If anyone has available time and knowledge would be happy to chat can send photos or share video of my wiring. Code doesn't seem to be an issue.
Would need some photos of your setup to really help, but it kinda sounds like the power & ground lines of your display are swizzled
Well - looks like it could...
https://github.com/h2zero/NimBLE-Arduino
But - I think I just worked this out using https://github.com/adafruit/Adafruit_nRF52_Arduino/tree/master
I agree; this is the right approach for nrf
can anyone help me setup the pihole kit? the guide seems super outdated and mixed im kinda not getting it lol...
for ex rasbian is discontinued and the rasberry pi imager says the board only supports 32bit imaging but guide says 64..boot folder isnt being created
Hello! I'm having a weird issue. I'm using a NodeMCU-32S with Arduino. I'm trying to set a GPIO as output, and blink an LED.. pretty basic stuff.. I've also got the Serial port working. What's odd is that when my board resets, I get a message stating...
"00:54:43.338 -> E (25) gpio: GPIO can only be used as input mode"
Any help would be greatly appreciated!
Does anyone know how to use adafruit libraries (specifically the DRV2605) with soft I2C? I want to run multiple independent slaves but can't figure out how to get the adafruit driver class to target different output pins. I'm using SlowSoftI2CMaster but if something else would work better I would be open to it.
Mainboard is an Arduino Nano 33 Sense Rev2
can you programm a MCU into ICP debugger?
Heyy, I'm working on a big led matrix project 192x16 for my school and I'm having trouble addressing the matrix as a whole
It's made up of a total of 12 32x8 matrices and I'm using Arduino Due
the LEDs in each matrix are lined up in a serpentine zigzag way (up to bottom then bottom to up from left to right, individually I had no trouble initializing them with these parameters : NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG)
and the matrices are physically lined up and connected like this (left bottom then up then it goes right bottom then up and so on) so like serpentine zigzag from bottom to up with no rotation
I wanna initialize the matrix as a whole in a way that I can use .print to print out string on the matrix
I've tried the tiled matrices initialization but that didn't produce a readable result
how can I do this thing?
It might be that particular GPIO is input-only – can you try a different one?
I've tried four or five different ones, they all do the same thing.
Hello. I want to make keyboard with Arduino Pro Micro, but for some reason it has wrong HID Key Codes and I don't know how to fix. For example, Backspace is 8, Tab is 9, Enter is 10 instead of 40 (code 40 is bracket). Some keys have multiple codes, and some are completely missing. I tested 0-255 and not found keys like ESC, SHIFT, ALT, CTRL. It looks like it is writing ASCII characters, instead of real key presses. Issue exists on both windows and linux, both Keyboard library and HID Project library, tried also some different keyboard layouts, but still nothing changes. Anyone knows what can cause this issue? Here is my code:
#include "Keyboard.h"
void setup()
{
Serial.begin(9600);
Keyboard.begin();
}
void loop()
{
if (Serial.available() > 0)
{
String inputString = Serial.readStringUntil('\n');
inputString.trim();
if (inputString.length() > 0)
{
delay(1000); Keyboard.press(inputString.toInt());
delay(100); Keyboard.releaseAll();
}
}
}```
Try also doing Serial.println(inputString.toInt()) to see if what you're passing to Keyboard.press() is what you expect
I tried it now and it prints exactly what i am typing, so it must be something else...
As i see, Keyboard.press(); and Keyboard.write(); gives the same result for the same code, which is wrong i thing, because ASCII table is not the same as KEY CODES. I cant' use any key outside ASCII table, no matter if i use write or press.
HID key codes are not the same as ASCII character values at all.
they correspond more or less to physical locations on a US standard keyboard
Yes, so why Keyboard.write() and Keyboard.press() gives me ALWAYS the same result for EVERY key i tried? Something must be wrong...
That's odd. I used very similar code with a Trinket M0 for this: https://www.printables.com/model/569035-6-key-usb-keypad ...and it sent the correct HID codes. Can't imagine what's going on.
https://github.com/arduino-libraries/Keyboard/blob/master/src/Keyboard.cpp write is just a press and release
size_t Keyboard_::write(uint8_t c)
{
uint8_t p = press(c); // Keydown
release(c); // Keyup
return p; // just return the result of press() since release() almost always returns 1
}
Ok, so, how can i press a key by its HID KEY CODE instead of ASCII?
For example ESC, SHIFT, ALT, CTRL
I was not familiar with this library. It converts to ascii to HID under the covers. I am looking to see if there is a way around this. The CIrcuitPython library does not do this.
looks like you can use the constants in https://github.com/arduino-libraries/Keyboard/blob/master/src/Keyboard.h, liked KEY_ESC, KEY_LEFT_ALT, etc. it is a strange mix of mapping ASCII to keycodes and NOT mapping keycodes for values >136 (0x88). Modifiers like SHIFT and ALT are in the 0x80 - 0x87 range, and are converted to modifier bits. I ... would not have done it this way.
Ok, so i basically need to chenge the library function to remove ascii conversion and treat all keys like 'special characters', meybe this will help. I am trying to create language specific keyboard, so i guess this is the case. Anyway, thaks for help, now i know where the problem is.
There are mappings for other languages, did you see those? https://github.com/arduino-libraries/Keyboard/blob/master/src. Depending on the language, you might send the "dead" key for the accent, then the letter, etc.
If you are willing to switch to a CIrcuitPython-capable board, there is https://github.com/adafruit/Adafruit_CircuitPython_HID and https://github.com/Neradoc/Circuitpython_Keyboard_Layouts for non-English layouts. See the README in the latter for details.
There is no layout for my language 😦 but i already fixed it, now when i use keyboard press 40 it is pressing the enter key (not a bracket or anything else), i just commented some part of code:
well, that would do it too 🙂
I'm using Mac OS X 15.0.1 on an M1 MacBook. When I connect my Macropad to the USB-C port nothing happens. ArduinoIDE does not show the new port I'm expecting to see for Macropad. I'm almost certain, the issue is caused by the OS but I'm not sure how to make it work. What am I missing?
I think I fixed my problem - at least for now - by launching the IDE from Terminal.
I have a question about the DRV2605 library- is it possible to use it to control I2C output on pins that aren't designated for I2C? I want to control multiple drivers independently from the same board. I imagine the setup would start something like this but I don't know where to go from here or if it is even feasible.
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_DRV2605.h>
Adafruit_DRV2605 drv1;
Adafruit_DRV2605 drv2;
TwoWire DRV1wire(D1,D2);
TwoWire DRV2wire(D3,D4);
void setup() {
drv1.begin(&DRV1wire);
drv2.begin(&DRV2wire);
}```
The DRV2605 does not control I2C outputs, it is controlled by I2C inputs. So I'm guessing you're asking whether you can use multiple sets of pins to implement multiple I2C buses, and further whether the driver can use these multiple buses?
If so, an ordinary Arduino only implements one hardware I2C bus, on a fixed set of pins. If you wanted to use that, it would be one of your I2C buses. Then you'd need a software I2C implementation for your other bus(es). Additionally that software I2C would need to be compatible with the DRV2605 driver (I expect this is possible but I haven't investigated it). Assuming all that is true, your code might look something like this: ```arduino
#include <Wire.h>
#include <SoftWire.h>
#include "Adafruit_DRV2605.h"
#define SOFT_SDA D3
#define SOFT_SCL D4
static Adafruit_DRV2605 drv1;
static Adafruit_DRV2605 drv2;
static sw1(SOFT_SDA, SOFT_SCL);
void setup(void)
{
Serial.begin(9600);
if (!drv1.begin()) {
Serial.println("DRV2605 #1 not found");
for (;;) {}
}
if (!drv2.begin(&sw1)) {
Serial.println("DRV2605 #2 not found");
for(;;) {}
}
}
Yeah something like that would be perfect. I'm running the Nano 33 BLE Sense Rev2 and tried the SlowSoftI2CMaster library that's recommended for it, but the way it sets up the twowire pointers isn't the right type to feed into to the DRV2605 functions. So what I wanted to know was whether the DRV2605 library running on the arduino is capable of handling the communication itself without another soft I2C library
The .begin() function only accepts pointers to TwoWire but the softI2C implementations I've seen all create their own special types
While it isn't capable of doing so directly https://github.com/adafruit/Adafruit_DRV2605_Library/blob/master/Adafruit_DRV2605.cpp but you could subclass the driver, and replace the low level routines (like writeRegister8() with your own implementations that work with SlowSoftI2CMaster.
Do you think there would be an easier way to run multiple drivers than this?
It depends on your definition of "easier". One approach would be to use an I2C multiplexor and just have each DRV2605 on its own sub-bus.
One that doesn't require additional hardware (beyond wires and such basics)
What I'd probably do is copy the entire AdaFruit driver, and modify it to accept and use the objects that SlowSoftI2CMaster creates. I'm guessing it would only involve changing a few lines of code since the AdaFruit driver already abstracts the communication into two routines that actually do the I2C reading and writing.
I'll try that, thanks
Do you think it would work if I just created a TwoWire that points to the same pins as the SoftI2C object?
Rather than go all the way down to change it in the class
I wonder if slowsoftI2C will even pick up the commands from the drv... really not sure how that lib even works
Project description: I watched a video [YouTube link: https://youtu.be/Bicjxl4EcJg?si=mHz] anhttps://github.com/chromalock/TI--32/].
I want to create a similar project but with lower costs. It's about bringing ChatGPT to a handheld calculator like the TI-84.
I want the calculator to have features like
Color
Animated
Multi-page responses
Chat history from
A larger menu (only 320x240 resolution
Support for lowercase characters and "Vietnamese" language
Documentation
Basic
HTTPS
Sending and reading emails
Wi
Video play
I need your advice to help me complete this project, specifically on programming and the electronic components that need to be purchased. I'll exch Gmail
Can you help me? I beg you, if you can, I will pay you.
don't let any of your teachers see this.
Keith Sachs: @KeithSachs
github: https://github.com/chromalock/TI-32/
patreon: https://patreon.com/ChromaLock
:)
I'm not sure what TwoWire is. I think it's a library for smaller MCUs like the ATtiny line, and may not even work with your board.
You'd have to look up how SlowSoftI2C works and modify the library to make whatever calls are needed to send and receive data using it.
I suspect there isn't enough bandwidth to do much in the way of animation, and playing videos would not be feasible. In order to do this, you'd probably be better off just building a new device instead of trying to make a TI-84 do all this.
TwoWire is a type from the arduino core <Wire.h> to specify a pair of pins for communication. The adafruit drv2605 lib is built to use it specifically, but I'm not sure if that's just an easy way to pass a reference to a pair of pins, or if the drv2605 lib actually needs some specific function of TwoWire to work
It wraps TwoWire in an instance of Adafruit_I2CDevice, but if you look at the readRegister8() and writeRegister8() functions, they just call the write_then_read() and write() methods. Both routines are only a couple of lines long. I didn't look to see what Adafruit_I2CDevice needs, but as long as you can adapt those routines to read and write using your I2C library, you should be done.
Idk what’s happening
Arduino was working just fine last night till like an hour later and it recognizes my ports n such but like
Nothings happening
It goes for both the nano and uno
Anyway to fix this
Did you change the wiring at all?
So I'm having a weird problem with Arduino (1.8.19) and my QTPY ESP32-S2. I plug it in, and I get the Windows tone indicating a device has been discovered. I then select the port (COM9) inside Arduino. If I open Serial Monitor, I can see the output which the Sketch is generating, so that seems right. I then go to upload the code (by simply hitting CTRL-U or Sketch->Upload). After compiling (which seems like it takes FOR-EV-AR), the output window displays an error stating that "A fata error occurred: Could not open COM9, the port doesn't exist". If I try to open Serial Monitor again, I get a new error stating "Error while setting serial port parameters: 115,200 N 8 1". If I press the RST button on the board, I get the Windows chime for device disconnected, then a few seconds later the Windows chime for device connected. Sometimes after that point, the device will shift down to COM 7, but the same behavior happens again. Any ideas?
Occaisionally, it will actually complete the upload (I haven't figure out yet what "state" to leave the board in such that it actually works when I try.. But upon completing the uplload I AGAIN get an error when it tries to "Hard resetting via RTS pin...", of "Board at COM9 is not available."
Windows will reassign ports every time a device re-enumerates.
which, for the ESP32-S2, will happen with every new sketch upload, since that board has native usb
its a general issue that can cause confusing behavior, and is different on different OS's. this guide tries to give some info:
https://learn.adafruit.com/dude-where-s-my-com-port
Awesome, thank you very much @cater!
One more quick question on the QTPY. The pinout map shows various GPIO pins...
https://cdn-learn.adafruit.com/assets/assets/000/107/493/medium800/adafruit_products_Adafruit_QT_Py_ESP32-S2_Pinout.png?1640130293
But it doesn't specifically call them, for example, "D3".
Compare that QT PY doc to the Feather 32U4, which has a "callout/color" specifically denoting which "D" port a given GPIO would be in Arduino... : https://cdn-learn.adafruit.com/assets/assets/000/110/773/medium640/adafruit_products_Adafruit_Feather_32u4_Basic_Proto_Pinout.png?1649865526
So if I'm trying to do a digitalRead from GPIO 18 on the QT PY, would that be "D18" in Arduino?
@limber blaze just 18 in arduino, no leading D
That worked perfectly! Thank you!!
If I need to use ADC1_CH6 as an analog input, how would I refer to that in Arduino? ADC1_CH8 is "A2" in Arduino, as is shown on the image, but I don't see what I'd call CH6?
@limber blaze ADC1_CH6 = A4
Awesome. I suppose I should've guessed that one. 😁 Thank you again!
Hello, I have a question regarding the DS3231 RTC (ADA3013). I have this module connected to Arduino Uno R3 as documented on the product page. The temperature reading seems off. I test this with the provided Arduino example code, and compare to thermocouple measurement. The difference is 6 degC. I understand that a difference is expected, but this seems a bit excessive. How can I verify proper workings of RTC? Thanks.
The DS3231 measures time not temperature so I’m unclear what you’re asking
Hi, am I mistaken that the DS3231 contains a temperature sensor?
See line 114 here:
https://github.com/adafruit/RTClib/blob/master/src/RTC_DS3231.cpp
My apologies, you are correct. I just verified from the DS3231 datasheet that it has the those registers. It also says it’s accurate to 0.25 degrees C and measures the temperature every 64 seconds.
How close is your DS3231 board to other devices? Things like microcontrollers, voltage regulators, & LEDs can produce local heating that will be higher than ambient. Perhaps that’s what you’re seeing? But I agree that 6 degrees higher is strange
It is at approx. 50 cm of an active Arduino, and so is the thermocouple (via MAX31855) I used to compare readings. Apart from that, only an SD module (breakout, ADA254) is connected to the Arduino. Hence I am confused.
Again, I would find a temp. difference of 1-2 degC understandable, but not 6 degC. I will test again by moving the arduino further away.
Update: issue persists.
DS3231 spec says +/- 3deg C accuracy https://www.analog.com/en/products/ds3231.html#part-details
did you compare with the thermocouple in physical contact with the case of the DS3231 chip?
I have checked this just now. Temp.diff. is now a bit smaller, but still 4 degC. This is stretching the expected combined accuracy of RTC and thermocouple.
Could it be that the RTC chip just gets very hot? If so, what would cause this? Possible defect, or something else?
The temperature sensor on board the ds3231 is only there to offer more accurate timekeeping for the RTC, measure the changes in temperature that affect the oscillator, not to accurately measure the ambient temperature.
looking at the electrical specs, self-heating on that chip should be less than 0.1 degC. keep in mind that the temperature sensor is there to compensate the crystal, so as long as it meets its timing specs it’s probably not considered defective
Between +- 3C accuracy of the ds3231 temp sensor and whatever accuracy your thermocouple has, the difference makes sense. Better to get a separate high accuracy temp sensor if needed.
Thanks all. I guess it is not a big deal as long as the time is kept properly. I have the thermocouples anyway.
Thanks again 👍
Arduino adjacent question - can one use pymcuprog to set fuses from a hex file? (Context: I'd like to simplify configuration using https://www.nongnu.org/avr-libc/user-manual/group__avr__fuse.html and put things into the C file directly.)
(Just in case anyone stumbles on this in future) amazingly, just adding the .fuse section to the generated hex file does the trick.
obj-copy -j .text -j .data -j .fuse -O ihex file.elf file.hex
pymcuprog -t uart -u /dev/ttyUSB0 -c 230400 -d attiny412 --verify write --erase file.hex
i think so. was doing something like that a few days ago.
in the context of a bootloader, but can ignore that part, the info about hex/fuses is generic.
Makes sense. I was able to get the info into the elf file, but missing the (in hindsight) simple way to flash the device with pymcuprog
can also set them specifically
ex:
pymcuprog write -t uart -u /dev/ttyUSB0 -d attiny1616 -m fuses -o 8 -l 8
-o = offset (fuse of interest) -l = literal (the value to set fuse)
Ack - I was trying to avoid doing this, and the fuse.h trick looks perfect
yep. if you want it to be in the hex, then ignore.
but useful to know for lower level troubleshooting, etc.
can also read them
Using PID_v1_bc lib to control 12 VC motor with Hall_Effect/Encoder. Not used to PID. Try to control rotational speed and positions. I want to just go from current position to another location, slowly, delay some then go to another position, slowly --- as an example. Any ideas?
Hi I am trying to make my bmp280 work with Arduino Uno, through I2C possibly. Unfortunately it never detects the sensor. I am using the newest version of the library but I also tried older versions. Searching online I tried to change the address from (0x77) to (0x76) but it still won't work at all. As anyone succeded in working with it? Did you have the same problem?
I don't have that hardware, but can you scan for available addresses?
Yeah I have run an I2C scan and it won't find any device either... I changed all the wires and tried with another sensor which works fine
Fixed.
In case anyone faces the same issue
Solution was initializing the matrix using simple parameters (I used NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE), then I made a 192x16 array and I manually rewrote each index in that array (basically dealing with it as a strip from 0 to 3071) to match the parameters I used then I wrote a function that takes XY cords, puts them into the array and gives back the correct index and used that function on my matrix with .setRemapFunction().
Could you show a picture of your wiring?
The header pins need to be soldered to the breakout board to ensure a stable electrical connection. Simply placing them in the rings is not sufficient.
Try soldering the pins to the bmp280 board, or use a stemma qt cable. https://www.adafruit.com/product/4209
Thank you so much for the answer ☺️, I’ll try the cables and then I’ll try soldering them
yep. that stemma qt cable will give you a solderless option.
and for more info on the stemma qt connector/cables:
https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma-qt
Hi all, I posted a question over on the Ada Forum but I wanna see if I have better luck here. I'm having an issue with the Reverse TFT and sleep mode. See this post for details. https://forums.adafruit.com/viewtopic.php?t=214411
Found a really cool tutorial on PWM/PID DC motor control and modified it with an H-298 Bridge!
Find the tutorial on our website: https://curiores.com/positioncontrol
GitHub Code: https://github.com/curiores/ArduinoTutorials/tree/main/encoderControl
If your platform does not have access to "atomic.h" (and so you get an error message), you can use the alternative version of the code that has been uploaded to the repository. It is labeled "...
I don't see a problem with what you're trying to do. I'd check the voltage levels on both sides of the D1 and D2 buttons and see if they match.
D1 and D2 should have identical functionality.
Make sure you have set the Arduino board to the Reverse TFT S3 Feather
I tried checking the voltage but am not seeing anything. Probably doing it wrong. First off should I need to press the button to check? Hard to do with only two hands. Second can I check the two legs on the screen side or do I need to check across? I can see a little voltage in the D0 but nothing in D1 or D2
Ive test D1/D2 with other things and they do work identically which is why this is very confusing.
Yes my board is correct.
@stable forge
looks good
See your forum thread. I got it working. It's more complicated to set pulls that work during deep sleep. I checked he voltage on D1 and D2 as it went into deep sleep. D1 had a high glitch, D2, did not. This has to do with the chip and not the board itself.
Hello, everyone. I have a problem with the sensors BME280 and SHT31.
Why does SHT31 have so different results than BME280 according to RH?
The gap is within 10RH. In addition, I'm using a extractor with both sensors, so both have a good airflow, they are in the same environmental conditions.
I've checked the encapsuled and it says SHT31 DIEF2s.
Help me please, I have three sensors of each (3 of SHT31 and 3 of BME280) and all of them have the same results.
Also I've tried with different libraries I've tried with the Adafruit library ( <Adafruit_Sensor.h>
<Adafruit_BME280.h> and "Adafruit_SHT31.h")for both and SensirionI2cSht3x.h for just STH31, and with the last one I've tried with all the types of SHT3x, because you know with unofficial sensors you never know. Even though, I've tried in both Arduino and RaspberryPi2, both have the same results, the same gap.
Here you are, all SHT3x sensors that SensirionI2cSht32.h supports, I've tried all and all have the same results.
I'll give you some images of the sensors.
As you can see the temperature, it is not a problem but humidity is.
Just I want to know why this is happening.
BME280Results.
SHT31Results.
Both are within a carton box and a extractor (a fan).
Here are six humidity sensors at once:
ahtx0.temperature=23.2973, ahtx0.relative_humidity=44.8426
bme680.temperature=22.9093, bme680.relative_humidity=50.1364
htu21d.temperature=22.1982, htu21d.relative_humidity=47.3485
htu31d.temperature=22.3342, htu31d.relative_humidity=50.3777
sht31d.temperature=22.3403, sht31d.relative_humidity=56.9253
I couldn't use the SHT31D and SHT4x together (they share an I2C address)
ahtx0.temperature=23.6088, ahtx0.relative_humidity=44.2345
bme680.temperature=23.0068, bme680.relative_humidity=49.6986
htu21d.temperature=22.1982, htu21d.relative_humidity=47.257
htu31d.temperature=22.3342, htu31d.relative_humidity=50.4341
sht4x.temperature=22.6714, sht4x.relative_humidity=53.5369
but these readings are within a minute of each other. As you can see the SHTxx sensors tend to read higher than the other, but even, so there is a wide range
This is in CircuitPython but the Arduino results you are seeing are similar.
I'm following up in your forum thread: https://forums.adafruit.com/viewtopic.php?t=214472. Please mention forum threads when you post here, so we can answer in one place.
The differences are probably due to the sensors not being conditioned to be more accurate. I gave links to multiple forums threads that talk about that.
If I wanted to basically replace (what is currently) serial communications on an arduino (RP2040 Connect) with a websocket, how would you do it? Is there a way to just redirect / overload existing serial functions or do I need to replace everything?
Do you mean serial over USB, or directly via GPIO pins? What are you trying to accomplish?
I'd basically like to replace the existing serial over usb that I usually use to communicate with it with serial over websocket (to telnet or something).
Hello there,
I need some help with flashing an SAMD21G18A board.
I am unable to connect to the board with my dapl-ink usb programmer.
Can someone help me debug this issue?
Has anyone ever tried connecting a QT PY ESP32-S2 to a RFM69 radio via SPI? I'm attempting to do so, and when I try to compile the RadioHead rf69_client example, I get errors regarding timers. I've got MOSI, MISO, and SCK connected as required; G0 is connected to A2, CS to A3, and RST to A4(SDA).
Having trouble with the Adafruit seesaw library. Working in VSCode with PlatformIO. Have tried 3 different boards - qtpy2040 (my actual target), pico, and esp32s2 feather. With all of them, if I just install the seesaw lib, I get an error that it can't find Adafruit_I2CDevice.h. Which is of course in Busio, which gets installed as a dependency, but doesn't seem to be on the search path. If I manually install Adafruit Busio in the platformio.ini, it finds the above, but then can't find both SPI.h and Wire.h, both of which would seem to be located in the Arduino core from what I can tell. Any ideas what I'm doing wrong? I'm relatively new to Arduino, but the loop timing in CircuitPython is too coarse for accurately driving a 2208 stepper driver, so I'm biting the bullet and trying to learn something new. 🙂 edit: I moved to the Arduino IDE instead of PIO, and everything works as expected. I'd still like to understand what was going on, so please do answer if you can.
Next question: in CircuitPython I used microcontroller.nvm to store small configuration values in order to persist current settings after reboot. Is there a similar method in Arduino for the 2040? Google is being strangely silent on the topic.
Solved on #help-with-radio !
The RP2040 does not contain EEPROM, but the Earle Philhower port has a way to emulate EEPROM by using flash. Alternatively, you could add an external EEPROM or FRAM chip.
I'm assuming that microcontroller.nvm does something similar (using flash) since it works on this same board. I'll try earle's EEPROM library. I had just run across it searching for different things than I'd done the first time.
I'd guess so too, but I haven't looked at the source code
I have an Ada fruit itsybitsy here that never once illuminated any LEDs from the moment we pulled it out of the box. We’ve tried different cords, different ports, different computers. Same outcome every time:
The drivers for this device are not installed. (Code 28)
There are no compatible drivers for this device.
To find a driver for this device, click Update Driver.
I asked chat gpt about it and it said that clicking the button on the board twice should force bootloader mode, however nothing happens except abrief disconnect from the pc
DFU looks like it's in device firmware upgrade mode. You may want to email support@adafruit.com as the chip may not be flashed with a bootloader.
no bootloader, no code to turn on the LED's. Open a thread in https://forums.adafruit.com, and say which part number it is.
@stable forge Could I use a spare arduino uno I have laying around to install the bootloader? If I open a form post will I be distributed a bootloader to install?
I'd prefer to just fix this myself in a timely manner instead of begging adafruit to issue me a new board.
installing a bootloader to this particular chip in this condition is an advanced operation, best attempted if you already have experience doing so (or are willing to take the risk of putting it into an unrecoverable state)
I definitely don’t have experience and would need a walkthrough. Any YouTube videos you might suggest?
I can take the risk, the board is cheap. There’s only one way to learn these things and that is to just do it.
look up "Arduino as ISP" for some guides. you will need to wire up the ISP (SPI) pins. the programmer Arduino needs to use the same logic levels as the target. i forget whether the Arduino IDE "Burn Bootloader" command will do a full chip erase, which is needed in this situation to clear the lock bits
Can you define logic levels?
the voltages used by the chip to indicate logic high or low states. 5V or 3.3V are typical. a mismatch could damage one or both chips
from the photo, it looks like you have the 5V ItsyBitsy32u4, so you're probably OK with an Arduino Uno, but it's good to double check
There were a few batches of boards that were not programmed with bootloaders due to a manufacturing issue. This was one of them. We'd be happy to replace it without charge.
Lots of instructions https://duckduckgo.com/?q=install+32u4+bootloader&ia=web
If you could help me resolve the issue tonight that would be best
you can use Arduino IDE to install the bootloader
Ok I'll give that link a go
The ISCP pins on the uno are obvious, but I can't find what pins to use on the itsybitsy
Would I have to send the old board to request a replacement? What does that process look like? It would be nice to have a spare for my trouble even if I can somehow fix this one. We are building a melty brain battlebot based on the openmelt V2 project on github.
I have an exam to study for, so I think I'm gonna have to give it up for tonight... 😔
Thank you so much for your help
please post in the support forum for an official answer. in my experience, Adafruit is often fair and generous about refunds or replacements for defective items, but i don’t speak for them
No return is necessary. We know this batch went out without bootloaders. You'll get a new one.
If you'd rather not wait for shipping, and happen to have a Micro Center nearby, you can also purchase a replacement from them. They're an Adafruit distributor with brick-and-mortar retail locations.
Hmm nearest one is 2h... I'll think about it.
post in the forums and we'll initiate a replacement immediately.
no charge to you
Yep, that would be the most ideal option. However, if they're on a time-crunch, Micro Center could be a faster alternative compared to shipping.
could pay for fast shipping
ping me if you post in the forums and I'll authorize a replacement
My teamate ordered it, so I will have to reach out to them to post in forms i think
post now and I'll authorize it and you can start corresponding with support about it
If it were a gift, for instance, we'd still replace it, and if we have the teammate's email, we could look it up
but it's not that hard to reprogram yourself if you want to start working on it while waiting for the new one
Ok posted
answered
Email sent. Tysm
might want to make sure you give support the exact product ID; there are two different ItsyBitsy 32u4 (one is 3.3V)
I sent a follow-up email
So I have Adafruit ESP32-S2 Feather with BME280 Sensor I have code running on it that takes the sensor readings and sends it up to the cloud and then goes into a deep sleep for 30 minutes. I want to make some changes to the code but I unable to get connected to the ESP32 with the Arduino IDE before it goes to sleep again. Any way I can make it stay awake for me to connect to it?
comment out the sleep part of the code while adding in the new stuff
lol ... Yeah that's what I wanna do but I can't get into upload the new code ... It's like whack a mole
Hmmm .... Is there a way to put it into a boot loader mode?
@leaden walrus Any ideas?
yep. try double pressing reset.
or can hold BOOT button for ROM bootloader.
double press if UF2 bootloader installed
UF2 is not there as I'm using Arduino code
Oh ... even if I enabled Erased all flash before Sketch upload ?
yah, i think so. arduino will add the bootloader with each upload.
it's even one of the ways to "repair" the bootloader
(the UF2 bootloader)
ROM bootloader = the one baked into the ESP32-S2, should always work
UF2 bootloader = just firmware, so needs to be loaded
Thanks - Never knew that.
So I tried doubble press BOOT button while it's in sleep mode but it does nothing
try ROM boot then
ROM boot only provides a serial interface
so there will be no folder that shows up
so will need to look for a COM port
Thanks - I got it into ROM bot and was able to get the code uploaded.
Hash of data verified.
Leaving...
WARNING: ESP32-S2FNR2 (revision v0.0) chip was placed into download mode using GPIO0.
esptool.py can not exit the download mode over USB. To run the app, reset the chip manually.
To suppress this note, set --after option to 'no_reset'.```
But now I cant get the code to work/run ? I've unplugged it and tried resseting it no nothing seems to work
Hmmm .... I've tried unplugging it, I tired hitting reset button .... but nothing works. It like it's dead. I can only put it into ROM boot by holding down BOOT button then hitting RESET button and then releasing BOOT button.
My bad .... The Arduino IDE changed my board to ESP32 Dev board ..... geez, that was driving me nuts
All working fine now - Thanks for help @leaden walrus
Hello, I need your help. I recently ordered a batch of stepper motors (42BYGH23-A-21DH) that I want to control with an Arduino Uno. I have a stepper motor driver A4988. When I make the connections and use code from the AccelStepper library, the motor barely turns or doesn’t turn at all.
I tested the connections by finding the coils using the resistance function of the multimeter. I tried adjusting the potentiometer on the driver board, but I always get a reading of 0.6V, whether I turn it or not.
Do you have any suggestions for me?
Are you powering the motor from a good power supply?
It’s a 12V 1A power supply
Are these 4 or 6 lead motors? How is your A4988 connected? Is it on a carrier board? Note that the SLEEP, ROSC, RESET, ENABLE, and VREF connections all need to be configured correctly. If it's not on a carrier board, you also need to hook up the various other pins for power, current sensing, etc.
I have a project using a Feather M4 with CAN. I use arduino-cli. I have been using the "CAN Adafruit Fork" library, and it works fine. But when I go to the support web page and click on the repo, it says:
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.
I am trying to figure out what is the main/best version of this library (with the same API, where I #include <CAN.h>, etc.) that I can download with arduino-cli lib install.
"Adafruit CAN" isn't the same API. the library just called CAN, aka github.com/sandeepmistry/arduino-CAN (I think)
works for me and isn't read-only or called "fork."
But I think both are old. Does anyone know which is better, or whether there is a third one that is more mainstream or maintained?
Oh, the lib just calledCAN compiles my sketch, but doesn't run (I haven't checked for diffs yet), so I'm back to "CAN Adafruit Fork." Is there a repo that's not archived?
hey there! nice to meet you guys 🙂
I've a question about neopixel library. I soldered my sk6812 on my pcb and just want to make them light. but this doesn't happen.
my code is this:
#include <Adafruit_NeoPixel.h>
#define PIN 5
#define NUMPIXELS 18
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRBW + NEO_KHZ800);
pixels.begin();
pixels.setPixelColor(0, pixels.Color(255,0,0)); //RGB
pixels.setPixelColor(1, pixels.Color(255,0,0));
pixels.setPixelColor(2, pixels.Color(0,0,0)); //off
pixels.setPixelColor(3, pixels.Color(255,255,0));
pixels.setPixelColor(4, pixels.Color(0,0,0)); //off
pixels.setPixelColor(5, pixels.Color(255,255,0));
pixels.setPixelColor(6, pixels.Color(255,255,0));
pixels.setPixelColor(7, pixels.Color(255,255,0));
pixels.setPixelColor(8, pixels.Color(255,255,0));
pixels.setPixelColor(9, pixels.Color(255,255,0));
pixels.setPixelColor(10, pixels.Color(255,255,0));
pixels.setPixelColor(10, pixels.Color(255,255,0));
pixels.setPixelColor(11, pixels.Color(255,255,0));
pixels.setPixelColor(12, pixels.Color(255,255,0));
pixels.setPixelColor(13, pixels.Color(255,255,0));
pixels.setPixelColor(14, pixels.Color(255,255,0));
pixels.setPixelColor(15, pixels.Color(255,255,0));
pixels.setPixelColor(16, pixels.Color(255,255,0));
pixels.setPixelColor(17, pixels.Color(255,255,0));
for(int i=6;i<10;i++){
for(int i=10;i<14;i++){
for(int i=14;i<18;i++){
pixels.show(); }
I don't know where I'm wrong
thanks to who will reply 🙂
What pcb is that? What board are you using? Could you post some clear pictures of your wiring?
The code is either missing some curly brackets, or is incomplete -- and you don't have a setup() function.
Thanks for the answer
I'm using Arduino Leonardo
And yes, I have the setup function, I didn't post the whole code, when I'll come back home I'll post it
Thanks
Good day, friends! I'm trying to get an Adafruit QtPy working with the Audio BFF. I followed the directions here: https://learn.adafruit.com/adafruit-audio-bff/arduino ... when I try to compile the example sketch that's included in the library, I get an error stating that the I2S.h file is missing. I looked in the entire Libraries folder, and indeed didn't see that header anywhere!
I even went back and verified that each and every library dependancy was installed. Red cross-lines indicate the library was already installed:
I also found a library I thought might be the "missing link", "Adafruit Zero I2S Library", and installed that, but that didn't seem to fix anything.
which qtpy do you have?
It looks like for the esp32 s2 chip you need to use ESP_I2S.h
It will compile with QT Py RP2040 (as mentioned in the guide), but not with ESP32-S2.
i was looking at the same thing. but the API is different
(I2S.h vs ESP_I2S.h)
So, different example code needed? for bff with the esp32 qt py boards
yes:
Hm. I changed the include, but now it's having an error at:
I2S i2s(OUTPUT);
qtpy_audio_bff_example:10:1: error: 'I2S' does not name a type
10 | I2S i2s(OUTPUT); // I2S peripheral is...
| ^~~
the two libraries are different. You'll have to study the Espressif one and change the code example.
That's not simple! lol
Hello everyone, I'm working with an Adafruit TRRS Jack Breakout Board (https://learn.adafruit.com/trrs-jack-breakout/pinouts) and need to detect when a plug is inserted. For testing, I’m trying to turn on the ESP32’s internal LED when the plug is connected and turn it off when it’s removed.
The breakout board has RSw and LSw pins, which are described as floating when the plug is inserted. I’m unsure if I need to use both of these pins for reliable detection. I’ve experimented with connecting the Left and Right pins through two 10K resistors, followed by a 100nF capacitor to block DC. However, I’m experiencing inconsistent results; the LED sometimes stays on even after removing the plug.
Any suggestions for improving detection accuracy would be much appreciated. I attache the code I'm using when I use the Left and Right pins.
`const int ledPin = 2; // Built-in LED on ESP32
const int trrsPin = 34; // TRRS pin to detect connection
void setup() {
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
pinMode(trrsPin, INPUT_PULLUP);
}
void loop() {
// Check the state of the TRRS pin
if (digitalRead(trrsPin) == LOW) {
digitalWrite(ledPin, HIGH); // Turn the LED on
Serial.println("Aux cable connected");
} else {
digitalWrite(ledPin, LOW); // Turn the LED off
Serial.println("Aux cable disconnected");
}
delay(100);
}`
The 10k resistors are forming a voltage divider with the pullup. I would suggest removing them.
Hi Madbodger, I'm following this wiring diagram to connect the audio input through the Left and Right pins. I want to detect when an aux cable is connected or disconnected; for that, I plan to use the RSw and LSw pins. I'm not sure if I need to use both pins or just one.
Hi everyone!
I'm trying to light a single SK6812 RGBW https://www.adafruit.com/product/2760, using an NodeMcu Wemos ESP32 D1 Mini on GPIO16.
I've sucessfully lid a WS2812B RGB using GPIO16 inbetween testing, and this works every time.
But I've tried 6 different SK6812 now, and none of them will react in the slightest. (3x https://www.adafruit.com/product/2760, 3x https://www.adafruit.com/product/2758 )
Right now I'm trying through WLED, where I've selected "SK6812/WS2814 RGBW" and GPIO:16, but still nothing.
ESP32 and LED have shared ground.
I've tried both stable and newest versions of WLED.
I've tried the RGBWstandtest through Arduino IDE.
Any help is appriciated ❤️
The series capacitor is not helping. You could run it to ground as a filter, but the way it's hooked up won't do what you want.
You may need a level shifter
hey there!
I've a question: I've a 18 Sk6812 leds chain and 18 momentary pushbuttons, I created an animation for the chain and I would like that for every button I press, it will change the color of the animation or the animation type
I'm using arduino leonardo (pro micro) and FastLED library
thanks to everyone who would answer to this! I can post the code if needed 🙂
Do you want each button to change a specific thing, or any button press to just choose a new animation?
each button change the animation
or simply the led color
thinking better, I would change the leds color
You may be able to hook all 18 buttons in parallel, then connect them to a single GPIO pin
they are already connected to a single pin