#help-with-arduino

1 messages · Page 98 of 1

mystic gate
#

the controller is in the upper part of the circuit the yellow one

#

esp8266

#

maybe the capacitor?

north stream
#

Try adding some shunt resistance in parallel with your LEDs to absorb the stray energy

mystic gate
#

well If I connect a 100w normal bulb the other led bulbs stop glowing

north stream
#

Yes, that would serve as shunt resistance too

mystic gate
#

ok let me search how I can put that directly into my circuit

mystic gate
north stream
#

I don't know enough about how the LEDs are connected to do so

mystic gate
#

they are conected to neutral, and the switch conect them to live they are just led bulbs

hallow remnant
#

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
hallow remnant
#

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

GitHub

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...

#

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

rough torrent
#

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)
north stream
#

It does appear that the RAM is segmented. You could look at the memory map file for it to see what the layout is.

wraith current
#

@rough torrentdoes it compile if you do two arrays, each half size ?

rough torrent
# wraith current <@!633764848924229635>does 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

wraith current
#

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 torrent
#

No idea how to do that :/

#

Don't know how helpful these images will be either:

wraith current
#

@rough torrentmaybe ask the author of the library on github.

rough torrent
#

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!

wraith current
#

@rough torrentmaybe try allocating on the heap ```
uint8_t* jpeg_data = new uint8_t[DATA_SIZE];

hallow remnant
#

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

pine bramble
#

@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).

hallow remnant
#

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

pine bramble
#

$ /bin/cat ./this > ./that

hallow remnant
#

but I think I'm close, it works in a standalone version of openocd, but that's 0.11.0

hallow remnant
#

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

pine bramble
#

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
hallow remnant
pine bramble
#

I don't know openocd at all and not really sure where you hack the IDE to pickup your alternate.

hallow remnant
#
 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

pine bramble
#

Yeah so my method should work for you.

#

Try that much and see how it goes.

hallow remnant
#

well that's basically what I did

pine bramble
#

If it's perfect, then integrate it as a separate step.

hallow remnant
#

I just cated it from my system openocd script directory where I was working on it

pine bramble
#

Realistically you can very likely just write a shell script that uses openocd on the command line.

hallow remnant
#

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

pine bramble
#

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. ;)

hallow remnant
#

yes there's scripts for most boards

#

but not M4

pine bramble
#

There aren't 1800 boards.

hallow remnant
#

so no grand central or metro M4

hallow remnant
pine bramble
#

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
alpine girder
#

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.

cedar mountain
alpine girder
alpine girder
cedar mountain
#

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.

alpine girder
#

i knew it was something simple lol, thank you

cedar mountain
#

No worries, C is not particularly friendly. That would have been a difficult issue to guess without seeing the code, heh heh.

rough torrent
pine bramble
#

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...

pine bramble
rough torrent
#

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...

chilly fractal
#

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.

flint smelt
#

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

pine bramble
#

I would comment out code until everything left is working correctly.

#

Prefeably start with an empty file, and add lines one at a time.

chilly fractal
#

i cannot believe adafruit use dependency like this in their libraries. other led libraries don't have esp32 random file as a dependency.

flint smelt
#

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

hallow remnant
hallow remnant
flint smelt
#

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
#

ohhh

#

hmmmm

#

try reinstalling the board support in the board manager

pine bramble
#

@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

hallow remnant
#

I just updated my ide, not a full reinstall

flint smelt
#

I'm not sure what it is under the hood, PIO uses Arduino core for it and I use ESP-IDF for esps lol

pine bramble
flint smelt
#

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

pine bramble
#

Every last Raspberry Pi Pico RP2040 dev environment I've seen, in some capacity, leverages pico-sdk.

#

The lines are blurred. ;)

flint smelt
#

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

pine bramble
#

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)

flint smelt
#

I think that did the trick for the compiler, but now I'm getting a python error

pine bramble
#

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

sudden herald
#

Hello, has anyone managed to upload the code remotely to boards with a samd51 microcontroller?

tough snow
sudden herald
#

@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

tough snow
sudden herald
#

I managed to follow an example with an arduino uno, but I have not been able to replicate it for samd51

flint smelt
#

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

flint smelt
#

CircuitPython UF2 works just fine but the bootloader UF2 does nothing

pine bramble
#

do all arduino have the same resolution and accuracy when they measure voltage ?

leaden walrus
#

yes/no. different hardware will have different ADC resolutions. but the arduino API standardizes the return value for analogRead()

pine bramble
#

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

leaden walrus
#

@flint smelt just ran your sketch on a CLUE:

flint smelt
#

@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?

leaden walrus
#
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

pine bramble
#

great I have to buy another f* board<

pine bramble
#

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?!

green thunder
#

Keep them around! You may think of another project for them in the future.

wraith current
#

@pine brambledef keep them.

hallow remnant
chilly fractal
#

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.
cedar mountain
chilly fractal
#

i thought it does. i follow video and web tutorial for it.

cedar mountain
#

Maybe there's a different version out there which does.

native kelp
#

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?

heavy star
#

Sure, as long as the devices are on different I2C addresses, you can connect many

native kelp
#

i assume there's no easy way of ddeetermining if they're on different I2C addresses without having the two different components first

heavy star
#

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

native kelp
#

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

heavy star
#

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

cedar mountain
#

And in a pinch there are also I2C multiplexers available which let you switch between devices with the same address.

livid osprey
livid osprey
#

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...

native kelp
#

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

stable forge
native kelp
#

o i see, thanks

livid osprey
#

I should rephrase that as SPI can also share devices with other SPI devices like I2C does with I2C...

oak linden
#

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;
    }
  }
north stream
#

You probably want to set tagTimeNow on the initial scan

torpid bobcat
#

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!

elder hare
#

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

marsh rock
#

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?

calm crypt
# marsh rock Hey, whats a good way to read serial data thats coming in too fast for an arduin...

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

pine bramble
#

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

livid osprey
#

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.

pine bramble
#

A polling rate of 100 times per second of 20-30 buttons/switches seems reasonable

#

I think I wouldn't even be at 1000hz

livid osprey
#

Metro M4 is 120MHz, actually.

#

That could work.

pine bramble
#

I'm confused as to what constitutes arduino for this channel, arduino chip or using the arduino IDE ?

livid osprey
#

Either, frankly. Usually the hardware questions are less common, though.

pine bramble
#

I don't know if grand central m4 or teensy 4.1 count as arduino for the purposes of this channel

livid osprey
#

I don't know what you mean by encoding in voltage, but Arduino does have pins available for I2C.

heavy star
#

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

pine bramble
#

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

livid osprey
#

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...

heavy star
#

Why not just use an LED driver?

pine bramble
#

how can I use something if I don't even know how it works/how to do it myself ?

heavy star
#

Just gotta learn. Plenty of guides and people to help

pine bramble
#

I mean it's kinda the same with membranes keyboard, lots of tutorial but none explain exactly how they work

livid osprey
#

There are datasheets, guides, and all the resources here to reference.

heavy star
#

They're far more simple than what you propose anyway

pine bramble
#

so if I made a membrane keyboard I'd have no idea how to do it

livid osprey
#

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

heavy star
#

Pretty sure I've seen guides... But membrane keyboards are just a matrix of columns and rows

#

NeoPixels are super simple

livid osprey
#

Membrane keyboards are very simple to understand, but the process of making one is a bit more involved.

pine bramble
#

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

livid osprey
#

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.

heavy star
#

The code for NeoPixels is pretty simple, well documented, and you can always ask questions

pine bramble
#

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

livid osprey
#

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

pine bramble
#

ie: if I want to turn something to PCB they will jkust include the membrane keyboard in it and glue it in ?

livid osprey
#

Neopixels are well-documented enough to understand in a couple minutes

pine bramble
#

Or they will need me to provide an actual circuit for the membrane keyboard they can PCB ?

livid osprey
#

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?

heavy star
#

If you want a membrane keyboard on a PCB, you need to implement that in your design yourself

pine bramble
#

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

livid osprey
#

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.

livid osprey
#

If you're seriously contemplating a PCB design, #help-with-hw-design is a great place for detailed questions too.

pine bramble
#

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

livid osprey
#

Are you trying to design a standalone PCB or an Arduino shield?

pine bramble
#

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

livid osprey
#

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?

pine bramble
#

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

livid osprey
#

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.

pine bramble
#

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

livid osprey
#

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.

pine bramble
#

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

livid osprey
#

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.

pine bramble
#

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

livid osprey
#

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

pine bramble
#

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

heavy star
#

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

livid osprey
#

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...

heavy star
#

You can get like an Arduino Pro Micro

#

Mini? Whichever one it was

#

5V version

livid osprey
#

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?

pine bramble
#

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 😦

pine bramble
#

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

livid osprey
#

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

solemn cliff
#

the pro trinket ?

pine bramble
#

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

livid osprey
#

Yeah, that'd probably be the one, whenever it's back in stock.

solemn cliff
#

ah, might be a long time though

livid osprey
heavy star
#

Cheap good

livid osprey
#

I2C, so you could use the smallest mcu adafruit has to offer hehe

pine bramble
#

digikey doesn't seem to sell it in canada though

#

nvm

livid osprey
#

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

pine bramble
#

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 ?

livid osprey
#

No, it's used to connect the SHT40 to the Trinket via Stemma QT.

pine bramble
#

I have a soldering course tomorrow so mayhbe that will open new options for me...

livid osprey
#

aka I2C with an actual connector

#

So no soldering in this solution.

pine bramble
#

Assuming the course doesn't need 2 fire departments to show up becauise of me like last time

livid osprey
#

The Trinket has usb, the SHT40 does not.

pine bramble
#

Is that the trinket you mean ?

livid osprey
#

ffs i was looking at qtpy

pine bramble
#

it seems I have to solder on the headers and usb myself and do additional things for ?1, ?2, ?3 and ?4

livid osprey
#

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

heavy star
#

Yeah, headers are just for breadboard or socket use, you can wire directly to the board

pine bramble
#

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)

north stream
# elder hare anyone?

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.

livid osprey
#

I do not think that one is on you LOL

pine bramble
#

Well I mean I used what the adults told me to use when I used that solder iron under "supervision"

livid osprey
#

My point exactly. 😉

pine bramble
#

Only thing that sucks tomorrow is you have to stay and wash all the stuff with bleach and alcohol

#

I wish I knew ahead

heavy star
#

Sounds like some dumbdumbs were teaching you

pine bramble
#

I wouldn't go normally but I have to if I want to have access to CNC/large 3d printing/PCB etc at cost

#

Not sure it's a good idea to clean a soldering iron with alcohol after use 😄

pine bramble
#

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

livid osprey
#

If it says AMS1117 you should be okay up to 15V

pine bramble
#

I mean with all the cheap sellers I only trust a datasheet or schematic and I google translate the CN version to be sujre...

pine bramble
#

thanks @pine bramble and @livid osprey

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.

pine bramble
#

and a fire extinguisher for electronics nearby 🤣

pine bramble
#

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"

strong jewel
#

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.

woeful drift
#

Besides that I'd go with your guesses lol

dry orchid
#

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

heavy star
stable forge
pine bramble
# strong jewel This is a pretty specific electronics question, I have a sensor that outputs +/-...

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

pine bramble
#

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

#

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.

north stream
#

Basically the motor controls something that in turn controls the motors.

pine bramble
#
#

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?

north stream
#

You say when using the Wire library, I2C works fine: which pins is it working fine with?

pine bramble
trail swallow
#

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.

trail swallow
#

I stand corrected - it appears related to the... orientation in which I hold the strain gauge?

#

Currently suspecting poor wiring

strong jewel
# pine bramble Let me rephrase what I understood. I do knot know what is an "lmk" analog signal...

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?

trail swallow
#

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.

north stream
#

Could be: load cells are used in a bridge configuration with narrowband high gain amplifiers and an excitation voltage: fairly specialized circuitry.

ornate hamlet
#

Hi can i power an arduino nano rp2040 connect with 4AA batteries.

#

Arduino website says VIN of 5-21V

north stream
#

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.

pine bramble
slate pendant
heavy star
#

Can't RP2040 boards run on 3.3V?

gilded swift
#

3.3V is highly recommended

heavy star
#

Guess that board has power regulation for higher voltages

pine bramble
#

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)

heavy star
#

That sounds sketchy...

rough torrent
heavy star
#

Do you have hidden files visible? ~ files are hidden

rough torrent
heavy star
#

Hmmm

rough torrent
#

Oh wait do I have to extract the ZIP first 🤦‍♂️

heavy star
#

lol

#

Yeag

rough torrent
#

Still don't see any after extracting lol

heavy star
#

NetherKitteh dun got hax'd

prime nacelle
#

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

trail swallow
north stream
#

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

mortal ridge
#

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.

livid osprey
#

@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.

coarse furnace
#

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

elder hare
#

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?

Someone has shown me a way to control RGBW NeoPixels (SK6812 chipset) using the FastLED library and a small additional header file.

pine bramble
#

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

sour tide
#

take a look at capacitive touch detection

mortal ridge
#

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?

trail swallow
elder hare
#

i want to drive SK6812 RGBW Strips with FastLED

trail swallow
#

Did you write LEDPattern.h?

elder hare
#

yea

#

it's weird tho

in here https://github.com/FastLED/FastLED/blob/5cc17b2be88982eb34b1998de22b83fee56d4f07/examples/Blink/Blink.ino#L34

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

GitHub

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 &quot...

trail swallow
#

Weird in what way?

livid osprey
# mortal ridge Another question for the Shield V2. I am wondering about the RPMs of the motor. ...

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.

elder hare
#

this happens :S

north stream
proven mauve
#

@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!

#

lol, discord apparently doesn't like imgur links, it butchers everything pretty bad when you use them

unborn frost
#

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

north stream
#

It could be a hardware issue, or a weird software problem, or a weird combination like a power glitch

trail swallow
#

@unborn frost Can you post your code, and pictures of your soldering work? I wonder if any solder connections could be problematic.

unborn frost
#

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

small pumice
#

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
#

Analog Sensor

#

@small pumice What is the symptom you're experiencing?

small pumice
#

@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.

strong jewel
#

ssid is empty when it prints?

#

where is FiveSci_SSID declared?

broken viper
#

From Sparkfun

#

Best thing I ever purchased from Sparkfun

small pumice
#

@strong jewel in the AP_Secrets.h. Not included, but the values are coming through into the case statement.

broken viper
strong jewel
broken viper
#

$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

strong jewel
# small pumice <@!127621962598973441> in the AP_Secrets.h. Not included, but the values are c...

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

small pumice
#

@strong jewel Will do! Thanks

strong jewel
#

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

small pumice
#

@strong jewel I tried that, but I get a mismatch with the actual lenght of the SSID and pass.

leaden ruin
#

I think ssid and pass should both be char*.

#

Declared before, assigned within the switch.

small pumice
#

@leaden ruin Not sure what you mean by char* It appears the * is pointer, but char* isn't in the reference

north stream
#

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.

raw laurel
#

does anyone know how i'd check if this LED backpack is on or off?

#

it's one of these dudes:

trail swallow
#

Is your code not what'd be turning it on or off?

#

You could track that.

raw laurel
#

i could but i'd rather query the device itself - but if that's the way to do it, i'll stick with that!

coral laurel
#

Anyone here get TinyUSB mass storage working with LittleFS?

north stream
raw laurel
#

oh neat, im new to this so i didnt know to look for that - thanks!

carmine perch
#

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

torpid bobcat
#

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 🙂

mortal ridge
#

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?

livid osprey
torpid bobcat
livid osprey
carmine perch
# livid osprey 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.

north stream
#

You do get WiFi connected?

carmine perch
#

Only when powered by USB directly on the Nano

north stream
#

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.

carmine perch
#

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?

knotty rover
#

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);

leaden walrus
#

are you sure it's line 11? put another serial print in before the while loop.

knotty rover
#

when I comment out line 11 it spams stuff

leaden walrus
#

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?

north stream
trail swallow
#

If you have a neopixel you can do color blink codes too

broken viper
trail swallow
#

Motherboards will often do things like patterns of long and short blinks or beeps for error codes - that can be helpful

stuck coral
knotty rover
#

@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

stuck coral
#

Oh I see which board

leaden walrus
#

if pull ups were missing, wouldn't expect either board to work

stuck coral
#

Its trying to follow the i2c spec in a dirty OSless and agnostic way

leaden walrus
#

"work" = i2c works

stuck coral
#

Dont most avr arduinos have the pull up?

#

And dont trinkets lack it

#

I could verify but cooking

leaden walrus
#

@knotty rover what's the module?

stuck coral
#

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

knotty rover
#

@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

vapid warren
high seal
#

What pin should I be using as the chip select for an itsy bitsy 32u4 ?

cedar mountain
#

Generally any GPIO is suitable. You just tell the SPI driver which one to use.

cedar mountain
# high seal 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.

leaden walrus
#

@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?

high seal
knotty rover
#

@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

leaden walrus
#

@knotty rover what about with something connected?

knotty rover
#

with the previous device, it locks up, I'm going to wiring up another device i have soon to test

leaden walrus
#

interesting. yah. try something else if you can.

#

see if lock up is specific to that device, or specific to leo/trinket.

knotty rover
#

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

leaden walrus
#

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

knotty rover
#

scans fine on leonardo

leaden walrus
#

does the trinket lockup scanning any i2c device. or just the specific one you are currently testing?

knotty rover
#

another device didn't work on the trinket, I tried an apds-9960 on it too

leaden walrus
knotty rover
#

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"

leaden walrus
#

just tried it here and it's working ok

knotty rover
#

thanks, i appreciate it. . . now i'm just confused

leaden walrus
#

is there anything unique with your setup?

#

or are you pretty much just wiring like above?

knotty rover
#

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

leaden walrus
#

above is with 3v also, not usb

#

trinket 3v to Vin
trinket GND to GND
trinket 0 to SDA
trinket 2 to SCL

knotty rover
#

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

leaden walrus
#

can you post a photo of your setup?

knotty rover
#

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

small pumice
#

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,3
6F
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,3
6F

#

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?

cedar mountain
small pumice
#

OK, thanks.

jovial stump
#

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?

cedar mountain
proper forum
#
#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!

potent meteor
#

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

proper forum
#

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

cedar mountain
#

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.

proper forum
cedar mountain
#

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.

small pumice
#

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,38400
27"); //set baud rate to 38400
// GPS.sendCommand("$PMTK251,1920022"); //set baud rate to 19200
// GPS.sendCommand("$PMTK251,9600
17"); //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.

tough snow
small pumice
#

@tough snow Cookie for you!!!

tough snow
#

Fix it?

small pumice
#

Yes, thank you!

proper forum
proper forum
#

I just put yield(); in the loop function

north stream
#

Nice!

strange meadow
#

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.

leaden walrus
#

start by getting the scan to work as expected

#

you say you have the addresses, where did you get them?

cedar mountain
#

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.

strange meadow
leaden walrus
#

and they're all different?

strange meadow
#

yes

leaden walrus
#

do you know if pullups have been taken care of?

strange meadow
#

i dont

#

do you need that if they have their own separate 5v / ground pins?

leaden walrus
#

do you have links to the sensors being used?

strange meadow
#

if i can get two working i should be able to figure out the others

leaden walrus
#

the adafruit bno055 breakout has the needed pullups

strange meadow
#

i can get the signal scanner to register the oled but not the bno055

leaden walrus
#

have you tried scanning with each device attached separately?

strange meadow
#

ill do that right now.... yeah it wont show up

leaden walrus
#

"it" = ? which one?

strange meadow
#

the bno055

#

when it's plugged in by itself the serial monitor stops wororking and says 'failed to connect'

leaden walrus
#

what does an i2c scan show?

strange meadow
#

when the bno050 is the only thing connected to the i2c ports it's frozen

leaden walrus
#

weird. double check wiring/soldering, etc.

#

should show up ok

strange meadow
#

when nothing is plugged i get
Scanning... I2C device found at address 0x60 ! done

leaden walrus
#

maybe something built in to the mkr1000?

strange meadow
#

when the bno055 is plugged i get
Scanning...

#

it might be my soldering

leaden walrus
#

looks like the mkr1000 includes pullups

strange meadow
#

do i have to do anything in that case?

leaden walrus
#

no

strange meadow
#

ok

#

im gonna see if i can clean up these joints

strange meadow
#

yeah it was my joints

leaden walrus
#

cool. good job figuring it out.

tough cove
#

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.

elder hare
#

hmmm weird why FastLED lib has "SK6812" LED Strip type but it does not support it :S

unborn frost
#

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?

atomic lava
#

What is it supposed to be, and what are we seeing

unborn frost
#

its a photoresistor, it should give a value based on the light no? all im doing is printing the analogread of the A5 pin

cedar mountain
#

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.

unborn frost
#

it goes on like that forever

atomic lava
#

The graph doesn't really have a scale which is what I was confused by

unborn frost
#

Ok well I just tried it with a diff arduino and it works fine there. so it seems it was just a board issue

thorny osprey
#

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.)

elder hare
mighty kraken
#

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?

north stream
#

I think interrupts are blocked while servicing interrupts, but I don't remember if they're latched.

pseudo abyss
#

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

wraith current
#

@pseudo abyss how are you creating the square waves?

pseudo abyss
#

oh i did

tone(pin, frequency);
delayMicroseconds(1000);
noTone(pin);
delayMicroseconds(1000);```
wraith current
#

