#help-with-arduino
1 messages · Page 98 of 1
Try adding some shunt resistance in parallel with your LEDs to absorb the stray energy
well If I connect a 100w normal bulb the other led bulbs stop glowing
Yes, that would serve as shunt resistance too
ok let me search how I can put that directly into my circuit
ok not that hard, but can you make a simple doodle in top of the image indicating me where can I put it? as I said i'm new in electronics, I don't want to burn down my house 😂
I don't know enough about how the LEDs are connected to do so
they are conected to neutral, and the switch conect them to live they are just led bulbs
has anyone here used the grand central with openocd?
I'm new to jtag debugging and don't really know how to troubleshoot my error
Error: JTAG scan chain interrogation failed: all zeroes
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: at91samd51p20.cpu: IR capture error; saw 0x00 not 0x01
I've gotten it to connect and reset the board, although gdb still will not connect.
Here's a couple of resources I've found and read relating to the topic
https://github.com/adafruit/ArduinoCore-samd/issues/208
http://openocd.org/openocd-0-11-0-released.html
https://www.avrfreaks.net/forum/samd51-and-openocd
There is a variants/openocd_scripts/ directory for most of the Cortex-M0 SAMD21-based boards like the Arduino Zero, but these are either missing or incorrect (copies of the variants/arduino_zero/op...
Finally! Final. I'm happy to announce the availability of OpenOCD version 0.11.0. So four years since the last release and probably three years...
If I understand right, the same5x config file should also cover samd51
When I try to connect with GDB, it correclty identifies the SAMD51P20A on the Grand Central and is able to reset the board, but for some reason gdb drops the connection
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000058c msp: 0x2000dfe0
Info : SAM MCU: SAMD51P20A (1024KB Flash, 256KB RAM)
Info : dropped 'gdb' connection
Here's the gdb output:
(gdb) target extended-remote :3333
Remote debugging using :3333
warning: while parsing target description (at line 4): Target description specified unknown architecture "arm"
warning: Could not load XML target description; ignoring
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
Truncated register 16 in remote 'g' packet
turns out I needed gdb-multiarch
I might have gotten it to work, but testing it further will need to wait for tomorrow
I have this really big array I need to keep in memory:
#define DATA_SIZE 65535
uint8_t jpeg_data[DATA_SIZE] = {};
Which compiles fine for my ESP32:
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\src\main.cpp.o
Linking .pio\build\esp32doit-devkit-v1\firmware.elf
Retrieving maximum program size .pio\build\esp32doit-devkit-v1\firmware.elf
Checking size .pio\build\esp32doit-devkit-v1\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [=== ] 29.9% (used 97816 bytes from 327680 bytes)
Flash: [== ] 19.9% (used 260598 bytes from 1310720 bytes)
But I need 115200 bytes, so I set that:
#define DATA_SIZE 115200
uint8_t jpeg_data[DATA_SIZE] = {};
But now it errors out:
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\src\main.cpp.o
Linking .pio\build\esp32doit-devkit-v1\firmware.elf
c:/users/ckyiu/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32doit-devkit-v1\firmware.elf section `.dram0.bss' will not fit in region `dram0_0_seg'
c:/users/ckyiu/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.
c:/users/ckyiu/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 22904 bytes
I should have more then enough RAM for it, but it isn't letting me. 😦 Maybe I'm crossing a boundary and it doesn't like that???
If I use 92296 (115200 - 22904) bytes it compiles fine:
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\src\main.cpp.o
Linking .pio\build\esp32doit-devkit-v1\firmware.elf
Retrieving maximum program size .pio\build\esp32doit-devkit-v1\firmware.elf
Checking size .pio\build\esp32doit-devkit-v1\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [==== ] 38.0% (used 124576 bytes from 327680 bytes)
Flash: [== ] 19.9% (used 260602 bytes from 1310720 bytes)
It does appear that the RAM is segmented. You could look at the memory map file for it to see what the layout is.
@rough torrentdoes it compile if you do two arrays, each half size ?
Yea:
#define DATA_SIZE 57600
uint8_t jpeg_data[DATA_SIZE] = {};
uint8_t jpeg_data_1[DATA_SIZE] = {};
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\src\main.cpp.o
Linking .pio\build\esp32doit-devkit-v1\firmware.elf
Retrieving maximum program size .pio\build\esp32doit-devkit-v1\firmware.elf
Checking size .pio\build\esp32doit-devkit-v1\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [=== ] 27.4% (used 89880 bytes from 327680 bytes)
Flash: [== ] 19.9% (used 260698 bytes from 1310720 bytes)
But I need it to be in one continuous array cause of the library I'm using
maybe you can do something tricky to force the big array into a different segment of memory.
or could it be busting your stack ?
@rough torrentmaybe ask the author of the library on github.
For now, it seems to work with 92296 bytes (it's a JPEG camera with data being sent over SPI before being sent to bitbank2's JPEGDEC library) and I don't see more then 10KB actually used. But I am trying to do 115200 cause the maximum file size for a (not synthetic) JPEG file at 320x240 seems to be (width * height * 12 bits) / 8 = 115200.
Thanks for the help anyways!
@rough torrentmaybe try allocating on the heap ```
uint8_t* jpeg_data = new uint8_t[DATA_SIZE];
Does anyone know where arduino ide gets the location of the openocd config file for flashing a new bootloader? For some reason my ide is looking in ~/.arduino15/packages/adafruit/hardware/samd/1.7.3/variants/grand_central_m4/openocd_scripts/arduino_zero.cfg
I want to tell it to look in ~/.arduino15/packages/adafruit/hardware/samd/1.7.3/variants/grand_central_m4/openocd_scripts/grand_central_m4.cfg
@hallow remnant I don't know!
I would copy over the one it knows with the one wanted, in a convenient shell script that will also restore it (with a second iteration).
what do you mean?
there also happens to be no existing openocd script as no one has been able to get it working with the samd51 series chips
$ /bin/cat ./this > ./that
but I think I'm close, it works in a standalone version of openocd, but that's 0.11.0
ah, so I run this before and after?
I was looking for something more automated as that really isn't a solution to have in a pr adding support for M4 boards to openocd
when I say M4 boards, I mean adafruit M4 boards to the openocd version in arduino ide
Yeah but the fuller form would be:
$ cp -p ~/path/to/goodies/this ./this.orig
$ /bin/cat ./the_new_one > ~/path/to/goodies/this
$ arduino &
# later
$ /bin/cat ./this.orig > ~/path/to/goodies/this
this is what I'm working on: https://github.com/adafruit/ArduinoCore-samd/issues/208
I don't know openocd at all and not really sure where you hack the IDE to pickup your alternate.
ladyada commented on Jan 27, 2020
openocd did not work with samd51 last we tried it - feel free to submit a PR with working scripts!
I have a working script, it just doesn't work with the ide
well that's basically what I did
If it's perfect, then integrate it as a separate step.
I just cated it from my system openocd script directory where I was working on it
Realistically you can very likely just write a shell script that uses openocd on the command line.
well I could and that works, but I'm trying to add support into the official repo as it doesn't work on any of the M4 boards, but it does on all of the others
The zero isn't in production and few if any targets use it. I'd be more concerned about conflicts between SAMD21 and SAMD51.
ag found 1800 hits for openocd in the ~/.arduino15 tree. ;)
There aren't 1800 boards.
so no grand central or metro M4
there's not just one script per board, there's also like folders and stuff iirc
The package index in the base dir has a lot of hits on openocd
Looks like dependencies resolution foo not pathnames to specific tools.
~/.arduino15/packages/arduino/tools/openocd/0.11.0-arduino2/share/openocd/scripts/target/at91samdXX.cfg
~/.arduino15/packages/arduino/tools/openocd/0.11.0-arduino2/share/openocd/scripts/board/atmel_samd21_xplained_pro.cfg
Hey ive been messing around with a neopixel ring trying to learn my way around arduino ide and im running into an issue, i was trying to set up a color like the magenta example in the uberguide, but for some reason it always sets the color to blue, any reason its doing this? No matter which value i change, its blue, but the strandtest works just fine.
bad code, seems like
You probably should share your code with pastebin or something to see if people can spot any possible issues with it.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
sorry im new to this and uhh... have never used pastebin before so i hope this is what u meant
Yep, and I definitely see the problem. You're not passing in the magenta color variable (which is only local to the setup function), you're passing in the string "magenta", and I presume those bytes are somehow coming out to be blue.
So you'll want to move that color definition into loop, and take out the quotes.
i knew it was something simple lol, thank you
No worries, C is not particularly friendly. That would have been a difficult issue to guess without seeing the code, heh heh.
It compiles but doesn't work 😦 thanks for suggestion!
I'm using a MFRC522 card reader for my ESP8266, after about 500-1000 reads, the card reader stops responding. I've tried resetting the devices via ESP.restart() but that didn't help either (it actually just stops reading as if it read 500-100 reads). Is there any way to fix this besides a full power cycle?
From what I found, its related to SPI needing reset possibly...
My code:
https://github.com/641i130/rfid-iot-door/blob/main/main.cpp
Similar issue:
https://raspberrypi.stackexchange.com/questions/50189/rfid-rc522-stops-reading-data-after-reading-data-continuously
IDK what to do at this point besides using a timed outlet
Does it work if you only power cycle the card reader? If so, worst case scenario you could have a transistor that switches the card reader's power pin on and off...
hi guys, im getting this error when building my project in platformio for the esp32 with Adafruit NeoPixel library. from googling, It seems that this file doesn't recognize the esp_idf_version.h from the
esp-idf/components/esp_common/include/esp_idf_version.h.
error
.pio\libdeps\esp32dev\Adafruit NeoPixel\esp.c:100:43: error: missing binary operator before token "("
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
I don't know where to find it on my computer and how to include it. any help? thanks.
I have the following running on a Clue which results in LED_BUILTIN blinking but nothing on the serial monitor:
#include <Adafruit_TinyUSB.h>
#include <Arduino.h>
uint32_t state = 0;
void setup() {
Serial.begin(115200);
while(!Serial) yield();
Serial.println("Working!");
Serial.flush();
}
void loop() {
state ^= 1;
digitalWrite(LED_BUILTIN, state);
delay(100);
}
What am I doing wrong?
It doesn't start blinking until the serial monitor is connected but never prints the message
I would comment out code until everything left is working correctly.
Prefeably start with an empty file, and add lines one at a time.
i cannot believe adafruit use dependency like this in their libraries. other led libraries don't have esp32 random file as a dependency.
Serial.println isn't working even with only the first 3 lines of setup
I only added the stuff to loop because I needed some indication that the other code wasn't halting execution
My Arduino IDE isn't working (even after downloading the latest one and updating all of the BSPs) it gives me the following message so I have to run this in PlatformIO
Arduino: 1.8.15 (Mac OS X), Board: "Adafruit CLUE, S140 6.1.1, Level 2 (Full Debug)"
fork/exec /Users/tjp/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-g++: no such file or directory
Error compiling for board Adafruit CLUE.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Turned on the verbose setting mentioned in that output
Doesn't really shed much more light
There is no arm-none-eabi-g++ in that folder but there are many other binaries
I got everything working, but only outside of the arduino ide on openocd 0.11.0, which is the version you have. What version of the arduino ide/how did you get that version of openocd. I verified that my ide is up to date and I still have 0.10.0 from like 4 years ago which does not support SAMD51.
How did you lose your compiler and how was it working before?
I haven't used Arduino IDE in ages, I use PlatformIO or ESP-IDF. I do see arm-none-eabi-gcc in there
@hallow remnant I did a recent reinstall.
Nothing special about it - no mods done under the hood.
@flint smelt I was under the impression CLUE was mbed development environment.
I think that brit one is.
microBit
Thanks!
I just updated my ide, not a full reinstall
I'm not sure what it is under the hood, PIO uses Arduino core for it and I use ESP-IDF for esps lol
I did run platform.io for a very short while.
Actually, I do know, it uses Nordic SoftDevice and the nRF SDK
It's faster, but has it's own set of issues from time to time lol
Every last Raspberry Pi Pico RP2040 dev environment I've seen, in some capacity, leverages pico-sdk.
The lines are blurred. ;)
Yep
The folder where Arduino is trying to find the compiler
I'm having a really bad day with embedded dev... ESP-IDF is broken, Arduino is broken, can't get Serial.println working on Clue
I deleted the Arduino15 folder and starting over with it lol
good idea really.
I have
~/.arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4
Linux Debian AMD64 Arduino IDE
Updated with all new software downloads a month ago.
(following instructions arduino.cc gives to beginners)
I think that did the trick for the compiler, but now I'm getting a python error
what are wires without straight bend at the end called ? Like you need to connect to a solder terminal but don't want to soldier so you just roll around the wires in the terminal
Hello, has anyone managed to upload the code remotely to boards with a samd51 microcontroller?
There's jumper wires, there's also aligator clip wires (Which sometimes have jumper wires at one end), and there's also a variety of other types of clips out there as well
What do you mean by "remotely"?
@tough snow I have the nodes in very distant farms, and I would like to be able to program the code without having to go to the place
It's going to be difficult to do with Arduino (I don't even know where to start with that), but it should be simpler with CircuitPython, due to how the files are. I've never tried it myself in either case though
I managed to follow an example with an arduino uno, but I have not been able to replicate it for samd51
Does anyone have a Clue or nRF52840 that can try this code?
#include <Adafruit_TinyUSB.h>
void setup() {
Serial.begin(115200);
while(!Serial) yield();
Serial.println("Working!");
}
void loop() {}
I also noticed that copying the updated bootloader UF2 file doesn't trigger an update
I'm getting this behavior from my Clue, nRF52840 Express and nRF52840 Sense
CircuitPython UF2 works just fine but the bootloader UF2 does nothing
do all arduino have the same resolution and accuracy when they measure voltage ?
yes/no. different hardware will have different ADC resolutions. but the arduino API standardizes the return value for analogRead()
I have to put around 20-30 switch/buttons on my joystick and I'm starting to think about ways to implement them. I know some of they will need latch so they don't keep triggering
been thinking about using voltage to encode the fact that several of the switch are on in a series
or should I just forgot it and use controllers specialized in that ?
So far I have 20 buttons on the drawing board, 5 metal thumb switches and 1 keyswitch
@flint smelt just ran your sketch on a CLUE:
@leaden walrus thanks for checking! 2 follow up questions: 1) What bootloader version do you have on your CLUE? 2) What OS did you use to program it?
UF2 Bootloader 0.3.0 lib/nrfx (v2.0.0) lib/tinyusb (legacy-1500-g23df777b) s140 6.1.1
Model: Adafruit Clue nRF52840
Board-ID: nRF52840-Clue-revA
Date: Jan 13 2020
OS = linux
great I have to buy another f* board<
I'm annoyed because I have a 1st gen uno, raspberry pi 2.0 and mega 2560 but I have to get another board for what I actually want to do
should I like throw them in the trash?!
Keep them around! You may think of another project for them in the future.
@pine brambledef keep them.
I don’t use 1st gen unos or 2560 megas very much anymore as I just prefer cortex-m boards, but I still keep a large stash of those boards for testing and more risky projects
hi guys, any help with this error? thanks
.pio/libdeps/esp32S/SD@0.0.0-alpha+sha.041f788250/utility/Sd2PinMap.h:371:2: error: #error Architecture or board not supported.
From the path, it looks like you're using an ESP32? That SD library doesn't seem to support that processor... it's written for ARM and AVR only.
i thought it does. i follow video and web tutorial for it.
Maybe there's a different version out there which does.
can i have multiple I2C devices connected to a single arduino micro or do i need a different/bigger board to be able to do that?
Sure, as long as the devices are on different I2C addresses, you can connect many
i assume there's no easy way of ddeetermining if they're on different I2C addresses without having the two different components first
If it's an Adafruit device, it should say in the product page or learn docs for it. Some things have a single address that can't be changed, some have jumpers/pads to change it. But yeah, if they don't have it listed for the product, no way to tell
it seems like at least one of the i2c components that im planning to get have an address pads
so i should be fine unless somehow the thing manages to occupy multiple addresses that are exactly the same as the other component
although i noticed that the board that im planning to use(pro micro) doesnt seem to have 4 i2c pins, only 2, can i have it use other pins for i2c too?
oh wait one of the components is spi and not i2c
Oop. Yeah, each I2C device gets ONE address, so if you have one with no address pads and one with address pads, you can be sure that you can have them on different addresses, even if the one with pads defaults to the same address as the other one. Hopefully you have an SPI connection as well as I2C available
And in a pinch there are also I2C multiplexers available which let you switch between devices with the same address.
Almost every I2C device from a reputable manufacturer has a datasheet defining its parameters, I2C address included.
You can actually connect both devices to the same I2C pins, so long as they occupy different addresses. Some devices with multiple sets of I2C pins will have separate buses as well, in which case there shouldn't be concerns with address conflicts.
Most SPI devices can share a bus in a similar fashion, but instead of an address, they usually use a separate chip select pin to identify the active chip. AFAIK, this can just be a simple GPIO toggle...
i see, so using both spi and i2c at the same time is fine
and sadly the stores here dont sell many devices from known reputable manufacturers, so its hard to check, and if they do sell them from those manufacturers, it gets expensive really fast
@native kelp we have a list of a number of I2C addresses: https://learn.adafruit.com/i2c-addresses
o i see, thanks
Simultaneous is fine, as long as they're separate haha
I should rephrase that as SPI can also share devices with other SPI devices like I2C does with I2C...
If RFID cards are scanned more than once in 10s, the function send_tag_message() should not run. Is my program correct?
String tagId = "NS";
String prevTagID;
tagId = readRFID(); // Function to get UID of card as String
if(tagId=="NS")
{
Serial.println("No RFID Scan");
}
else
{
if(prevTagID == tagId){
Serial.println("Same card scanned");
tagTimeNow = millis();
}
if(tagTimeNow-tagTimeStart > 10000){
tagTimeStart = tagTimeNow;
prevTagID = "NS";
}
if(prevTagID != tagId){
Serial.print("RFID Scan");
Serial.println(tagId);
client.publish(PUBTOPIC_TAG, send_tag_message(tagId).c_str());
Serial.println(send_tag_message(tagId).c_str());
prevTagID = tagId;
}
}
You probably want to set tagTimeNow on the initial scan
Hi, I am trying to work with TinyUSB on the Feather M4 CAN so that it shows up as an MSC device. I have the ramdisk example running, but I was wondering if there was a way to change the name of the drive when it is mounted to the computer. Currently it is "TinyUSB MSC" and I don't see and commands to change it on the device. Any help would be appreciated!
is FastLED.show() blocking in any way? :S
the reason im asking is this
void LEDPattern::ColorStacking()
{
const uint16_t TotalLength = _NumLeds;
const uint16_t BlockSize = 2;
uint16_t end = TotalLength;
for( int block = 0; block < TotalLength/BlockSize; block++)
{
const CRGB color = CHSV(random(0, 255), 255, 255);
for (int i = 0; i < end; i++)
{
_Leds.data()[i] = color;
if(i >= BlockSize) _Leds.data()[i - BlockSize] = CRGB::Black;
FastLED.show();
}
end -= BlockSize;
}
}
this pattern works when calling FastLED.show(); inside! if not it just goes wild with random colors and stuff! but when i have FastLED.show(); in there i can't connect to the ESP32 via Socket :S if i comment it out then i can :S
Hey, whats a good way to read serial data thats coming in too fast for an arduino to read? would i be able to use a shift register to read the info at frequency/n-bits speed?
hmm, interesting idea but probably not (at least without additional circuitry for clock extraction and generation) because uart is async aka self-clocked: there's no separate clock signal to drive the shift register. How fast is your uart that the arduino can't read it? is it the baud rate is too high, or that there's not enough time for you to process what's in the buffer? I don't remember the arduino (assuming atmega328p?) max baud rate but I thought they were all pretty much equivalent, but probably moving to a faster processor would solve your issue. Adafruit Metro boards are Arduino Uno shaped (if you're needing that) but have a wide variety of processors, most of which are faster than a 328.
there might be a UART chip that can buffer stuff and let you access it over high speed spi maybe, but that sounds more complicated than upgrading to a faster board if you're primarily using Arduino libraries and things that aren't avr-specific
can you implement I2C on some part of the circuit or you'd have to use diodes/latches to encode data in voltage ?
Liek you have a matrix of led and want to encode which ones are on in voltage because you don,t want to use a chip that does it for you
or a matrix of buttons etc
some of them have a latch to prevent sending the same keys over and over to the computer while their states haven't switched
I guess it depends on how fast we're actually talking. Arduinos have a clock speed of 16MHz, so I would expect it to be able to handle data up to around 4MHz... If it's significantly higher than that, you might need to move to a different MCU...
Metro is only like 3 times faster than an Arduino Uno, so I don't even know if that would be enough.
A polling rate of 100 times per second of 20-30 buttons/switches seems reasonable
I think I wouldn't even be at 1000hz
I'm confused as to what constitutes arduino for this channel, arduino chip or using the arduino IDE ?
Oh sorry, was focused on the question above
Either, frankly. Usually the hardware questions are less common, though.
I don't know if grand central m4 or teensy 4.1 count as arduino for the purposes of this channel
I don't know what you mean by encoding in voltage, but Arduino does have pins available for I2C.
I think there's only one Arduino board that isn't "Arduino" programmed (the one with the RP2040), but there are a lot of other boards that use the IDE
Well if the voltage is 1.1V it means 1 led on the line 1 is open 1.2V mean 2 led on the line 1 is open and so on
Then I use another analog voltage measure for the column so I know exactly what is on
That would be an incredibly complex circuit that would probably take more analog inputs than you would reasonably have on one board for anything larger than a 4x4 matrix...
Why not just use an LED driver?
how can I use something if I don't even know how it works/how to do it myself ?
Just gotta learn. Plenty of guides and people to help
I mean it's kinda the same with membranes keyboard, lots of tutorial but none explain exactly how they work
There are datasheets, guides, and all the resources here to reference.
They're far more simple than what you propose anyway
so if I made a membrane keyboard I'd have no idea how to do it
Made a membrane keyboard...?
YOu could just use addressable LEDs?
Adafruit has a very extensive Neopixel library and guide
And it would involve far less complex circuitry than what you proposed
Pretty sure I've seen guides... But membrane keyboards are just a matrix of columns and rows
NeoPixels are super simple
Membrane keyboards are very simple to understand, but the process of making one is a bit more involved.
To make a parallel with programming I don't like just copy-pasting code without knowing what it does
So if I use a chip i'd like to understand how I would make one that does the same thing myself
I don't know from what point you're starting, but depending on what you're trying to accomplish, there's probably an easier way.
The code for NeoPixels is pretty simple, well documented, and you can always ask questions
Lot of theorical knowledge from kirchoff laws course and robotics courses focusing on sensors and logic gates at the university level but very little practical experience
While I respect that attitude towards your code, it's far too impractical to actually MAKE an equivalent circuit to certain components.
You don't need to understand how to make a CPU unless you're super professionally involved with VLSI or a similar low-level process
ie: if I want to turn something to PCB they will jkust include the membrane keyboard in it and glue it in ?
Neopixels are well-documented enough to understand in a couple minutes
Or they will need me to provide an actual circuit for the membrane keyboard they can PCB ?
An LED driver is sometimes hundreds of pages of documentation and weeks of research.
You would probably need to provide a circuit? Unless you're referencing a standard membrane, which I've never seen one myself.
Are you designing your own membrane pads too?
If you want a membrane keyboard on a PCB, you need to implement that in your design yourself
when I say membrane keyboard I mean this. Been thinking about the finality of an electronic project but can't figure the intermediate steps between an arduino and PCB. Makes me feels sometimes that I'm not using real/correct electronics
Ahhhhhh
So that there is typically not a component that gets assembled to a pcb, usually you need to specify a connector of some sort to connect it to. If you're using exactly this: https://www.adafruit.com/product/419 you'll be looking for a 7-pin 0.1" (2.54mm) pin header, which is fairly standard anywhere you go. Something like this can be coded as a polling matrix scan, which adafruit has some great libraries for, or you can use your voltage encoding system to read out one analog pin repeatedly.
But anyways, which steps are you stuck on? now that I understand your desired application a bit better...
If you're seriously contemplating a PCB design, #help-with-hw-design is a great place for detailed questions too.
I'm basically stuck on turning a project to PCB once it's done in arduino so I don't constantly disassemble/reassemble circuits.... It's kinda an hybrid question between arduino/PCB because I start from an arduino
Are you trying to design a standalone PCB or an Arduino shield?
I never seem to have "closure" on projects because I have to buy a board everytime to keep the project static
Well let's take a real example, I have an arduino uno 1st or 2nd gen, hooked to 4x TM cheap temperature sensors which work fine for me along with the sampling (average of the 4 to get more accuracy)
That circuit works fine for me, so what would make sense would be to make it into a PCB along with the code in it
So you want the PCB to be independent of the Arduino and act a s a standalone device with its own power and code, correct?
yeah, so I can use the arduino uno it's occupying for something else
It seems more economical to 3d print a case for it and a pcb than to have to buy another breadboard+uno
but I have no idea what the next steps are, if the next step is even PCB etc
Before I start deep-diving into the actual process of converting it to a PCB, I think I should let you know that a PCB is not necessarily the best fit for one-off pieces.
Usually the purpose of designing a PCB is to scale to mass production or form fit a particular enclosure.
The long-term per-unit cost is significantly less, but the short-term investment cost is still pretty high.
Maybe it make more economical sense in the end to just keep the uno/breadboard rather than printing just one case and one pcb but I don't know the economics
What bother me is that the TMs sensors are basically hanging looses off the breaboard/uno and the wires are super messy
It does depend on your application. An Arduino Uno is delightfully easy to use and offers extremely low barriers of entry, but it's also not the most cost-effective MCU by any technical metric.
If I was a PCB I guess the 4 TM sensors would be just affixed to the board with holes in the case so they can sniff the air
Have you considered a perma-proto from Adafruit? https://www.adafruit.com/product/1609 They come in the same form factor as a breadboard, so it's easy to migrate your breadboard design, but it's also a protoboard, meaning you solder all of your connections to through holes.
If your only concern was loosely connected wires on a breadboard, this would probably be the ideal transition to a permanent fixture. As for the Arduino, you can optimize your cost by switching to a similar microcontroller with less pins and functionality, which I imagine you probably have a good number of them.
Also I only use 4 GPIO so maybe the UNO is too big for it
And I could optimize it by getting an even cheaper arduin with less gpio
Atm I have an uno and a mega 2560, which probably a grand central m4 express as next purchase
If you don't have any 5V devices, you could move over to a trinket M0 or a Pi Pico
4 gpio?
Digital or analog?
And yeah, these days you can get triple the power of an Arduino for half the cost
Each of them need a PWM pin and 5V pin and GND pin
so PWM 2,3,4,5 labeled on the UNO are used plus the one labeled 5V and the one labelled GND
If you only need like 4 GPIO, then you don't need an UNO or a Mega, you can get a Pico for $4 [if you can port your code] and solder that to the Perma-Proto
Ah
Pico is 3.3v, so if the PWM is running at 5V you might not be able to?
I was thinking an ATTINY84A, but that involves pulling your own 5V power source...
I mean, if the sensor can operate at 3.3v, definitely the Pico. WAy more powerful than an Arduino and for only $4 USD
@pine bramble What sensors were you using again?
DHT11, sorry had to look it up
apparently 3.3V might not be enough because it's really cheap and not always correctly made
Basically I used the arduino tutorial for it, not enough for my needs so I extended the tutorial by using 4 of them and sampling the data with n average to get more accuracy
Even had to remvoe a bit of the tape behind my breadboard so I could find it's directly for plugging things in series or parallel 😦
anyone?
It's a trick I learned in robotics, if your sensors sucks you can add more and average them because assuming they have the same constant noise function it each one you average will improve accuracy by up to 1/x
Oh yeah, that's a real cheap sensor. I wanted to suggest the trinket, but the 5V trinket would only have 3 PWM pins, and the M0 runs 3.3v logic.
Arduino Nano?
Ugh why is that 20 bucks
the pro trinket ?
The annoying thing is that for the price of the 4 sensors I could get an DFN-8 which is 100x more accurate
so really frustrating
but for dfn I'd need a breakout board or a pcb made for it
so while 4 DHT costs like 3.50$ the SHT-1 or similar family would cost 20$ because of the breakout board
Yeah, that'd probably be the one, whenever it's back in stock.
ah, might be a long time though
SHT? Adafruit has SHT-40 on a board in stock for 7 bucks LOL
Correction, 6 bucks. https://www.adafruit.com/product/4885
Cheap good
I2C, so you could use the smallest mcu adafruit has to offer hehe
You can get the sht40 with a trinket or itsybitsy and Stemma QT cable for <$20
That's already cheaper than a single Arduino UNO LOL
yeah, needed things to fill up my digikey order anyway 😄
the stemma qt cable is to power the trinket because it doesn't have usb ?
No, it's used to connect the SHT40 to the Trinket via Stemma QT.
I have a soldering course tomorrow so mayhbe that will open new options for me...
Assuming the course doesn't need 2 fire departments to show up becauise of me like last time
The Trinket has usb, the SHT40 does not.
Is that the trinket you mean ?
ffs i was looking at qtpy
it seems I have to solder on the headers and usb myself and do additional things for ?1, ?2, ?3 and ?4
Sorry, you're right
You might not need the headers, you could just solder the Stemma QT male pins to the holes directly and plug the other end into the sht40
Yeah, headers are just for breadboard or socket use, you can wire directly to the board
Bah hopefully the course will make my fear of soldering go away
Last time we we stab a block of wood to cool the solder iron down, and of course I forgot it plugged in and it started a fire. At least thoesse were the charges but it was never proved it was me 😦 (I don't remember)
I would expect .show() to be blocking for NeoPixel-like strings, as the protocol is very timing dependent. For clock DotStar style ones, it could be different.
Why the heck would people use wood to cool soldering irons? Do they not teach you to use a wet sponge...?
I do not think that one is on you LOL
Well I mean I used what the adults told me to use when I used that solder iron under "supervision"
My point exactly. 😉
Only thing that sucks tomorrow is you have to stay and wash all the stuff with bleach and alcohol
I wish I knew ahead
Sounds like some dumbdumbs were teaching you
I wouldn't go normally but I have to if I want to have access to CNC/large 3d printing/PCB etc at cost
Just wanna confirm something before I try this,: is the VIN pin capable of taking 7-12 Volts on my Node MCU ESP8266? (Reference: https://components101.com/development-boards/nodemcu-esp8266-pinout-features-and-datasheet)
Is it also like this on all Arduinos with a VIN pin?
Not sure it's a good idea to clean a soldering iron with alcohol after use 😄
2.2 Section in datasheet electrical characteristics states 3-3.6V
3.6V Max Voltage
link?
in the webpage you linked
datasheet button
o
Your looking at the ESP8266 module, I'm talking about the Node MCU board with an ESP8266 module, I'm assuming it has circuit to drop the voltage down to 3 for the module since it has a USB in
or maybe im just confused lol idk
Some canadian reseller site says 4.5V-10V of input voltage for the whole thing and it has a voltage regulator
but can't find a datasheet for the whole thing so I'd try to understand the schematic at this point
Can you read the text on this part right here?
If it says AMS1117 you should be okay up to 15V
I mean with all the cheap sellers I only trust a datasheet or schematic and I google translate the CN version to be sujre...
yes it does! thank you
thanks @pine bramble and @livid osprey
It's not ideal, as it does recommend 4.5-6V, but Absolute maximum rating does appear to be 15. Not sure what it will do to its output voltage or load regulation, so I'd try to strt at 7 and observe the 3.3V bus as you increase in voltage.
and a fire extinguisher for electronics nearby 🤣
When you check for servo motors for your arduino and accidently look at 30KW servo motors instead
yeah it heated up really fast at 11 V
imma use a buck converter
What is 30KW servo for? "Rotating 200 humans on giant ferris wheel" - What is 30mW servo for? "Rotating 200 fleas on arduino sized ferris wheel"
This is a pretty specific electronics question, I have a sensor that outputs +/- 10VDC as a lmk analog signal, and I’ve been struggling to figure out how to read it into my mcu. Does anyone know if I can use the isolated ADC from this week’s eyeOnNPI to measure this? My gut says that I should be able to utilize the grounds and reference voltage to normalize the negative voltage somehow.
Maxim's MAX22530 self-powered isolated analog-to-digital converters (ADCs) are galvanically isolated, 4CH, multiplexed, 12-bit ADCs in the MAXSafe™ family line.
Maybe it's for one of those CNC mills that makes those cargo ship propellers that are 10m across
Besides that I'd go with your guesses lol
Does anyone know the location of tutorials about reinstalling arduino on a board that had circuitpython installed? I have a matrix portal m4 i'd like to make arduino bootloader compatible again
CircuitPython is "just another program", so you just need to load an Arduino program as described above to get rid of it. Just double-click reset, select the proper serial port, and upload the Arduino sketch.
Let me rephrase what I understood. I do knot know what is an "lmk" analog signal, so just assuming it's just an analog signal. On the analog side you have a floating/independent/isolated power supply. You also have a +/- 10VDC signal that can be considered 0-20VDC signal. So your AGND ( your component datasheet page 2) is basically the output of a 10V Precision voltage reference (e.g. https://www.mouser.ch/datasheet/2/256/MAX6043-1389124.pdf). You would input your analog signal in AIN_1::4 after a voltage divider (for rescaling) and a fully diff OPA (for buffering if needed).
Would that work?
What arduino can put ou tthe most amps/voltages on motors ?
trying to find out the max weight an arduino could handle rotating
Not sure this is the right approach. Arduinos would have limited current and voltage output. You would need an arduino to drive e.g. a NMOS, a gate driver, or a motor controller.
arduino would handle the logic and I'd need independent power for the nmos/gate driver/motor controller ?
We're talking about a 40kg cart on 4 wheels btw
1 motor per wheel
which kind of motor?
Can't find the datasheet atm for the exact specs but something like this mounted on a copper rod on an aluminium chassis
Get the datasheet. It will 1) let you understand if you are getting the mechanical power output you expect or if you need a differnt motor, 2) let you know that is the electrical power you need to provide, 3) help you select an appropriate component for powering it (https://www.mouser.ch/Search/Refine?N=6783070).
I suppose since I can't find it a jga25-371 would be sufficient and each of them need 650mA at 12V
the jga seem to be an upgrade for the obsolete motor in the original project
thanks I'll continue the discussion in projects
A very rough datasheet is here: https://www.seeedstudio.com/JGA25-371-Geared-Motor-with-Encoder-p-4125.html. Not sure if data is reliable.
I would assume an H-bridge may be enough. https://www.adafruit.com/product/4489
Run two solenoids, or a single DC motor with up to 800mA per channel using the super-simple L9110H H-bridge driver. This bridge chip is an 8 DIP package so it's easy to fit onto any ...
What I fail to comprehend exactly is how an arduino that can't handle more than 200mA per pin can supply enough wattage/voltage/amp to motors
I mean when anything up the voltage from 5V to 12V aren't they lowering the amp as per ohm law ?
Or I completly misunderstand ?
And even then USB are 5V at 1A, not sure where it will get the total 16W to run all those motors at full power
You power that through a dedicated LDO or a DCDC converter. I assume you have a large battery or power from the mains. From the battery you power Arduino; a separate DCDC (isolated or not, that depends on the application) converter powers the motors.
Basically the motor controls something that in turn controls the motors.
Power tree is the magic word. Look here: https://www.analog.com/en/technical-articles/introduction-of-ltpowerplanner-program-a-system-level-power-architecture-design-tool.html
Modern electronics systems have an increasing level of complexity. There can be a large number of power rails and supply solutions on a system board. Before choosing or designing each individual power supply, the system hardware engineer first needs to understand the system power needs and then architect the system power tree accordingly to optimiz
Hi all, I need to assemble a prototype with an ESP32 in the next few days. Basically a few coin cell LRA, each driven by DRV2605 ( breakout with the same address) so I need an I2C channel switch.
At the moment I just have the Huzzah32, and I am drafting the sketch for Arduino/PlatformIO using the Adafruit library for the DRV2605. In parallel I am checking with a logic analyser SDA/SCL and some other control signals. Problem is, I am not able to get the basic demo of the library to to work with standard SDA/SCL pins (23/22). When using the Wire library, I2C works fine. Is this the right sub for this question?
You say when using the Wire library, I2C works fine: which pins is it working fine with?
The standard ones for Huzzah32: SDA-23 SCL 22 as in https://learn.adafruit.com/adafruit-huzzah32-esp32-feather/pinouts
I took apart my kitchen scale and I'm trying to use its strain gauge, but with it hooked up to 3.3v the voltages my ESP8266 reads from the signal lines seem entirely unrelated to anything I'm doing to the cell. Any suggestions where to go from here in troubleshooting? I'm not super confident in the connections I've made to the breadboard.
I do still have the original controller so I could hook it back up to that if need be to check that it's still working.
I stand corrected - it appears related to the... orientation in which I hold the strain gauge?
Currently suspecting poor wiring
Yes, typo on the ‘lmk’ it’s just a +-10VDC analog signal. For more info it’s a current clamp. So the polarity corresponds to the direction of current flow. I had tried to solve this with just an Op-Amp, scaling it down to a +-1.6V signal, and then adding a 1.6V source, this way I could just put it into an Arduino pin. But when I tried to replicate a circuit from a simulator I found, it didn’t work on my breadboard. Is this similar to what you’re suggesting?
Can you post the circuit?
With a load cell that still works with its original control board, I'm not able to measure changes to the voltage on the load cell's sense+ line other than when it's powered / not powered. Any idea if the ADC precision is likely to explain the problem? I do see a 16-bit ADC, and this board (QT PY SAMD21) has 12-bit.
Could be: load cells are used in a bridge configuration with narrowband high gain amplifiers and an excitation voltage: fairly specialized circuitry.
Hi can i power an arduino nano rp2040 connect with 4AA batteries.
Arduino website says VIN of 5-21V
4 AA non-rechargeable cells in series would provide 4 * 1.5V = 6V when fresh, which is sufficient. However, if they were NiMH, the would provide 4 * 1.2V = 4.8V which is probably marginal.
That's marginal only when almost fully discharged. See discharge characteristics here: https://data.energizer.com/pdfs/nh15-2300gl1220.pdf
hey I have an object oriented Arduino question in #help-with-projects
Can't RP2040 boards run on 3.3V?
They can’t run higher than like 3.6V
3.3V is highly recommended
Guess that board has power regulation for higher voltages
is it me or elegoo is very shady ?
The download site for their stuff is an IP address and once you open it there are temporary microsoft words files (ie: those with ~ in it)
That sounds sketchy...
Maybe they don't want to pay and/or configure another domain just for a download server
Also don't see the temp ms word files in the ZIP file as well, maybe cause I don't have it lol
Haven't had any problems with them, lots of my parts come from them as well
Do you have hidden files visible? ~ files are hidden
mhm
Hmmm
Oh wait do I have to extract the ZIP first 🤦♂️
Still don't see any after extracting lol
NetherKitteh dun got hax'd
Hi to community,
First of all I want to appreciate Adafurit for such incredible products and libraries, and a special thanks for Adafruit AHRS Kalman library, implementing the original NXP library is a nightmare. I have been working with IMUs for a long time, and I used Adafruit BNO055 and Adafruit LSM9DS1 and lots of other sensor boards in my previous projects. I think the BNO sensor is a masterpiece but as you know you don't have access to source code nor matrices, so there is no possibility to manipulate the output. Having manipulation limitations on BNO I decided to use LSM9DS1, Now that I'm using it with the Adafruit AHRS library, the results are outstanding. Comparing BNO and LSM9DS1 outputs, LSM is a little bit shaky and unstable, so I decided to make some adjustments in library definitions, for example various noise constants and filter frequency, I also tried different ODR and FS setting on sensor but it had no noticeable effect. So I decided to ask to community,
What exact setting should be set for sensor?
Which frequency should I run the filter?
What should I do rather than above ones to get perfect and smooth output like BNO?
I will be happy for any advice from another perspectives too.
And your more than welcome to ask relative questions.
Best Regards,
Mason
You're right - rewatching the product video, it's demonstrated with a prototype 24-bit ADC board. Looks like Sparkfun has a board with one, but I don't see one from Adafruit.
It does seem a bit odd: AdaFruit sells load cells, but not a load cell amplifier. SparkFun offers a couple of nice ones like the Qwiic https://www.sparkfun.com/products/15242 and the less expensive https://www.sparkfun.com/products/13879
Anyone here know how to use the Shield V2 for stepper motors?
I am having an issue with mine.
I have been trying to figure this issue out for a while. My project requires accurate stepping values. For most of the program I have been using double stepping format. But for this last part of my project I am needing to use microstep and it is being a PAIN.
The issue I am having with it: I input a number of steps for it to run say 19000. It then only runs like 1/5 of the steps it actually needs to run. This issue never happened when I was using the double step. I then tried to find if microsteps have a different length for when it steps. my system runs at 800 steps per rotation and I have been running a double then microstep program to see the differences.
At low values such as 800 - 3200 steps the microstep goes the exact amount it should being the desired rotations. But after I pass 3200 steps (4 rotations) it starts to do wierd stuff. It only goes one rotation. But then I tried 10 rotations and it does about 4.5 rotations. I have no idea why this is happening and I really need help solving it.
@mortal ridge Microstepping with the TB6612 chip is not something I personally have experience with, but given what I know about it, it's not the most reliable of modes and I'm not sure how it even manages it. Given that this chip is really not meant to output analog values, it is probably using PWM to create the intermediate voltage values for the microsteps, and that could cause issues if the timing isn't perfect.
If you want reliability over resolution, Interleaved is a great way to increase resolution without having to attempt microstepping. It's twice the resolution of your double, and I believe half that of your microstepping.
I know people have successfully microstepped with it, but it's not really designed to be able to do it well. Real microstepping drivers will use an internal resistor ladder to provide voltage levels for specific microsteps, so they can more accurately hold certain microstepped angles. I would imagine a PWM-simulated microstepping system to consistently miss or gain steps if the phase and frequency control isn't up to par at the speeds it is running at.
I have made a code that transforms audio input into patterns on an LED strip using an ESP8266. From there I wanted to upgrade to an ESP32 by adafruit so I bought an ESP32 breakout board which I were not able to upload code to trough my PL2303 USB to UART converter. So in order to save time I ordered the adafruit ESP32 feather board instead which has a microUSB built in for easy uploading. The code now uploads fine but the buttons that I have connected to the ESP32 feather self-trigger. And they self-trigger more if I make a sound in the sound sensor that I have connected to the same ground as the buttons.
Now as of a couple of minutes ago I can no longer upload code to the feather board. It sais Connecting.....___..... and so on untill A fatal error occurred: Failed to connect to ESP32: Invalid head of packet (0x00)
*** [upload] Error 2
so im trying this "Hack" for FastLED to run SK6812 RGBW strip -> https://www.partsnotincluded.com/fastled-rgbw-neopixels-sk6812/
std::vector<CRGBW> _Ledss;
std::vector<CRGB> *_Leds = (CRGB *) &_Ledss;
error
In file included from src/LEDPattern.cpp:1:0:
include/LEDController/LEDPattern.h:18:48: error: cannot convert 'CRGB*' to 'std::vector<CRGB>*' in initialization
std::vector<CRGB> *_Leds = (CRGB *) &_Ledss;
^
In file included from include/LEDController/LEDController.h:8:0,
from src/main.cpp:6:
include/LEDController/LEDPattern.h:18:48: error: cannot convert 'CRGB*' to 'std::vector<CRGB>*' in initialization
std::vector<CRGB> *_Leds = (CRGB *) &_Ledss;
^
what am i doing wrong?
Is there a safe way to know if someone touched a door handle that's connected to an arduino from the inside ?
ie: don't want the exterior handle to show any sign, would like to use conductivity to know that
take a look at capacitive touch detection
Another question for the Shield V2. I am wondering about the RPMs of the motor. It doesnt seem to make much of a difference when adjusting the values. Are there mins and maxes to them?
You’re mixing std::vector and pointers. What is it you’re trying to do there?
i want to drive SK6812 RGBW Strips with FastLED
Did you write LEDPattern.h?
yea
it's weird tho
i see a line // FastLED.addLeds<SK6812, DATA_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
i tried it but get weird results on my SK6812 Strip :S
The FastLED library for colored LED animation on Arduino. Please direct questions/requests for help to the FastLED Reddit community: http://fastled.io/r We'd like to use github "...
Weird in what way?
There is a hard limit, but you would probably be limited by power draw and microcontroller limits before reaching them. Usually these speed are limited by how fast your microcontroller can switch states; once you get above a certain speed, the microcontroller will no longer be able to finely adjust the speed, giving you a fairly constant rpm. In the other direction, the minimum does not exist, but at a certain velocity, the rotation will appear to be less of a smooth spin and more of a single step at a time.
this happens :S
I suspect you're getting numbers that are too large to fit in the variables. An int in an Arduino is only 16 bits.
@north stream @pine bramble @cedar mountain and everyone else that has helped, it's much appreciated. This is a project I recently finished and you guys definitely helped me figure out some of the component values I needed, among other things. Thanks a ton!
the project pictures are at imgur.com/a/O8sbTRp
lol, discord apparently doesn't like imgur links, it butchers everything pretty bad when you use them
Hi, I am having a really strange issue with my project. I am using an arduino nano with a rtc, neopixels and some other components. they work fine on the breadboard but then I soldered my own perf board and now all it does is constantly print the first println statement in the code and wont do anything else. what what would cause this? it has to be some sort of hardware issue no? any suggestions would be really helpful
It could be a hardware issue, or a weird software problem, or a weird combination like a power glitch
@unborn frost Can you post your code, and pictures of your soldering work? I wonder if any solder connections could be problematic.
Thats what im thinking now. I reduced some delay and now its printing a little more so I think something is connected that shouldnt be
I am going over all my solder connections now
Good day! I am trying to set a global variable inside a case statement. The overarching goal is to set use network to either create an AP or log onto an existing network. See different cases for my attemps to resolve. I have also used different ways of declaring the global.
char ssid[];
char pass[];
int useNetwork = ;
bool createAP;
# include "AP_secrets.h" AP_secrets file
void setup() {
while (!Serial);
Serial.begin(115200);
switch (useNetwork) {
case 1:{ // 5sci
char ssid[] = FiveSci_SSID;
char pass[] = FiveSci_PASS;
createAP = false;}
break;
case 2:{ // customer wifi network
ssid = UT_SSID;
pass = UT_PASS;
createAP = false;}
break;
case 3:{ // Access point
char localSsid = AP_SSID;
char localPass = AP_PASS;
createAP = true;
ssid = localSsid;
break;
default: { // used for errors and for case 0
char ssid[] = "";
char pass[] = "";
createAP = false;} // your network key Index number (needed only for WEP)
break;
}
Serial.print("Outside of case, SSID equals: "); Serial.println(ssid);
}
void loop() {
// put your main code here, to run repeatedly:
}
@strong jewel The basic one is when I get to the print statement, ssid is not the value I want. It does not carry outside of the case statement to the global variable.
I got a Dumpster Dive with 13 load cell amps, and no load cells LOL
From Sparkfun
Best thing I ever purchased from Sparkfun
@strong jewel in the AP_Secrets.h. Not included, but the values are coming through into the case statement.
wow, how much was it?
$20
They do them about once or twice a year
They're in stock for like 5-10 minutes
I'm serious
$10
I got 2 Arduinos, 4 Makey Makeys, 5 shields.... it goes on
I wont be able to explain why yours wont work, but try the strcpy() function as seen here: https://www.codegrepper.com/code-examples/whatever/strcpy+arduino
/* strcpy example */
#include
#include
int main ()
{
char str1[]="Sample string";
char str2[40];
char str3[40];
strcpy (str2,str1);//str1 copies to str2
strcpy (str3,"copy successful");
printf ("str1: %s\nstr2: %s\nstr3: %s\n",str1,str2,str3);
return 0;
}
@strong jewel Will do! Thanks
also, I think you need to declare a length when you initialize ssid[],
maybe just try that first
ssids are max 32 characters long, and a WPA2 passkey is max 63 long
@strong jewel I tried that, but I get a mismatch with the actual lenght of the SSID and pass.
I think ssid and pass should both be char*.
Declared before, assigned within the switch.
@leaden ruin Not sure what you mean by char* It appears the * is pointer, but char* isn't in the reference
You can also just pass pointers around. ```c
char * curSSID;
char * curpass;
...
switch (useNetwork) {
case 1:
FiveSci_SSID;
curSSID = FiveSci_SSID;
curpass = FiveSci_PASS;
break;
}
Or get fancy and have an array of structs with all the SSIDs and passwords in it, and just store a global index (or pointer) into it.
does anyone know how i'd check if this LED backpack is on or off?
it's one of these dudes:
i could but i'd rather query the device itself - but if that's the way to do it, i'll stick with that!
Anyone here get TinyUSB mass storage working with LittleFS?
From the chip data sheet https://cdn-shop.adafruit.com/datasheets/ht16K33v110.pdf : The "S" bit (D8) of the System Setup register is set to 0 for standby. Additionally, the "D" bit (D8) of the Display Setup register is set to 0 for display off.
oh neat, im new to this so i didnt know to look for that - thanks!
Throwing a hail mary in the hopes that someone my see the mistake i'm overlooking. I'm trying to control power to an Arduino Nano 33 IoT board with a TPL5110. The idea is to have the Nano power up, connect to WiFi, publish a payload over MQTT, signal done to the TPL5110 and rinse and repeat every fifteen minutes or so. Here is my code:
#include "WiFiNINA.h"
#include "PubSubClient.h"
#include "ArduinoJson.h"
// TPL5110 setup
#define DONE_PIN 4
// WiFi setup
char ssid[] = "MY-SSID";
char pwd[] = "MY-PASSWORD";
WiFiClient wifiConn;
// MQTT setup
char MQTT_HOST[] = "192.168.0.80";
int MQTT_PORT = 1883;
PubSubClient client(wifiConn);
void setup() {
Serial.begin(115200);
pinMode(DONE_PIN, OUTPUT);
digitalWrite(DONE_PIN, LOW);
// Setup WiFi connection
Serial.print("Connecting to: ");
Serial.print(ssid);
WiFi.begin(ssid, pwd);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
// Open MQTT connection
client.setServer(MQTT_HOST, MQTT_PORT);
client.connect("esp32-tpl5110-test");
Serial.println(client.state());
// Build MQTT payload
DynamicJsonDocument jsonPayload(200);
jsonPayload["sensor"] = "ESP32-Test-Sensor";
char strPayload[200];
serializeJson(jsonPayload, strPayload);
client.publish("esp32/tpl5110/test/", strPayload);
client.disconnect();
digitalWrite(DONE_PIN, HIGH);
delay(500);
digitalWrite(DONE_PIN, LOW);
delay(500);
}
void loop() {
}
Attached is a picture of my breadboard and wiring. Thank you in advance for any help you might offer.
Jason
Hi there! I am trying to get some example code working with a SAME51 (Metro M4 CAN Feather) and an SD card. I want write data to a file on the SD card, then make it accessible as a USB MSC. Independently, the datalogging and MSC SD card examples work fine, but I'm in integration heck trying to get them to work together.
Here is the code: https://pastebin.com/Bijyfc1c
Any help or advice would be apprecitated! If there's a good guide on using MSC on Arduino, that would also be awesome to have 🙂
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
With the motor shield V2. Can you still use ports and stuff to do other things like relays, Bluetooth modules or other things that require a plug in?
The motor shield v2 only uses I2C for communication, all other pins are still available. I2C is also available to other devices, so long as you avoid conflicting addresses, it should work.
Now the TinyUSB MSC SD example is not working. I would really appreciate anyone who could help me understand this black magic
What kind of failure are you seeing?
The Nano is not getting an IP address from my router when powered through the TPL5110. As a result, the MQTT broker never gets a message. As soon as I switch to USB power on the Nano directly, it gets an IP address and a message in the MQTT broker.
You do get WiFi connected?
Only when powered by USB directly on the Nano
Ah okay, so no WiFi and no IP address. It could be the WiFi is drawing some high current pulses to operate and the TPL5110 has some series resistance. It might be worth adding some capacitance on the downstream side to see if that helps.
Okay thanks! I'll give that a shot!
I was thinking of trying to read Serial1 from the Nano through GPIO on a Raspberry Pi. Any value in pursuing that? Or am I wasting my time?
I'm having trouble getting a sketch using i2c from a Leonardo running on an trinket m0. I verified the i2c device is getting 3.3 from the microcontroller, and double checked wiring. the sketch without comments runs as expected on leonardo, but locks up on line 11 on the trinket:
line 11 is: Wire.requestFrom(addr,2);
are you sure it's line 11? put another serial print in before the while loop.
when I comment out line 11 it spams stuff
at that point it's just a loop with a print, so expected
what is the behavior of the code above, as shown, on trinket and leonardo?
I'm a fan of all forms of getting more info for debugging, including that one. Even blinking an LED can be useful.
If you have a neopixel you can do color blink codes too
Working on it
Motherboards will often do things like patterns of long and short blinks or beeps for error codes - that can be helpful
I know this might sound like a weird question but is your I2C bus pulled up?
@stuck coral I'm not sure. I got a module I'm testing with and all I was told is the address, connections and voltage
What module with what board?
Oh I see which board
if pull ups were missing, wouldn't expect either board to work
The Arduino would work just fine, but would hang during a i2c transaction because SCL is low
Its trying to follow the i2c spec in a dirty OSless and agnostic way
"work" = i2c works
Dont most avr arduinos have the pull up?
And dont trinkets lack it
I could verify but cooking
@knotty rover what's the module?
I was wrong the Leonardo does not appear to have pull ups on board but was right about the trinket, some do. And the atemga32u4 doesnt default to using internal resistors when enabling the twi interface
So I guess its probably not that, but I would still question either the level on SCL, or having the correct wiring
@leaden walrus its a sealed pakage for a work project. the part i'm confused on is why it work on leonardo and not Trinket M0, same code and wiring
Can anyone help me to convert this code: https://drive.google.com/file/d/1FF6mw2E0dL5sPhB1DL2y0G1wNADtPhgu/view from motorsheild v1 code to v2 please
What pin should I be using as the chip select for an itsy bitsy 32u4 ?
Generally any GPIO is suitable. You just tell the SPI driver which one to use.
Duh, sorry. that was silly
Not at all. A lot of pins have special function restrictions, so it's a natural question. Some chips do have dedicated chip-select lines managed by the SPI hardware, but many software drivers prefer to handle it themselves instead.
@knotty rover try running this i2c scanner on both the leo and trinkey with the module attached:
https://playground.arduino.cc/Main/I2cScanner/
see what behavior you get with each platform. are they both able to detect and return the module's address?
It's reading the card just fine when I run the cardinfo sketch example from sd now.
But when I try to take a picture (with snapshot sketch example from TTL serial camera examples), now just nothing happens. no errors or picture taking
@leaden walrus The results of that sketch are really strange. When I have no devices plugged into the leonardo, it says no devices found, but when I have no devices plugged into the trinket it finds devices, and on each succesive run, it finds more . . . I have no clue what that means
@knotty rover what about with something connected?
with the previous device, it locks up, I'm going to wiring up another device i have soon to test
interesting. yah. try something else if you can.
see if lock up is specific to that device, or specific to leo/trinket.
it works fine on the leo
just locks up on the trinket
i just bought the trinket for this project, never used it before
I usually use a huzzah32, but needed the usb hid support
so if the scan works ok on the trinket with some other device, we know it's something specific to the device when used with trinket
scans fine on leonardo
does the trinket lockup scanning any i2c device. or just the specific one you are currently testing?
another device didn't work on the trinket, I tried an apds-9960 on it too
one of these?
https://www.adafruit.com/product/3595
yes
i've used them with the huzzah before with no issues as well
I did run blink on the trinket to make sure it wasn't "dead"
thanks, i appreciate it. . . now i'm just confused
is there anything unique with your setup?
or are you pretty much just wiring like above?
i ran off 3v instead of usb, but the adps is rated for either, so that shouldn't of stopped it, the other device i'm using is 3.3
aside from that i'm wired the same
above is with 3v also, not usb
trinket 3v to Vin
trinket GND to GND
trinket 0 to SDA
trinket 2 to SCL
I just rewired to make sure thats how I had it hooked up, locks up still after scanning
if I unplug it, it start finding lots of random devices that aren't plugged in
can you post a photo of your setup?
i just wired up an official 9960 instead of a knock off, and it detected
the knock off detects on the leonardo though
and i see the same behavior on the other module i'm trying to use
I have a longer (750 lines) code project using GPS. LSM accelerometer and SD. The problem is that I am getting only partial lastNMEA messages. The GPS data needs to log once every two minutes, and the accel data every 30ms. Full messages look like this$GPGGA,220054.000,3720.0682,N,12156.7628,W,2,08,1.12,22.0,M,-25.7,M,0000,000$0,,6304$PGTOP,11,3*6F newNMEA $GPGGA,220055.000,3720.0682,N,12156.7628,W,2,08,1.12,22.0,M,-25.7,M,0000,00R52,851 newNMEA $PGTOP,11,3*6F and I am getting ```
newNMEA
2.97$PGTOP,11,36F
newNMEA
$GPGGA,220243.000,3720.0676,N,1215620
2.,,$PGTOP,11,36F
newNMEA
$GPGGA,220244.000,3720.0676,N,1,,M3,6,$PGTOP,11,36F
newNMEA
$GPGGA,220245.000,3720.0676,N,1,2.,650$PGTOP,11,36F
I think the issue may be opening, writing, and closeing the data file for accel data each read.
Can I just write without closing for a couple minutes?
Yes, that would be the typical pattern. The SD driver would only write to the card every 512-byte block.
OK, thanks.
Hi sorry if this is not the correct place to ask. On the adafruit feather 32u4 le is it possible to connect a battery to the BAT and Gnd pins for charging instead of the connector?
Yes, from the schematic it looks like the header pins are just directly wired to the same circuitry as the battery connector pins.
#include <Arduino.h>
#include <M5Core2.h>
void checkLCDTask(void* pvparams){
TickType_t lastTick;
while(1){
M5.update();
if(M5.Touch.ispressed()){
TouchPoint_t currentTouch = M5.Touch.getPressPoint();
Serial.printf("%d %d\n", currentTouch.x, currentTouch.y);
}
vTaskDelayUntil(&lastTick, 20/portTICK_PERIOD_MS);
}
}
void setup() {
// put your setup code here, to run once:
M5.begin(true, false, true);
xTaskCreate(checkLCDTask, "CheckTouch", 2048, NULL, 2, NULL);
}
void loop() {
// put your main code here, to run repeatedly:
}
Hey I'm trying to get my M5Stack Core2 capacitive touch screen to work with FreeRTOS but this code only prints -1 -1 when I run it and touch the screen. The capacitive touch sensor connected by i2c and shares the bus with a few other components. If I put the M5.update() line in the loop function it'll print the correct coordinates for a few seconds of touching but then go back to only -1 -1. Any ideas what could be going wrong or suggestions on how to get it to work are appreciated!
vTaskDelayUntil(&lastTick, 20/portTICK_PERIOD_MS);
you have void loop
but you have while(1)
i don't really understand this vTaskDelayUntil function
or xTaskCreate... but assuming they work...
then maybe you shouldn't be creating your own loop and when you do you're not running everything that needs to be running each cycle
which is why you're supposed to use loop()
but i'm just guessing
I'm using FreeRTOS tasks to run the capacitive touch reading, vTaskDelayUntil ensures a consistent update rate of the touch processing task and xTaskCreate starts the task
The capacitive touch system does work if I put it in the loop function but I'm not sure how the Arduino loop function plays with FreeRTOS's ecosystem
Yeah, this is the first time I've seen someone try to use both task frameworks. Normally you would give execution control to the FreeRTOS scheduler when you call vTaskStartScheduler, and that would never return.
I think vTaskStartScheduler is automatically called at the end of setup, I did a quick search and found FreeRTOS calls the loop function while it's idling which I think would mean it's a bad idea to run code in the idle function?
Gotcha, that would make sense. It should be fine to run code in the idle loop function. It would just be a regular task, albeit the lowest-priority one.
Good morning if you are in on the left coast! Trying to swap the speed of my GPS data and cannot compile. Code: ```# include <Adafruit_GPS.h>
#define GPSSerial Serial1
Adafruit_GPS GPS(&GPSSerial);
void setup()
{
// 9600 NMEA is the default baud rate for Adafruit MTK GPS's- some use 4800
GPS.begin(9600);
// GPS.sendCommand("$PMTK251,576002C"); //set baud rate to 57600
GPS.sendCommand("$PMTK251,3840027"); //set baud rate to 38400
// GPS.sendCommand("$PMTK251,1920022"); //set baud rate to 19200
// GPS.sendCommand("$PMTK251,960017"); //set baud rate to 9600
GPSSerial.end();
GPS.begin(38400);
}
Error:Arduino: 1.8.13 (Windows 10), Board: "Adafruit Feather M0, Small (-Os) (standard), Arduino, Off"
c:/users/owner/appdata/local/arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Owner\AppData\Local\Temp\arduino_build_746358/..\arduino_cache_219631\core\core_1f5957130553e6c77d214ff01b550a0d.a(main.cpp.o): in function `main':
C:\Users\Owner\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.3\cores\arduino/main.cpp:54: undefined reference to `loop'
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for "Adafruit_ZeroDMA.h"
Used: C:\Users\Owner\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.7.3\libraries\Adafruit_ZeroDMA
Not used: C:\Users\Owner\Documents\Arduino\libraries\Adafruit_Zero_DMA_Library
exit status 1
Error compiling for board Adafruit Feather M0.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
M0 Adalogger with Ultimate GPS feather.
If this is the entire program, you need to have a void loop() in there somewhere, even if it is just void loop() {} (If I remember correctly)
@tough snow Cookie for you!!!
Fix it?
Yes, thank you!
I'm trying a similar test to this again but with the project set up for esp-idf but when I compile it says it can't find FreeRTOS.h, I have .../.platformio/packages/framework-espidf/components/freertos/include/freertos in my browse and includepath. Any ideas?
omg lol I fixed it
I just put yield(); in the loop function
Nice!
I need help with multiple i2c devices on a mkr1000. I have a tof sensor and a oled disp, an accelerometer , and hope to add several more. I have the addresses of each device and have them attached to the right pins but i dont know how to use the addresses. Also when i run a device scan, the scanner only picks up the oled display. If i plug in more than the oled display ill either get no devices connected or a seemingly random list of addresseses that changes with each scan.
start by getting the scan to work as expected
you say you have the addresses, where did you get them?
I'd triple-check your wiring. The problems when plugging in additional devices sounds like you may have SDA and SCL swapped on some of the connections.
Also, some devices are dual-mode I2C and SPI, so they might need some sort of jumper setting to make sure they're in I2C mode.
documentation.
and they're all different?
yes
do you know if pullups have been taken care of?
do you have links to the sensors being used?
https://wiki.seeedstudio.com/Grove-OLED_Display_0.96inch/ https://learn.adafruit.com/adafruit-bno055-absolute-orientation-sensor/downloads here's two of them
if i can get two working i should be able to figure out the others
the adafruit bno055 breakout has the needed pullups
i can get the signal scanner to register the oled but not the bno055
have you tried scanning with each device attached separately?
ill do that right now.... yeah it wont show up
"it" = ? which one?
the bno055
when it's plugged in by itself the serial monitor stops wororking and says 'failed to connect'
what does an i2c scan show?
when the bno050 is the only thing connected to the i2c ports it's frozen
when nothing is plugged i get
Scanning... I2C device found at address 0x60 ! done
maybe something built in to the mkr1000?
looks like the mkr1000 includes pullups
do i have to do anything in that case?
no
yeah it was my joints
cool. good job figuring it out.
fyi... I just posted an issue on github against the latest version of the Adafruit BusIO library (1.9.0), since it broke device reads for one of my sensors (PMSA003I) that uses the Adafruit PM25AQI library.
I was able to reproduce the issue with the PM25AQI library Example program with Adafruit BusIO version 1.9.0, and have things working again by rolling back to Adafruit BusIO version 1.8.3.
hmmm weird why FastLED lib has "SK6812" LED Strip type but it does not support it :S
Hi, I am having an issue with a photoresistor and its really confusing me. I am using an arduino uno 5v to one leg, A5 to the other leg and a 5K resistor to ground. Attached is an image from the serial plotter. can anyone explain this?
Even when I unplug the jumper from A5 to the second leg it produces the same result. only if I unplug the wire does it stop. Does that mean somethings wrong with the uno?
What is it supposed to be, and what are we seeing
its a photoresistor, it should give a value based on the light no? all im doing is printing the analogread of the A5 pin
What's the time scale? It could be a 60Hz hum, either from radio interference in the wiring or from the lights in your room themselves.
it goes on like that forever
The graph doesn't really have a scale which is what I was confused by
Ok well I just tried it with a diff arduino and it works fine there. so it seems it was just a board issue
Hi ya'll! For those who have worked with the propMaker featherwing (https://learn.adafruit.com/adafruit-prop-maker-featherwing/pinouts), how do I use and lower the volume?
I tried turning the surface mount potentiometer with a small flat-end screwdriver, but in being gentle, i ended up breaking it off!
(really, the core problem is that all .wav files are too loud, and I need to uniformly lower the volume. If it helps any, I'm using CircuitPython.)
this -> https://github.com/EmteZogaf/FastLED/tree/dma claims to be a FastLED fork with RGBW support but i can't get it to work :S
in the readme all it says is
To use this, add this define somewhere above where you #include <FastLED.h>:
#define FASTLED_RGBW
The main FastLED library (successor to FastSPI_LED). Please direct questions/requests for advice to the g+ community - http://fastled.io/+ - we'd like to keep issues to just tracking bugs/...
What is the best way to handle 2+ interrupts on the arduino mega 2560? I need to use pins 48 and 49 connected to timer interrupts 4 and 5 due to the input capture unit. But I want to be sure I don't have a timing conflict or worse. Advice?
I think interrupts are blocked while servicing interrupts, but I don't remember if they're latched.
hi there!
i wanna try making NES level sound on an arduino and speaker
i can make square waves of different pulse widths and frequencies, which is good
but i can only make it in one channel
as soon as i try making another audio channel, the whole thing kinda falls apart
i tried sending different square waves to two different pins
that both connect to the speaker
and it comes out as one square wave that's a strange blend of the two
now, i thought that it was because of me just plopping two wires into the same row on a breadboard without any other components
that seems like it could do that
BUT that's not why
because i disconnected one of the pins, and it played the same sound
so i disconnected that pin and i connected the other pin, and it made absolutely zero sound
so i have no idea what's happening
@pseudo abyss how are you creating the square waves?
oh i did
tone(pin, frequency);
delayMicroseconds(1000);
noTone(pin);
delayMicroseconds(1000);```
tone uses a timer so I don't know if you can easily to do two tones on different pins
..
can somebody suggest me an algorithm for my line following robot to follow this path
it has 6 IR sensors at the front
turn if angle below thresh, with priority on right turn vs. left turn.
although right turn on last pentagon seems like an outlier case
does anybody know if it'll damage the radio or the rest of the board if i power on the Adafruit Feather M0 RFM95 LoRa without an antenna attached ( wire or uFL )?
Looking up the SparkFun NAU7802 I sure didn't expect to find this two-year-old abandoned AdaFruit variant: https://github.com/adafruit/Adafruit_NAU7802
what info does it know about its environment? how are do not pass routes communicated to it and how does it follow the line?
Hi, does someone know if it's possible to protect the contents of an internal EEPROM, my desired case Atmega32u4, from beeing read by unauthorized people?
If I got the Infos right, I should be able to change the bootloader a little bit, so it does erase the EEPROM if someone uploads a new sketch and also lock the bootloader, so you gotta erase the whole chip if you want to change the bootloader, is that correct?
gotta ask, i want to send gifs and / or images (jpg and stuff) from my Qt App over to ESP32 via Socket! is there any limit in size? i plan to store them on a 32Gb Sd-card that is connected to my ESP32
I would think the only limit is where you will be storing the image on the ESP32.
Can the Socket code write the image directly to the SD card?
If not, you might need a memory buffer for the Socket code to write the image into and then you have code to write the image from memory to the SD card.
@quick hornet i dunno, can WebSocketsServer write the image directly to sd-card?
I don't have experience with that library. I'm just thinking about it from a code architecture point of view.
I assume your code use no GPL v3 or LGPL libraries? Because locking GPL v3 is a clear copyright violation
There is no code yet
I'm not talking about the sketch
Oh, you want to use the internal ROM
I want to use the 1k EEPROM for data that will change from time to time, but I don't want it to be read by someone else
Is the data that is changing being written to the EEPROM from your code?
Because if your code is writing the data then you could encrypt the data when you write it and then decrypt the data when you need to read it in your program.
Not exactly sure what you mean by written from code. And I'm also not sure if you can encrypt that much data to 1kb EEPROM.
I also wanted to know if the method I thought about works.
I don't know all the details about your situation.
Is the data you want to protect stored into EEPROM while the microcontroller is running? Does the microcontroller write the data you want to protect?
Keyboard emulating nfc reader
Is the 32u4 running code that looks like this EEPROM.write()...? Or something similar
But instead using the uid I want it to store the pw on EEPROM and post it when tag is presented.
Write the password to EEPROM which is stored on the tag and delete it from the tag after saved
What data does the tag have?
The uid
Ok, so you scan the tag and the 32u4 will "type" the password on a computer?
👍
Ways that I've seen bank equipment get around that is you have tamper resistance around the device and when it's tampered with it will erase everything on the device.
That usually involves a backup battery so that the passwords are stored in ram and when it's tampered with the power gets cut off from the ram so the passwords are deleted.
That's overkill
Well you want to protect someone from accessing an internal EEPROM
There are also safe EEPROM which doesn't require battery
They would have to extract the eeprom from the chip and not ruin it
And then hookup the eeprom to another device to read it
Not sure if you can extract the EEPROM from a 32u4
Then why worry?
If my assumption was wrong, you could upload just a sketch to the flash that spits out the EEPROM contents
Have you checked if the eeprom gets erased after flashing a new sketch?
I would just make a simple test sketch and if you can read old eeprom values then you know you need to worry.
Usually you can select that, on esp8266 at least I know for sure
Could you please scroll up and read my question again carefully
I'm have to go to class, I hope you figure it out.
Hi, does someone know if it's possible to protect the contents of an internal EEPROM, my desired case Atmega32u4, from beeing read by unauthorized people?
If I got the Infos right, I should be able to change the bootloader a little bit, so it does erase the EEPROM if someone uploads a new sketch and also lock the bootloader, so you gotta erase the whole chip if you want to change the bootloader, is that correct?
It's just a basic ir sensor based robot with 6 ir sensors mounted at the front
the physical arrangement of the sensors is key. you can use their offset-ness as a way to determine intersection angles in a crude way. by which one(s) see the line first.
/\ vs. -|- vs. \/ etc.
I have a question trying to build lora tx/rx and I am trying to use a Freather RP2040 . I am using the Arduino examples. I want to add a new #define line. I tried #if define(FEATHERRP2040) but does no see the board. Where might I find the board details for the correct #define name. Other examples the code were #if define(ESP32 and ESP8266 etc.. hope this make sense
I can think of two approaches: one is to turn on verbose mode in the IDE and see what the compile command looks like. The other is to look at the package files installed with the board for description and header files containing the definitions.
hi, anyone have using STPM33 for measuriing power ?
I can't understand how to acces that and i hope get some help.
thankyou
anyone worked with FTP server for ESP32?
[08:57:03] [R] Logged off: 192.168.10.122 (Duration: 1 minute 37 seconds)
[08:57:05] [R] Connecting to 192.168.10.122 -> IP=192.168.10.122 PORT=21
[08:57:05] [R] Connected to 192.168.10.122
[08:57:06] [R] 220--- Welcome to FTP Server for ESP32 ---
[08:57:06] [R] 220--- By Peter Buchegger ---
[08:57:06] [R] 220 -- Version 0.1 ---
[08:57:06] [R] USER ftp
[08:57:08] [R] 331 OK. Password required
[08:57:08] [R] PASS (hidden)
[08:57:09] [R] 230 OK.
[08:57:09] [R] SYST
[08:57:11] [R] 215 UNIX Type: L8
[08:57:11] [R] FEAT
[08:57:13] [R] 211- Extensions suported:
[08:57:13] [R] MLSD
[08:57:13] [R] 211 End.
[08:57:13] [R] PWD
[08:57:14] [R] 257 "/" is your current directory
[08:57:14] [R] CWD /
[08:57:16] [R] 550 Directory does not exist
[08:57:16] [R] PWD
[08:57:17] [R] 257 "/" is your current directory
[08:57:17] [R] PASV
[08:57:19] [R] 500 Unknown command
[08:57:20] [R] List Error
[08:57:20] [R] PASV mode failed, trying PORT mode.
[08:57:20] [R] Listening on PORT: 57952, Waiting for connection.
[08:57:20] [R] PORT 192,168,10,107,226,96
[08:57:20] [R] 200 PORT command successful
[08:57:20] [R] LIST -al
[08:57:22] [R] 150 Accepted data connection
[08:57:22] [R] 550 Can't open directory /
[08:57:22] [R] LIST
[08:57:23] [R] 150 Accepted data connection
[08:57:23] [R] 550 Can't open directory /
[08:57:24] [R] List Error
i can connect but i get
[08:57:20] [R] List Error
[08:57:20] [R] PASV mode failed, trying PORT mode.
Hi! I'm working with an Arduino ATmega328P and a LIS3DH accelerometer. I found a CircuitPython function for the LIS3DH that uses math to detect a shake motion (see code link below). I'd like to use this in my Arduino project but the searches have been fruitless.
Has someone already converted this code to C? https://circuitpython.readthedocs.io/projects/lis3dh/en/latest/_modules/adafruit_lis3dh.html#LIS3DH.shake
Had to paste link because my post ran out of characters.
What filesystem are you pointing the server at?
SD
@trail swallow
#include "ESP32FtpServer.h"
#include "SD.h"
#include "SPI.h"
#define NFC_SCLK 33
#define NFC_MISO 32
#define NFC_MOSI 21
#define NFC_SS 22
SPIClass spi = SPIClass(HSPI);
FtpServer ftpSrv;
namespace FTP
{
void init()
{
spi.begin(NFC_SCLK, NFC_MISO, NFC_MOSI, NFC_SS);
if (SD.begin( NFC_SS, spi, 80000000))
{
Serial.println("SD opened!");
ftpSrv.begin("esp32","esp32"); //username, password for ftp. set ports in ESP32FtpServer.h (default 21, 50009 for PASV)
}
if( SD.exists("/content") )
{
Serial.println("Folder /content was found!");
}
}
void loop()
{
ftpSrv.handleFTP();
}
};
Are there any good apps/libraries for bluetooth control of neopixels/ws2812b leds? I'm working on a neopixel longboard variation with an ESP32 and all the recommeneded libraries I find are for wifi not bluetooth so wouldn't work for my application
With it being a longboard I’ll be away from any network I can keep the ESP32 connected yoo
Do you have an example of the behavior you’re interested in? Does it allow you to control them as though they’re local? How hard does it look to adapt a WiFi-using library that otherwise does what you want to use Bluetooth?
Having difficulties with web access to arduino SD card with WiFi. I followed Serving Files Over the Internet on learn.adafruit but I have not been able to load more than one file... after that it
From serve files over ethernet on learn.adafruit
@small pumice What happens after that? It looks like your message got cut off. Could you post your code as well?
@trail swallow The full code that compiles is directly from https://learn.adafruit.com/arduino-ethernet-sd-card/serving-files-over-ethernet
My code runs nearly a thousand lines. Everything about reading sensors and creating .csv files is working OK, so I just copied this with the exception of swapping WiFi for Ethernet and put it into a loop so it blocks writing to the files while a client is connected.
I have the Ardiuno Super UNO R3 project….. what display will pair well??
Disregard messages above regarding serving files, found a typo DOH!
Congrats on finding it! Where was the typo?
What are your needs? Any preference between 7-segment, LCD, OLED, e-ink?
@trail swallow I had moved the definition of the index variable to a global, and the example code defines it locally, so I changed it back to that and ZOOM, off and running.
I like oled
i hope this is the right channel to write this here. So I'm making an android app that uses the phone's inbuilt IR blaster (if it has one) to act as a TV remote for my Sony Bravia TV
I'm currently trying to find out how I can record the IR frequency/patterns that my TV remote sends so I can hardcode the same patterns into my app, so each button in the app sends the same signal as the corresponding button on the physical TV remote.
I read the guide https://learn.adafruit.com/ir-sensor and what I think I need to do is buy the Adafruit Metro 328, connect an IR sensor to it, and run the code listed on https://learn.adafruit.com/ir-sensor/using-an-ir-sensor, and then point my TV remote at it pressing all the buttons and it'll record & store each of the buttons' patterns and I can then hardcode these patterns for the corresponding buttons inside my app
hopefully I've mostly got that right and i roughly know what i'm doing
Hello, I am playing around with the Adafruit Macropad and am running into issues uploading Arduino code to it. When I try to upload a sketch, I get the following error:
[Warning] Output path is not specified. Unable to reuse previously compiled files. Build will be slower. See README.
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
Uploading...
Resetting COM9
Converting to uf2, output size: 165888, start address: 0x2000
No drive to deploy.
An error occurred while uploading the sketch
IntelliSense configuration already up to date. To manually rebuild your IntelliSense configuration run "Ctrl+Alt+I"
[Error] Uploading sketch 'examples\AdafruitMacropadDemo.ino': Exit with code=1```
It was just working earlier but it broke after I modified the factory example to use the speaker.
I would seriously appreciate any help debugging this!
And magically it just uploaded code?????
I've been looking on the learn website and I can't seen to find arduion code for the spooky eyes. Am I missing it somewhere?
I want to load it on an RP2040 with Arduino
nevermind I found it
Okay, So i have an issue..
When attempting to use this guide: https://learn.adafruit.com/animated-electronic-eyes/software
I seem to only get the blinking "adafruit" logo when attempting to program it on the RP2040
I've made sure that the pins are changed appropriately and using the right display header (ST7789)
I've attempted to use a few of the different "eyes" listed in the library but commenting one out and uncommenting another.
I tried removing the logo.h header, removed all references to the logo from the config file.. I don't know why it keeps defaulting to the logo and not using the eye header i've selected :/
Ugh, so it won’t work without a lot of work.. dang.. I need to look up translating the SAMD DMA code to work with the RP2040
So I'm trying to figure out why I can't seem to achieve a 1mhz clock on my Teensy 3.2. I'm only gettng 250khz
This is the code I have
IntervalTimer testTimer;
void setup() {
// put your setup code here, to run once:
pinMode(14, OUTPUT);
testTimer.begin(blinkLED, 2);
}
int state = LOW;
void blinkLED(void) {
state = (state == HIGH) ? LOW : HIGH;
digitalWrite(14, state);
}
void loop() {
// put your main code here, to run repeatedly:
}```
I tried setting the timer to 1 microsecond but that causes it to seemingly fail
Does anyone know what I could do to achieve a 1mhz clock?
This is the output from my oscilloscope
I don't have experience with the Teensy, but if you search up the documentation for IntervalTimer, maybe it will say the max frequency???
Also I believe state = (state == HIGH) ? LOW : HIGH; can just be state = !state; cause HIGH and LOW are just true and false. And it would make more sense for state to be a bool instead of an int.
I'm trying to get the All-Seeing-Eye code working on a Raspberry Pi Pico and it seems the original code does not work well (quite a few issues) Has it been ported, or would someone be able to help me debug really quick. I think it has to do with the MOSI/MISO SDL/SLA etc stuff
The Uncanny eye code?
That usually runs on the HalloWing?
If so, scroll up a little bit. I asked PaintYourDragon who wrote the original code for the eyes and he said it would need to be ported as it was written for the Teensy and SAMD chips.
Thank you. Anyone know of any guides converting samd to rp2040
With the Pi Pico, if a pin is GPIO 10 (pin 14) how do I reference that in arduino for code? as 10 or 14?
Thank you
It seems to be hardware specific, overclocking my Teensy 3.2 got me up to 648khz by using an intervalTimer value of 0.77 microseconds
Also I took your advice and changed state = (state == HIGH) ? LOW : HIGH; with state = !state dunno why I didn't think to write it that way
I'm gonna see if a teensy 4.0 will get me closer to the 1mhz goal, or am I better off using an FPGA at this point? I'll be syncing pulses to my clock to control an old monochrome LCD and some of the signals it recieves peak at 1mhz (it's 240x 128 pixels or Quarter CGA resolution)
You'd be better off using a timer peripheral than a software loop.
Or perhaps a SPI output if you need to sync data bits with the clock. Some chips have a parallel I/O peripheral which is intended for display drivers, too.
SPI can achieve 1mhz?
Easily, yes.
There's also the RP2040's PIO peripheral, which is ridiculously flexible.
SPI on ESP32 can easily achieve 40mhz, I think 80mhz works as well
I have more than just data bits, i've also got sync pulses and this display seems to have a secondary clock at 730hz that it needs
There are several approaches: counter/timers (onboard and outboard), clever software, FPGA, using PROMs as sequencers, etc.
Sorry for late reply I was busy with classes and school stuff this weekend. What I was hoping to do was either find some app I could use or even just use a Bluetooth serial app if it came to that to change things like the patterns of the leds and the brightness while riding from my phone
@deep steeple Do you have an Android or Apple phone? I think for Apple you’ll probably be limited to Bluetooth LE if memory serves?
it's an iPhone so that is part of what was making this trickier
the adafruit Bluefruit Connect app has a BLE UART client
I’ll take a look at that thanks
I control my library's neopixels with an itsybitsy running Circuitpython and the adafruit app, which can send color data with the Controller > Color Picker, and UART
Cool thanks sounds like that would work well for what I’m trying to do
hey im trying to figure out the pinouts for my circuit playground bluefruit le. im using fast led to drive dotstars. i have the strip wired red vcc bottom right near jst connector, black gnd jst connector left side, yellow SCL A4, and green SDA A5. I cant figure out how to show this in arduino. please help. I know it's probabally on one of the pages i've already been to.
Hmm, DotStars are more like SPI than I2C: to use hardware SPI, you would use different pins than SCL and SDA (which are I2C).
Anyone know about using lvgl and the Adafruit glue library by @heady sparrow ? Trying to use the tft feather wing. Been looking at the code trying to figure out why glue is needed. The TFT_eSPI seems to support HX8357 that lvgl seems to recommend. Is glue for something else? Haven’t had success without glue, but lvgl development moves fast and is ahead of api glue is using.
Any chance there is a ZeroDMA library for arduino that works with rp2040 or something similar (or anyone who can help me port code for an SAMD that uses zeroDMA to rp2040?
So I'm trying to get a button to work in Arduino, but currently, if I put my hand anywhere near it, it activates:
Do I need to put a resistor or diode in?
Or could it just be interference with the way the wires are?
It sounds like you probably need a pulldown resistor on the button input pin, yeah.
What does that mean? What OHMS should it be?
it's to avoid a floating input. see here:
https://learn.adafruit.com/circuit-playground-digital-input/floating-inputs
depending on your board, you may have internal ones that can be enabled
just bridge a 10k resistor from logic level to a pin on the button.
unless you're wearing some super FCC-not-certified wrist watch you shouldn't be causing so much induction that you can't fix it with a resistor
So I’m trying to a mini data logger for location + gradient stuff
My issue is mpu6050 and oled 128x64
They both use i2c
So do I connect mpu to arduino nano’s i2c pins SDA & SCL and connect the same of oled or connect oled’s i2c pins to XCL & XDA pins of mpu?
you connect both the OLED and MPU6050 to SDA and SCL pins of arduino
i2c is a bus, so you can have several devices on the same bus as long as the addresses are different
^^ yep
and here's an example sketch that uses both:
https://github.com/adafruit/Adafruit_MPU6050/blob/master/examples/MPU6050_oled/MPU6050_oled.ino
^^ that's probably the code being run in the product/guide animated clip
Where do y’all learn to code?
I've learned a lot by starting with other peoples' code and adjusting it to do different things.
Oh, that’s a good idea. Thanks!
Pulling apart and playing with code is a great way to get how it works :D
I did take some classes in high school, but mostly I learned to code when I needed to code something - so I started writing code, readign a lot of language reference documentation, copying and pasting other people code, and occasional use of stackoverflow
To this day I don’t consider myself as one who knows how to write code, but I somehow managed to cobble together some scripts and embedded code to get some projects off the ground. It really isn’t something you can easily say you can or you can’t. You either start small and work your way up, or you start with something big and break it down piece by piece.
#ScriptKiddie4Life
I learn best that way - I've taken 8 Python courses, and I still learned best by dissecting others's code
Is there a simple way to alter code that uses digital inputs (pull up resistor switches) and change over to an adc with 5 buttons?
Ended up getting an LCD shield with keypad and thought "oh I'll just use these buttons" and now I'm struggling to easily swap code over lol
It depends on the code, but it's generally not too painful.
what is the purpose of a pulldown resistor for this mosfet? also, if a current delimiting resistor is necessary, why don't we use a much higher resistance?
To ensure when no signal is applied to the gate of the transistor it is pulled down to 0V
so you're saying that if pin3 becomes floating then it's by default grounded
When pins on a microcontroller are not on, they can have weird voltage fluctuation which can cause undesired outputs
gotcha okay
so about the current delimiting resistor, why don't we use higher resistance
if the goal is to minmize current draw
Well, there’s sort of a magic to the delimiting resistor choice. In BJT, the goal was often operating the transistor fully saturated
I see what you mean
Okay so in the greater scheme of things here's the circuit with the motor as well. The diode is necessary to prevent sparks and frying the mosfet and PWM source when the mosfet is switched off but the motor is still running
the motor will also be only powered to run in one direction
problem is, what if i manually spin the motor backwards?
Well, that’s why you have the diode
I can't just put another parallel diode in the opposite direction, that would bypass the motor
the diode only works in one direction
Sure
There’s no path to ground so you don’t have a voltage differential, the reverse motion might cause current to flow backwards which is just blocked by the diode.
okay so the diode would jsut heat up
i will then just use a big diode
this should do
To a certain point. But unless you hooked up another motor to spin it fast enough in reverse, it’s unlikely you’ll hit the breakdown voltage and reverse current limit
yeah
i dont think ill be moving it backwards too much or at any close speed to the motor operation
thanks alot!
As for the delimiting resistor, 100 ohm is probably chosen due to the “average voltage” when applying PWM to the pin
But i imagine a 1k resistor might be more suitable depending on the exactly mosfet you use
It’s also good to be aware that MCU usually can sink 25-50mA per GPIO pin
okay
I guess the only hard part now is finding a big mosfet and a big diode
I might try to salvage those off a computer power supply
Wait.
What if I use an AC rectifier unit instead of a diode and then use that to power something else
Would that then solve the problem of frying things AND also do something useful with the power generated?
I’m not certain. Let me see if I can find a good reference
I’m not seeing anything off hand but there might be someone here with better knowledge who can chime in
hmm ok
but yeah the problem with no diode is that the current has nowhere to flow
but if i can direct that current through an AC->DC converter, then i can use that power for charging or something
the only issue would be the converter taking energy at the same time the motor is powered since it doesnt have a diode attached
i could attach a diode honestly and just connect something in between the diode and the motor
like that
If I understand what this is doing, it's unlikely for that excess current to be consistent enough to be useful, and adding additional loads in that circuit will reduce the effectiveness of the bypass.
At most you could probably stick an LED there or something, but I wouldn't try to power anything else there unless you really know what you're doing.
yeah
forget that tbh it makes it harder to manually power the bike
whats the issue is the potential for back emf rotating the motor manually backwards
i could solve it like this maybe
👋 Has anyone worked with a Fetherwing M4/RGB matrix/Ethernet before? I was able to get example code working for both (UDP echo for Ethernet and simple test for matrix) but when I go to get both running at the same time and am seeing lots of activity on my SPI bus, causing the code to hang. Confirmed its not wiring.
- When matrix.begin() is commented out and just udp code is running, SPI bus looks fine and Ethernet works as expected.
- When Ethernet is not created, no activity on the SPI bus
- When both are active, the SPI bus is constantly sending/receiving data, causing Udp.Parsepacket() to hang. (even though there is nothing being sent to it)
The mainloop is just Udp.parsePacket();
i think i may have bricked my MKR1000.... not showing up in ports and in device manager it looks like this:
tried different usb cables, usb ports, disconnecting all cables from the arduino, reinstalling drivers...
Has anyone ported between samd21 DMA to use DMA on the RP2040?
can some one help me in understanding this lib
its for handling strings
I am making a hi5 bot which uses mqtt to get data
I am using lcd to show data, I want to show one name at a time
which is received by the esp32
given that the last update of that library was in 2011, I'd look for other solutions
ok, I am not getting what to do
any suggestions
Alternate Libraries
URGH... i really am struggling to understand why i can get the graphics test for the ST7789 to work fine on the RP2040 but i can't seem to get the TFT_eSPI library to work on the same pins. even using the pins they want..
the weird thing is... when i scope the sck pin for the TFT_ESPI library, it isn't active. no signal being sent. just.. blank..
How does a circuit breaker work when using a non standard voltage
For example, this breaks at 15 Amps but also says 120/240V. I'm only gonna be working with ~24V so idk if itll still break at 15 amps
nvm thats for AC
ill use this instead
I have a feeling I’m being stupid. But not getting anywhere fast. Anyone help me? I’m obviously not writing this pin correctly (/reading the adafruit docs badly!) https://forums.adafruit.com/viewtopic.php?f=62&t=182201
You might try just 4 instead of D4.
Thanks a million. I’ve been looking at this for months. Why does the guide not say 4 instead of d4? Is it well known that you can ignore the d letter?
Pin naming and numbering schemes across all the different boards and libraries out there is... complex. 😅
what is an analog button. what is a digital button. ;0
SPST is unambiguously a break in the continuity of a DC path.
analog by definition is at least 3 values.
digital by definition is exactly two values.
an analog keyboard would be for example a voltage divider (resistor network).
read by an ADC input pin to a microcontroller.
Basically where the code says something like if digitalRead(BUTTON1), you'd replace it with something like if ((analogRead(BUTTONS) > x) && (analogRead(BUTTONS) < y))
Each button will give a different range of values for analogRead, so for example, one button might read around 170, so if you check for between 140 and 200, it would usually match.
;)
That should be reasonable, though you'd want to be sure to set all the m variables to HIGH before that, too, to emulate the pullup in your logic.
Yep, it's in my code...
Can I get a recommendation on what kind of A4988 driver I should buy for stepper motors?
Also, is there equipment or component that helps supply variable voltage >12 V and >1A?
On the equipment end, a bench power supply will generally do that. For choosing components, it will probably depend on how you want to control the variability and what level of device you want to deal with... a chip on a custom PCB, a power-supply module, or an enclosed piece of gear, etc.
Great, Bench supply seems to be a good equipment.
Hey y'all, I was hoping for some input on this code error i'm getting
I'm trying to read from a raspberry pi sending data on 19200 baud via a USB connection, but I can't declare a new serial.begin. Is there a chance that Serial2 is reserved for a pin instead of the USB port?
Hello arduino peeps! I am working on a project and the servos I am using (modified to continuously rotate) have an awful jitter. Are there any steps I could try to take to mitigate this?
The first thing I'd probably investigate is what exactly the Arduino is sending to the servo when it's jittering. That is, is it a problem in the control code, or is it an electrical issue in the servo? Printing out the PWM values on the serial port, for instance.
my code is fairly unique, something i don't know that is really common, essentially i wanted tank steer control with a single analog control stick. i will attach it, and I have serial monitor connected so that is visible as well.
I am adding some comments that should explain my code.
here we go. Thank you for the response and your time!!
#include <SoftwareSerial.h>
#include <Cytron_PS2Shield.h>
Cytron_PS2Shield ps2(2, 3); // SoftwareSerial: Rx and Tx pin
//Cytron_PS2Shield ps2; // HardwareSerial, note:
Servo wheel_1; // Define servo objects.
Servo wheel_2;
void setup() {
// put your setup code here, to run once:
ps2.begin(9600); // This baudrate must same with the jumper setting at PS2 shield
Serial.begin(9600); // Set monitor baudrate to 9600
}
void loop() {
// put your main code here, to run repeatedly:
int x = ps2.readButton(PS2_JOYSTICK_RIGHT_Y_AXIS); // Read the values from controller.
int y = ps2.readButton(PS2_JOYSTICK_RIGHT_X_AXIS);
y = map(y, 255, 0, -128, 128); // Maps contoller min/max y-value (255) to center the endpoints at zero.
x = map(x, 0, 255, -128, 128); // Maps contoller min/max x-value (255) to center the endpoints at zero.
int left = y + x; // These operations taken from Sparkfun tutorial on contol mixing.
int right = y - x;
left = map(left, -128, 128, 1000, 2000); // Map the vars left and right to values I want
right = map(right, -128, 128, 1000, 2000); // to directly use for microseconds values to send to the servos.
wheel_1.attach(5); //Attach the servos.
wheel_2.attach(12);
int dead1 = 1500; // Stopped rotation for the servos (effectively 90degree position) should be SOMEWHERE close to 1500us.
int dead2 = 1500; // Maybe I need to adjust these values for the individual servos? Servos seem to be "seeking" for the "90 deg" position.
int deaband = 100; // Sets a faux deadband. (see directly below).
if (abs(left - dead1) < deaband) // This section is supposed to "filter" the microseconds inputs to
{ // accomodate for the fact that the stick doesn't always return exactly to zero.
left = dead1;
wheel_1.writeMicroseconds(left); //Works by seeing if the value read from the stick is within my designated deadband, and accepting/rejecting as necessary.
Serial.print("01"); // Indicates whether this section of code is being used in the serial monitor.
}
else {
wheel_1.writeMicroseconds(left);
Serial.print("02"); // Indicates whether this section of code is being used in the serial monitor.
}
if (abs(right - dead2) < deaband)
{
right=dead2;
wheel_2.writeMicroseconds(right);
Serial.print("03"); // Indicates whether this section of code is being used in the serial monitor.
}
else {
wheel_2.writeMicroseconds(right);
Serial.print("04"); // Indicates whether this section of code is being used in the serial monitor.
}
delay(30); // Gives small delay for servo to reach assigned position.
Serial.print("X: "); // Serial info.
Serial.print(x);
Serial.print(" Y: ");
Serial.print(y);
Serial.print(" | L: ");
Serial.print(left);
Serial.print(" R: ");
Serial.println(right);
delay(5);```
I'm suspicious of the attach() calls inside your loop. Normally you'd only do that once in setup, so it may be resetting the servo each time.
let me try that
also feel free to point out any thing not "best practice" i am fairly new to this
mechanical engineering student on a team tasked to build a robot and everyone else refused to do it xD
https://github.com/akupila/ArduinoContinuousServo I am considering switching to try this out? It would seem I can adjust the pulse widths fairly easily with that.
hey guys, so i have an ADS1115 and i can't seem to get it to work with my wemos d1 mini, and every time the code reaches the ads.begin() call, i believe the d1 crashes, as the serial output just becomes a ton of random garbage and it resets.
i have my wiring like so: ADS VCC to D1 5V, ADS GND to GND, ADS ADDR to ADS GND, ADS SCL to SCL, ADS SDA to D1 SDA, and A0 to my capactive soil sensor
i tried removing the soil sensor and flipping the SCL and SDA just in case that was wrong, to no change, I also tried using a different ADS board since I bought two from adafruit, and i'm not sure what's going on
I made sure I2C works by using a 0.96" oled and Garmin's LIDAR-lite-v3 on it, both working & on the same bus without a problem
i tried changing the address it uses on the ADS board as well, to no luck either. So I'm not sure entirely what the cause of the problem is or why it won't work, and I have no idea how to troubleshoot it as I don't have an oscilisscope; i'm not very well-versed with electronics, but I believe I learned that using a cap can stabilize current, should i throw on a cap somewhere in my circuit?
any suggestions? i can also hop on a video call if needed
hm, apparently both my d1 mini's 5v and 3v3 lines provide only about 3.4 volts, not sure if that changes anything or if my multimeter is correct
NVM LMAO, I think it was because the breadboard power gets cutoff in the middle and the board wasn't getting power LOL
Ok, so I got a trinky that I plan on hooking up to a powerbrick on my wall and programming a "did I take my pill today?" checker but I've had issues with stack overflows on arduino and would imagine them being an issue with millis() over long periods of time. Any tips
Do you have any recursive function calls or possibility of a memory leak? millis() itself shouldn't cause any problems.
I've heard millis loops back to zero after around 50 days and forsee this screwing with the timing of everything. I'm not sure I understand your message
Yes, that'd be a 32-bit integer overflow, though, not a stack overflow, so I probably misinterpreted what you meant. Often if you expect to be running for long periods of time like that, a real-time clock module can be a good idea to design in.
Typically people deal with tick roll-over by having some logic to say "Oh, this millis value is suddenly smaller than the last time, so I must have rolled over to 0."
The easiest way to remove the jitter with a neutral stick is to widen the dead band so it doesn’t register false inputs from ADC inaccuracy. It’s a pretty common thing that almost every analog game controller in existence applies in some way.
It looks like a continuous rotation servo, so any jitter in velocity once the servos begin to turn will be much less visible. If you were to apply this to a positional servo instead, there are other software (or hardware) filters you can apply to reduce the jitter in exchange for sensitivity, resolution, or response time.
Continuous rotation is correct, I’ll try widening the Dead band

Even with a widened deadband the servos are receiving exactly 1500us because of my code, and they still twitch
Hm I think it is my control system. I am using a serial monitor input and I am able to get the servos to truly stop, by adjusting either the input microseconds or the resistor (yes this is adjusting to variables at once, so it doesn’t really tell me anything other than both are working as expected)
I was going to ask about your hardware next lol
If you have an oscilloscope this would be easy, but most don’t….
Compared to the alternative where I am using a PS2 controller and a shield that I am reading analog values from and mapping to microseconds. (Mapping a single 0-255 input for both x and y to 1000-2000us)
Are replies not allowed in this channel(?) every time I try one it gets deleted
Oh
It’s because I called a piece of equipment a 💩
I think

I have access to oscilloscopes at school, I might try that tomorrow
Yeah, no bad words allowed, bots will eat them
Hello all, I am trying to get an esp32s2 working with Arduino 2.0 on MacOS
I can upload okay when it's in bootloader mode or whatever, but I can't see any serial output when the sketch is running
anyone run into this?
There is a small error in the BME280 library. The link (https://www.adafruit.com/product/2650) does not lead to the BME280 module, but to some kind of LED magic module ^^
If you'd like to get some LEDs or analog strips blinking for your costume, prop or project, but don't want to do any programming, you may want to try out the LED Magician! It's ...
I'm looking for an example of a web server for a Feather M0 wifi that works with a dhcp router and just read a temperature sensor and publishes it to the local web. Are there any one that work that I can try?
if everything else works fine and a using a programmer works, you very likely need to download/install additional board managers
unless your talking about a esp32s2 camera board
I don't remember what out of these has it, pulled it from my arduino IDE urls list https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json https://arduino.esp8266.com/stable/package_esp8266com_index.json https://dl.espressif.com/dl/package_esp32_index.json http://arduino.esp8266.com/stable/package_esp8266com_index.json but one will. also with esp boards you tend to have to play around as the names won't align but the spec and write values will
just go to
and click the thing I circled, paste those links in and go to tools and board manager and install the esp ones
@strange torrent
end up with something like this
could be due to the power source... but also could easily be the controller just releasing steady highly accurate inputs. I have seen other people work on projects with controllers and I know a few of them did stuff that is a bit hacky with idle state fluctuations. setting a range within center that is ignored so the stagger on inputs would't factor in
I have also seen a ton of other things cause servo jitter
good luck, I think what they pointed out is likely the case but hopefully you sort it out
Hi, thanks for the response! I got that far, I am able to flash to the board when it's in bootloader mode or whatever, but when it's in normal....non-bootloader mode, it doesn't appear in the Port menu
can you post a link to the board you bought?
how are you connecting it to your system? I am looking it over for the cost I would think it would have a bootloader already installed, but I also have seen cases where there wasn't one
if there isn't one, you would be using USBasp/isp to program it as a normal programming step
The controller board integrates an ESP32-S2 for its integrated USB Bootloader making it a very compact board with a powerful microcontroller with wifi and Bluetooth capabilities.
This board connects directly to the SPI Display Array Board in its back, it also has an RGB LED and Audio Amplifier for color and audible notifications. The hardware is more than capable to manage 6 displays at a decent frame rate and has enough memory for more than 5 different timezones and clock themes.
This controller has also take into account the possibility of an 8 display board and different display controller detection by the reading of one GPIO, Low logic state for ST7735, and High logic state for ST7789.```
essentially, you use the espm2 s2 as a spi programmer it seems
for the clock controller
its meant to make it so you have a smaller form factor
also the github documentation is great for this board. https://github.com/JosueAGtz/displayArray
@strange torrent the board seems like a solid board, but you bought a board that is meant to be used in that way
honestly it isn't a big deal, you should just expect to be using SPI to program it is all.
if you don't know how to do that, it doesn't take long to learn at all
So I have both the controller board and the display board with all the displays. I’m pretty sure the controller board is just a esp32s2 on a board with a custom connector.
I successfully programmed it using the arduino 1.8 ide using his firmware off the git page with some tweaks
The problem is I am trying to add an I2C rtc to is so it’s not relying on WiFi for retrieving the time.
you might want to read up about how microcontrollers are programmed in general as it might help to know the overall process instead of just doing things because a person mentioned it but essentially esp boards, arduino boards, etc are prototyping/development tools meant to make working with micro-controllers a lot easier. they are the controller, on a board that forwards the pins and usually have a "bootloader" on the same board along with stuff to make power safe for it etc.
one of your boards has a boot loader
the other does not it seems
so you instead use the same protocol the bootloader would use to program the other one
that sounds like a lot more than you actually have to worry about though
it is usually just this
I think we are talking past one another a bit, but I have to step away for a couple hours
Thanks for your help!
if you come back to this comment later, the link I posted below the snippet is where the text is from. in bootloader mode it is expecting you to be using the SPI block that is used for coms with your computer for just that, flipping that off will make your computer not see it a communication device on a port, it might be listed as a usb hid elsewhere though but you can't really use it the same way like that. in some cases you can use the then freed up pins for other things though. that is the trade. so you would program it and plug into the slots freed up and turn it on and test it maybe? just thought I would elaberate why I talked about it a bit.
but being in bootloader mode is the same as saying you plan on using those pins to program the controller with. after turning it off you can re start it and it will use the pins for whatever it was that you coded it to be using those pins for. you just can't use the serial monitor if you do along with other things... understanding SPI and AVR a bit is helpful
this makes a lot of sense! I didn't realize the pins for serial comms could be reallocated based on which mode it was in
I am a little confused why the creator of the script even added this then:
Serial.begin(115200);
while (!Serial);
actually he's got other code in there too printing statements to serial
That while statement waits until the serial link is up and working, which can be useful if you need to catch some output in the beginning. However, it can also work against you if you run a project with a USB serial link on battery, and the link never initializes so the code just waits forever (yes I've done this)
I guess my questions was why even initialize the serial output like that if the microcontroller wasn't configured to output to serial
That would be odd, but you said he's got other code printing to serial?
Do anybody have recommendations on how to connect stripped open wire to male pin? I am trying to connect wires without headers to pins on a wire.
Also, what are some safe practices to ensure to prevent frying our boards/drivers/components?