tone uses a timer so I don't know if you can easily to do two tones on different pins

pseudo abyss
#

ohhh

#

ok

pine bramble
#

..

#

can somebody suggest me an algorithm for my line following robot to follow this path

#

it has 6 IR sensors at the front

leaden walrus
#

turn if angle below thresh, with priority on right turn vs. left turn.

#

although right turn on last pentagon seems like an outlier case

swift flare
#

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 )?

trail swallow
proper forum
wet crystal
#

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?

elder hare
#

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

quick hornet
#

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.

elder hare
#

@quick hornet i dunno, can WebSocketsServer write the image directly to sd-card?

quick hornet
pine bramble
quick hornet
#

@wet crystal Could you use a PROM?

#

That way it can't be erased

wet crystal
#

I'm not talking about the sketch

quick hornet
#

Oh, you want to use the internal ROM

wet crystal
#

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

quick hornet
#

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.

wet crystal
#

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.

quick hornet
#

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?

wet crystal
#

Keyboard emulating nfc reader

quick hornet
#

Is the 32u4 running code that looks like this EEPROM.write()...? Or something similar

wet crystal
#

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

quick hornet
#

What data does the tag have?

wet crystal
#

The uid

quick hornet
#

Ok, so you scan the tag and the 32u4 will "type" the password on a computer?

wet crystal
#

👍

quick hornet
#

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.

wet crystal
#

That's overkill

quick hornet
#

Well you want to protect someone from accessing an internal EEPROM

wet crystal
#

There are also safe EEPROM which doesn't require battery

quick hornet
#

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

wet crystal
#

Not sure if you can extract the EEPROM from a 32u4

quick hornet
#

Then why worry?

wet crystal
#

If my assumption was wrong, you could upload just a sketch to the flash that spits out the EEPROM contents

quick hornet
#

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.

wet crystal
#

Usually you can select that, on esp8266 at least I know for sure

#

Could you please scroll up and read my question again carefully

quick hornet
#

I'm have to go to class, I hope you figure it out.

wet crystal
#

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?

pine bramble
leaden walrus
#

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.

golden dune
#

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

north stream
#

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.

astral mantle
#

hi, anyone have using STPM33 for measuriing power ?
I can't understand how to acces that and i hope get some help.

thankyou

elder hare
#

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.
runic gazelle
trail swallow
elder hare
#

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();
    }
};
deep steeple
#

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

trail swallow
#

What about them makes them not work for you?

#

@deep steeple

deep steeple
trail swallow
#

Ah, so it has to be Bluetooth only?

#

Interesting

trail swallow
#

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?

small pumice
#

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

trail swallow
#

@small pumice What happens after that? It looks like your message got cut off. Could you post your code as well?

small pumice
#

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.

kindred kindle
#

I have the Ardiuno Super UNO R3 project….. what display will pair well??

small pumice
#

Disregard messages above regarding serving files, found a typo DOH!

trail swallow
trail swallow
small pumice
#

@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.

worthy sky
#

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.

worthy sky
#

hopefully I've mostly got that right and i roughly know what i'm doing

torpid bobcat
#

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!
torpid bobcat
#

And magically it just uploaded code?????

gilded swift
#

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

gilded swift
#

Okay, So i have an issue..

#

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.

gilded swift
#

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 :/

gilded swift
#

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

final wave
#

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

rough torrent
#

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.

river osprey
#

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

gilded swift
#

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.

river osprey
#

Thank you. Anyone know of any guides converting samd to rp2040

river osprey
#

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?

gilded swift
#

10

#

It’s based on the GPIO #

river osprey
#

Thank you

final wave
#

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)

cedar mountain
#

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.

final wave
#

SPI can achieve 1mhz?

cedar mountain
#

Easily, yes.

#

There's also the RP2040's PIO peripheral, which is ridiculously flexible.

final wave
#

PIO sounds promising, I'll check it out

#

Thanks for the pointer Edkeyes

rough torrent
#

SPI on ESP32 can easily achieve 40mhz, I think 80mhz works as well

final wave
#

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

north stream
#

There are several approaches: counter/timers (onboard and outboard), clever software, FPGA, using PROMs as sequencers, etc.

deep steeple
trail swallow
#

@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?

deep steeple
#

it's an iPhone so that is part of what was making this trickier

solemn cliff
deep steeple
solemn cliff
#

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

deep steeple
#

Cool thanks sounds like that would work well for what I’m trying to do

granite pivot
#

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.

north stream
#

Hmm, DotStars are more like SPI than I2C: to use hardware SPI, you would use different pins than SCL and SDA (which are I2C).

livid holly
#

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.

river osprey
#

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?

pine bramble
#

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?

cedar mountain
pine bramble
leaden walrus
#

depending on your board, you may have internal ones that can be enabled

narrow flax
#

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

rancid jewel
#

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?

vivid rock
#

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

leaden walrus
#

^^ yep

#

^^ that's probably the code being run in the product/guide animated clip

uncut aurora
#

Where do y’all learn to code?

north stream
#

I've learned a lot by starting with other peoples' code and adjusting it to do different things.

uncut aurora
#

Oh, that’s a good idea. Thanks!

heavy star
#

Pulling apart and playing with code is a great way to get how it works :D

vivid rock
#

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

livid osprey
#

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.

heavy star
#

#ScriptKiddie4Life

broken viper
wise scarab
#

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

north stream
#

It depends on the code, but it's generally not too painful.

buoyant dagger
#

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?

gilded swift
buoyant dagger
#

so you're saying that if pin3 becomes floating then it's by default grounded

gilded swift
#

When pins on a microcontroller are not on, they can have weird voltage fluctuation which can cause undesired outputs

buoyant dagger
#

gotcha okay

#

so about the current delimiting resistor, why don't we use higher resistance

#

if the goal is to minmize current draw

gilded swift
#

Well, there’s sort of a magic to the delimiting resistor choice. In BJT, the goal was often operating the transistor fully saturated

buoyant dagger
#

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?

gilded swift
#

Well, that’s why you have the diode

buoyant dagger
#

I can't just put another parallel diode in the opposite direction, that would bypass the motor

#

the diode only works in one direction

gilded swift
#

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.

buoyant dagger
#

okay so the diode would jsut heat up

#

i will then just use a big diode

#

this should do

gilded swift
#

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

buoyant dagger
#

yeah

#

i dont think ill be moving it backwards too much or at any close speed to the motor operation

#

thanks alot!

gilded swift
#

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

buoyant dagger
#

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?

gilded swift
#

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

buoyant dagger
#

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

livid osprey
#

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.

buoyant dagger
#

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

wicked crypt
#

👋 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();

strange meadow
#

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...

gilded swift
#

Has anyone ported between samd21 DMA to use DMA on the RP2040?

worldly berry
#

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

vivid rock
worldly berry
#

any suggestions

broken viper
#

Alternate Libraries

gilded swift
#

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..

gilded swift
#

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..

buoyant dagger
#

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

ebon zephyr
cedar mountain
ebon zephyr
cedar mountain
#

Pin naming and numbering schemes across all the different boards and libraries out there is... complex. 😅

pine bramble
#

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.

north stream
#

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.

pine bramble
#

;)

cedar mountain
#

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.

wise scarab
#

Yep, it's in my code...

waxen hawk
#

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?

cedar mountain
waxen hawk
blissful crypt
#

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?

chrome geyser
#

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?

cedar mountain
chrome geyser
chrome geyser
# cedar mountain The first thing I'd probably investigate is what exactly the Arduino is sending ...

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);```
cedar mountain
#

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.

chrome geyser
#

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

chrome geyser
pine halo
#

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

pine halo
#

NVM LMAO, I think it was because the breadboard power gets cutoff in the middle and the board wasn't getting power LOL

pine bramble
#

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

cedar mountain
pine bramble
#

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

cedar mountain
#

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."

livid osprey
#

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.

chrome geyser
#

Even with a widened deadband the servos are receiving exactly 1500us because of my code, and they still twitch

chrome geyser
#

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)

livid osprey
#

I was going to ask about your hardware next lol

#

If you have an oscilloscope this would be easy, but most don’t….

chrome geyser
#

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

heavy star
strange torrent
#

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?

exotic arch
#

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 ^^

true spear
#

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?

glad birch
#

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

glad birch
#

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

strange torrent
# glad birch end up with something like this

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

glad birch
strange torrent
glad birch
#

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

#

@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

strange torrent
#

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.

glad birch
# strange torrent So I have both the controller board and the display board with all the displays....

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

strange torrent
#

I think we are talking past one another a bit, but I have to step away for a couple hours

glad birch
#

okay, well have a good night

#

and good luck

strange torrent
#

Thanks for your help!

glad birch
#

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

strange torrent
#

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

north stream
#

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)

strange torrent
#

I guess my questions was why even initialize the serial output like that if the microcontroller wasn't configured to output to serial

north stream
#

That would be odd, but you said he's got other code printing to serial?

strange torrent
waxen hawk
#

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?

pine bramble
#

@waxen hawk Being bone lazy and averse to soldering I use press fits.

#

Perfboard stabilized wiring jobs.

#

target staked to perfboard - extra long M-M header pins using wedging (non-parallel rows of 0.1" spaced perfboard and target