#help-with-arduino

1 messages · Page 9 of 1

dry quiver
#

I've seen a few projects involving 2 servos and 4 AAs that go the same way. Definitely some power issue with the jittering and that's fair since their voltage can get unstable for all sorts of reasons.

median current
livid osprey
#

Does it need to be portable?

median current
livid osprey
median current
dry quiver
#

Like Hem suggested, all you need is a 5V source since that's what the 4AAs are supplying, more or less.

#

USB power banks, a wall plug, anything as long as it's wired correctly.

livid osprey
#

If you need batteries, you may need an RC car battery with a step down converter that has a respectable current max. I usually estimate 300-500mA per microservo, so 7 microservos would want somewhere in the range of 2.0-3.5A?

#

Connectors may need some attention though.

median current
#

I will try to get some of those then, and hope it works, thanks for the help @livid osprey and @dry quiver

leaden walrus
green thunder
grim flint
#

Anyone know what the best way for me to get good connections on the ItsyBitsy RP2040 would be without having to solder anything yet? I want to test it out before soldering anything to it.

grim flint
#

Nevermind I decided to just go ahead and solder. My first time ever though. Any suggestions, anyone?

serene dune
#

Hi, hope this is the right place to ask this question... So I recently bought a cheap EBYTE GPS module from AliExpress, I've hooked it up to my ESP32 via 5v plus UART and written a code with TinyGPS++ in Arduino IDE. The code works fine after the initial upload and doesn't take long for me to receive coords from satellite however if I power off the ESP32 the next time I turn it on and it fails to receive any satellite signals (except for literally ONE other time but the signal dropped out fast). I assume it is cold starting each time the GPS gets power so I'm wondering if there's any way to stop it from doing this? Only other thing I could think is the issue is that the GPS needs a stable 5v but I tried powering the module using a separate power supply and still had no signal...

#

Any help would be much appreciated! Happy to send through the code or any other info if needed too

north stream
north stream
serene dune
north stream
#

Technically that would be a warm start, not a hot start, but would save some time if the ephemera are up to date.

grim flint
#

But thank you!

north stream
#

We've all been there

gilded swift
#

And the soldering iron laying on carpet lol

lusty cedar
#

Hey I am using a circuit playground blue fruit and i have followed the steps on website but I can't seem to be able to run the examples given for tenserflow lite

lavish jacinth
#

What is this screen trying to tell me? Feather reverse tft, after uploading an Arduino sketch (doesn't seem to matter much what sketch). There is an existing FTHRS2BOOT folder

livid osprey
edgy ibex
#

I'm doing arduino-cli setup on my system, and I'm to the stage of installing the cores for all the boards I use. I need to add the board manager url from the Feather RP2040 learn section to my config.yaml file.
However the syntax has me a bit puzzled. By the default, it's:

board_manager:
  additional_urls: []

but in the arduino-cli getting started page on github, it shows:

board_manager:
  additional_urls:
    - https://url....
    - https://other-url...

which seems a far jump from the empty []. Is this correct, note that I have absolutely no experience with yaml, this is my first encounter of it.

north stream
lavish jacinth
#

How best to report "fixes needed" to learn guides? Specifically to learn guides for feather s2 reverse tft. PR somewhere, or other way?

stable forge
lavish jacinth
#

@stable forge thanks dan ! never noticed that. will do it now

native dagger
gilded swift
native dagger
#

ahhh

#

duh

#

thanks

gilded swift
#

Np 🙂

#

I easily miss stuff like that as well lol

edgy ibex
#

Just out of curiosity, is there any interest in the setup I have for editing and building Arduino sketches with Visual Studio (not VS Code)? It does not require any addons, it just uses native capabilities built into Visual Studio.
If so, is there somewhere on Adafruit's web page I can post a blog that has a quick description of how to do it?

native dagger
#

weak on my arduino skills. I'm trying to verify some code and I'm getting "14 Unavailable: No connection established"

native dagger
#

Did the old fashioned "Restart the program" and that fixed it

#

Now I can't get the board (esp32-s2 qtpy) to show in arduino ide? If I press the boot and reset buttons in the right order it does, and it seems to load code, but then when I upload the sketch I get that the board can't be taken out of download mode and I should reset manually

naive prawn
#

Hello,

I am trying to follow this example from Adafruit:
https://learn.adafruit.com/1-8-tft-display/displaying-bitmaps
I am using a 1.8: TFT 180 x 128 with an Arduino Uno Wifi
No matter what I do I cannot get the image from the SD card to appear on the screen. Instead I just get a blank white screen. I know I have it wired right because I can get this example code to work from the Breakout Wiring and Test Section:
https://learn.adafruit.com/1-8-tft-display/breakout-wiring-and-test
I think it is something to do with the code. I edited it down, but still no luck.
I only want the parrot image to appear. I do have the other images added to the SD card as well though!
Can anyone help me with what I might be missing? I am really new to all of this and am trying to understand the coding.

Adafruit Learning System

128x160 pixels in 18 bit color with a microSD

Adafruit Learning System

128x160 pixels in 18 bit color with a microSD

north stream
#

Your best bet is probably to start with something simpler than an image, like a line or text. Also look at the serial monitor and see if you're getting any messages when trying to initialize the screen.

twilit hare
#

Hey - I'm about to place an order at Mouser, and I typically toss in a few Adafruit items to play around with (gotta make the most of the shipping fee). Anything cool that people have been playing with lately? I'm thinking about grabbing an ESP32-C3 (even though I have no real use case for it right now)

cedar mountain
#

And if you don't have one, I often suggest people pick up one of those clone 8-channel USB logic analyzers. The usefulness per dollar is through the roof for troubleshooting various signals.

twilit hare
twilit hare
mighty granite
#

hello

#

How can I connect ov2640 to arduino uno for capture an image?

north stream
#

What do you want to do with the image? An Uno doesn't have enough RAM to deal with the whole image at once, so basically you're limited to handing it off to something (display, SD card, etc.) a piece at a time.

radiant bobcat
#

Im attempting to run neopixels on the rp2040 scorpio along with a 433mhz reciever and remote using the rc-switch library. Running standalone the reciever and remote work absolutely fine. But it appears that when neopixel.show() is called the range is reduced to just a few inches for some reason. I don't have an explanation as NeoPXL8 is supposed to allow interrupts to work as normal which rc-switch relies on. I have already tried separating control of the neopixels and recieving information from the reciever on to separate cores but that didn't fix anything. Also, the serial library doesn't work when neopixel.show() is called. My issue is that at some point I want to remotely control animations but calling show() constantly trashes my range as stated earlier.

#

(for clarification show() is only a problem when called repeatedly, if its called once and I wait until i get input from the remote before calling it again everything works fine including serial)

mighty granite
#

I Google it, but I didn't find something to work

blazing lodge
#

I'm working with a Seeed XIAO nRF52840 board and I have to put it into bootloader mode to upload a new sketch to it. Once I upload the sketch, it disconnects from the computer and I have to put it into bootloader mode again for it to show up. Is this normal behavior? Is there a way to fix it? Could it perhaps be an issue with the CURRENT.UF2 file and it needs updating? Any help or tips would be greatly appreciated! Double pressing that tiny button over and over is maddening lol

karmic cape
#

So I turned on my little setup that has an SD card module and it fails to load. I plugged it into my PC to see if it could be read and I was greeted with this.

#

How are there 3 files that have the same name?

cedar mountain
lethal yarrow
karmic cape
#

I reformatted the SD card

#

Can't find the mysterious files

#

But the SD card is still failing to initialize

#

I've triple checked my wiring too

lethal yarrow
#

Could be a failed card.

broken violet
#

Using a MiniTFT Wing with an RP2040 Feather - The Adafruit_miniTFTWing library doesn't appear to provide a way to force the Seesaw driver to use Wire1 as the I2C bus, so I have to manually hack the default value of _i2cbus in the seesaw library in order for it to connect. Am I missing something?

karmic cape
#

I do have a failed 128GB which failed after less than a day that I can't even format on Windows

safe shell
#

Seesaw is on default I2C (SDA, SCL), there shouldn't be a change needed to the library

broken violet
#

Hmm... RP2040 feather has two I2C ports - Wire and Wire1. Seesaw initializer defaults to Wire.

safe shell
#

the TFT-joystick wing Seesaw uses the SCL and SDA pins as silkscreened on the 2040 feather, that should be Wire

broken violet
#

So why does my miniTFTwing show up only on Wire1?

safe shell
#

the RP2040 designations on various pins of SCL0, SDA0, SCL1, SDA1 help indicate which two pairs could be used as two I2C busses if you wanted to use more arbitrary pins for the two I2C busses - but standard is GPIO2 and GPIO3, the silkscreened pins

#

hmm, RP2040 Feather stacked or doubled with the miniTFT FeatherWing... the 'wing pinouts page says Seesaw uses standard I2C pins

broken violet
#

Stacked using the usual thin-pin header/sockets that Adafruit sells.

#

Using latest version of the RP2040 board files and Seesaw lib

safe shell
#

that seems odd, I wonder if there's a bug in the board file?

#

only 6 signal pins connect through to the wing, and they all correspond to RP2040 Feather SCL1/SDA1 (in RP2040-speak) except for DC (unless the jumpers on the 'wing have been changed)

broken violet
#

I haven't modded any of the jumpers.

#

FWIW when I plug stuff into the Stemma/QT jack that also shows up on Wire1

safe shell
#

(checking the .zip file to try to make sense of it)

#

yeah, the Stemma QT connector uses the same pins, SCL and SDA

broken violet
#

Yes - that's the URL I'm using

safe shell
#
#define PIN_WIRE0_SDA  (24u)
#define PIN_WIRE0_SCL  (25u)
#define PIN_WIRE1_SDA  (2u)
#define PIN_WIRE1_SCL  (3u)
```24&25 not connected through to the wing
broken violet
#

Currently at V3.2.0

safe shell
#

there's a lot in that board package and I don't know much about it, hopefully someone else can shed some light

#

it looks like GPIO2 and 3 are Wire 1 as you've seen, but that seems backwards from the usual

broken violet
#

Yeah. Makes things a bit difficult. 🙂

safe shell
#

if I had to guess, I'd say those were defined using the RP2040 parlance of the two I2C busses, and are not correct for the traditional use of the Feather silkscreened pins SDA and SCL being Wire

#

I'd be inclined to file an issue on the earlephilhower/arduino-pico repo, have to wonder if others have discovered this (how could they not)?

broken violet
#

Sounds good to me - I'll do that. Thanks for your help digging into the root cause!

safe shell
#

but of course a change now would probably break all kinds of stuff

broken violet
#

Heh. True.

#

Would be nice if miniTFTwing allowed one to set which I2C to use.

safe shell
#

true, an issue there perhaps?

broken violet
#

Yeah - maybe issues on both and then point them at each other & let them fight it out. 🙂

safe shell
#

lol

#

(just for ref, the file quoted above is variants/adafruit_feather/pins_arduino)

broken violet
#

Thanks - I'll add that info to the issue I submit.

safe shell
#

huh, the Feather RP2040 guide says:

The Feather RP2040 has two I2C ports. One is available as WIRE1 on the STEMMA QT port, and the other is available as WIRE0 on the SCL/SDA pins.

#

but the pinouts and schematics pages show they both use SDA and SCL, the silkscreened pins at the bottom of the short row of headers on the feather

lethal yarrow
#

Different board revs?

safe shell
#

maybe a copy-pasta from the rp2040 QT Py

#

I'll leave guide feedback

meager plume
#

Anyone here have issues with TinyGSM GSM_location.ino compiling with SoftwareSerial missing error

#

on esp32 dev board settings

broken violet
#

Ok - opened up issues on both the Seesaw lib (#83) and Arduino Pico board set (#1465). I tried to post links here but got smacked down by the bot.

safe shell
#

@broken violet you can delete all that boilerplate text

broken violet
#

@safe shell Well, the issues got some traction and a fix to the RP2040 Feather pin configuration was applied. I tried it out and it got my code working correctly. This may cause some headaches down the road for folks who had existing projects, but in the long run it brings things into better alignment with the Arduino ecosystem, so I'll take it as a win.

safe shell
#

I was following that, sounds good, thanks to cater for getting involved

meager plume
#

Anyone here have issues with TinyGSM GSM_location.ino compiling with SoftwareSerial missing error
on esp32 dev board settings

dense thicket
#

i m trying to fetch api from esp8266. here is my code.

#include <Arduino.h>
#include <ConnectWifi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClientSecure.h>

WiFiClientSecure wifiClient;

bool isConnected = false;

void setup() {
  Serial.begin(9600);
  isConnected = makeConnection("Home","He!!owor!d");
  pinMode(BUILTIN_LED,OUTPUT);
}

void loop() {
  if(isConnected){
    digitalWrite(BUILTIN_LED,HIGH);
    HTTPClient http;
    String url = "https://jsonplaceholder.typicode.com/todos/1";
    http.begin(wifiClient, url);
    int httpCode = http.GET();
    if (httpCode > 0) {
      String payload = http.getString();
      Serial.println(payload); 
    }
    http.end();
  }
  else{
    Serial.println("Wifi connection failed.");
  }
}

http requestion isn't success. How can i solve?

shy oasis
# dense thicket i m trying to fetch api from esp8266. here is my code. ```cpp #include <Arduino...

If you just want to get it working and don't care about the SSL cert verification you can add "wifiClient.setInsecure();" before the http.begin. Otherwise you can look at the https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/HTTPSRequest/HTTPSRequest.ino for a good example

GitHub

ESP8266 core for Arduino. Contribute to esp8266/Arduino development by creating an account on GitHub.

edgy ibex
#

I've got some code I'm trying to port to run on a Teensy 4.1. The problem is that it uses exceptions, and by default the compiler gets the -fno-exceptions flag which disables exception handling. What sort of price am I going to pay if I flip that switch to -fexceptions? Or should I just consider refactoring the code to remove the necessity for exceptions?

fresh pendant
#

@edgy ibex Mostly, the amount of used flash space will increase somewhat, because the compiler has to add extra information that is consulted in the case that exceptions occur. In this contrived example, which is for a non-specific ARM CPU, the number of bytes of binary code increased from 32 to 72 when the related compiler flag, -fexceptions, was enabled: https://godbolt.org/z/zMqrjWMen

(comparing the "Size" [in hex] of ".text", ".ARM.extab", ".ARM.exidx"; the latter exist only when exceptions are enabled)

The function f has to be prepared to deal with an exception that occurs in g, because it is required to call the destructor t::~T() whether g returns normally or by exception. It does this by including two copies of the internal call to t::~T(), along with some tables of data that are consulted when an exception actually gets thrown.

Beyond the data tables for each function, the data to parse and use the tables when exceptions are thrown will be included too, another increase in flash space usage. I didn't have an easy way to measure what this amount is.

Apologies for making a very technical answer, but there's not a fixed answer like "It'll make your code 10% larger" or "10kB larger". The good news is, unless exceptions are actually thrown, it doesn't make your code any slower.

edgy ibex
#

@fresh pendant No Apology needed - this is exactly the answer I'm looking for. What I can do is to temporarily comment out exceptions, then build the project in both modes, and just look at the statistics for flash usage to see what's changed.

edgy ibex
#

And after doing the test outlined above, all I can say is "ouch, that hurt". It should still fit, but here's the two build synopses:
-fno-exceptions:

Build started...
1>------ Build started: Project: SmartHome, Configuration: Release x64 ------
1>Memory Usage on Teensy 4.1:
1>  FLASH: code:11968, data:4044, headers:8560   free for files:8101892
1>   RAM1: variables:5376, code:9320, padding:23448   free for local variables:486144
1>   RAM2: variables:12416  free for malloc/new:511872

-fexceptions:

1>------ Build started: Project: SmartHome, Configuration: Release x64 ------
1>Memory Usage on Teensy 4.1:
1>  FLASH: code:70720, data:10188, headers:9200   free for files:8036356
1>   RAM1: variables:11552, code:68072, padding:30232   free for local variables:414432
1>   RAM2: variables:12416  free for malloc/new:511872

I will admit I'm surprised that the difference is that big, but that's the way it is. At a very rough estimate, I have at least 10% of the project ported by now, so a reasonable estimate is I'll be using no more than one 1Mb of the 8 Mb that are available.
Luckily for me, Paul put a lot of flash on the Teensy 4.1.

fresh pendant
#

the aditional RAM1 usage is more surprising to me than the growth of flash usage

#

but you've put numbers to it and that's what counts

#

"Configuration: Release x64" threw me for a loop too

edgy ibex
#

Ahh yes. That's because I finally threw in the towel on the Arduino IDE due to too many usability problems. I did a little work, and figured how to use Visual Studio, without needing an addon. Release build is for the Teensy itself, it calls out to arduino-cli to do the heavy lifting. Debug build targets the host Windows system, so I can single step through and watch exactly what's happening.

mystic raven
#

Does Adafruit have any relay boards that work with a feather that can detect zero crossover. I'm trying to turn on and off a 1/4 HP 240V motor and my thoughts were to switch it during zero crossover to minimuze the relay contacts from being fried.

lethal yarrow
mystic raven
#

I did think of the enclosure and it would be enclosed in an outside air conditioner. I'm trying to control the fan that runs at the top of an AC unit.

lethal yarrow
#

Still you don't want to just buy a little thing to go on top of a feather board for that. At best it would be extremely dangerous (possibly illegal depending on where you live). You'd be better off getting something designed specifically for handling mains from somewhere like Platt. Then you can use a feather wing to control that (they often use 12 or 24V logic).

mystic raven
#

Ok, it funny, the original motor has an ECM (Electronic Control Module) on it, and a 24 volt signal is sent to it from the main AC condensor control board. The electronics within the fan motor, contolled the additional mains wires that also went to the motor. My motor died, and I was trying to replace it with a generic AC motor and contol it myself using a small microcontroller and using the 24 volts as the trigger for the external relay.

#

Many AC condensors (outdoor units), use the 240V fan motors and I was just going to convert to it, since it was far cheaper going this route, rather than replace it with the exact same ECM motor. I've already found out that the main controller board doesn't get any feedback from the fan motor, it only sends a low voltage signal to turn it on.

slate badger
#

what is the name of this flat joystick

#

3ds style

#

thumb joystick

leaden lynx
#

I have a Nano PR2040 and I'm trying to upload code OTA - but I can't get it to work - does anyone have any advice on this? Or do I just need to get a different board?

thorn thistle
#

I just got my Feather RP2040 DVI and the serial port disappears as soon I try to download the 'fade' example.

#

Linux Mint 20.1 Xfce 64-bit on a Intel NUC

#

ACM0

#
Global variables use 8980 bytes (3%) of dynamic memory, leaving 253164 bytes for local variables. Maximum is 262144 bytes.
Resetting /dev/ttyACM0
Converting to uf2, output size: 139776, start address: 0x2000
Scanning for RP2040 devices
Exception executing udisksctl. Exception: [Errno 2] No such file or directory: 'udisksctl'
Exception executing udisksctl. Exception: [Errno 2] No such file or directory: 'udisksctl'
Exception executing udisksctl. Exception: [Errno 2] No such file or directory: 'udisksctl'
Exception executing udisksctl. Exception: [Errno 2] No such file or directory: 'udisksctl'
Exception executing udisksctl. Exception: [Errno 2] No such file or directory: 'udisksctl'
Exception executing udisksctl. Exception: [Errno 2] No such file or directory: 'udisksctl'
Exception executing udisksctl. Exception: [Errno 2] No such file or directory: 'udisksctl'
No drive to deploy.
Failed uploading: uploading error: exit status 1```
blazing lodge
vale mauve
#

I’m using a HiLetGo BME280 sensor with a feather m0 Ada over but I’m struggling to get it detected with the example code. I’ve tried connected SDI to GND and CSB to VDDIO. Looking at section 6.2 on the data sheet it says “SDI is bi-directional with open drain to GND: it must be externally connected to VDDIO via a pull up resistor.” But I’m struggling to understand what to do.

#

I appreciate any help greatly

north stream
#

One of those resistors is going to the wrong rail so it's not getting power

leaden walrus
leaden walrus
#

they need to be soldered

#

and thats what is needed to set I2C mode

vale mauve
#

Do they have to be soldered on the sensor too?

spice sparrow
#

Hi I'm trying to get a Pro Trinket working. I'm running Windows 11 and Arduino IDE 2.1.0. I followed the guide on the website and downloaded the drivers for Windows and tried to run Blink. The error I'm seeing is "avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)". The guide warns against this and tells you to make sure you're in Bootloader Mode by pressing and releasing the reset button on the board and making sure to have the Windows drivers installed, both of which I did. Anyone know what's up with this?

leaden walrus
lethal yarrow
spice sparrow
#

I'll give it a shot, thanks

#

Nah, it didn't work. rebooted and tried all the ports on my computer

#

Any other ideas?

lethal yarrow
#

Wrong driver perhaps.

#

Deprecation Warning: The Pro Trinket bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Pro Trinket so that people can maintain some older projets, we no longer recommend it.

spice sparrow
#

So it just won't work then huh

lethal yarrow
#

Well I guess you can try from a different machine, or maybe via a USB hub or something.

spice sparrow
#

Yeah, I'll try them. I guess the ItsyBitsy's the way to go

lethal yarrow
#

Or Metro Mini

#

Or something based on the 32u4

grizzled zodiac
vale mauve
leaden walrus
fresh pendant
#

I'm using the "Adafruit Feather RP2040 with USB Type A Host" and I'd like to set the LEDs of an attached keyboard. I have the following code, but it seems to have no effect:

uint8_t leds = (caps | (num << 1));
Serial.printf("Send LEDs report %d\r\n", leds);
auto r = tuh_hid_set_report(dev_addr, instance/*idx*/, 0/*report_id*/, HID_REPORT_TYPE_OUTPUT/*report_type*/, &leds, sizeof(leds));
Serial.printf("set_report() -> %d\n", (int)r);
``` the set_report call returns true (1) which I think indicates success, but there must be something incorrect or incomplete about the code I've got because the LEDs stay off. I've verified that on a host computer the LEDs do turn on and off, and I've verified that I'm sending values like 0/1/2/3 for the LED which also match my understanding of things
#

any clues or guidance would be great!

brave roost
#

doing a scale project, was working fine on the breadboard, was now dismantling it while also doodling a schematic of it for later soldering, anyway.. now I soldered up the screen and figured I'd test run it, which only turns on but does not display anything. I have ensured that everything is connected correctly & all the resistances are correct, nothing is shorting to anything else. Any advice on how to troubleshoot this further would be helpful. For reference, here's the schematic. Aplogies for it being so wack but I did not plan on having to share it

#

one change is I wired the 3rd pin's r10 line into D8 instead of D13, cause that put all my pins in the same spot

#

Symptoms are, the led backlight comes on but that's it, no other signs of life

north stream
#

That is a common problem with these displays, and debugging them is a pain. A good first step is to look at the initialization, and try to read back the display's characteristics to see if you're even talking to it.

bitter needle
bitter needle
bitter needle
bitter needle
#

Use Serial.flush() to ensure the serial is flushed out before continuing execution (incase it haults with something in the buffer).

#

Once you debug the display and confirm it is working (with some simple sample code) start adding parts (code) back in.

#

Anyway this is what I would do if you dropped the project in my lap and asked me to figure out what is wrong...

vale mauve
#

I'm using arduino with my feather m0 and using the example code from the PCF8523 RTC as shown on their website I'm getting "Couldn't find RTC"

quick maple
vale mauve
#

Using Arduino ide

brave roost
#

no variables in setup or anything else, just a script that spams a letter, the code appears to upload fine but it does nothing

#

I had removed the legs from it when removing everything from the breadboard, ended up having to heat it quite a bit

#

could it be that something maybe got damaged?

#

the iron was at 320c

#

goof on my side, forgot to set the baud rate in setup. That fixed the latest mentioned issue it seems

#

removing everything from script except the setup entries for tft changed nothing, leading me to believe it is a hardware issue

#

one thing worth mentioning is this missing gel that seems to be from the display falling on the floor some time weeks ago whilst in "storage"

#

that said I think the traces and the ribbon is fine

#

ok welp, I found the issue but I don't understand why this is an issue

#

I shorted d8 and d13 so they act as the same pin & changed _sclk in script from 8 to 13 as it was originally, and it works

#

why does it not work on d8 but does on d13?

bitter needle
# brave roost I shorted d8 and d13 so they act as the same pin & changed `_sclk` in script fro...

As far as D8 D13 goes, if you are using the hardware SPI interface then D13 is the SCK line, it is fixed (can't change the pin).
https://www.gravitech.us/arna30wiatp.html
http://site.gravitech.us/Arduino/NANO30/ArduinoNano3_0schematic.pdf
This might be the reason it does not work on D8.

If you want to verify the D8 pin functions correctly wire an LED (with resistor of course) up to that pin and see if you can turn that in ON/OFF with pinMode(8, OUTPUT); and digitalWrite(8, HIGH); and see if it works. Shorting two GPIOs is not exactly good, but, seeing they default to input mode, and were not sinking any current they should be fine. Some parts can be pretty resilient to mistakes.

320C is perfectly fine for soldering, that is actually the temperature I usually solder at unless something needs more heat (max I will go is 400 or 420, but only if absolutely necessary, large pad, large metal part, etc). I doubt the part was damaged due to that heat unless it was very long exposure.

On the pictures, damage to the rubber will not break the connection, it is bonded (glass bonding method) to the glass and PCB. It should be okay, the rubber is there to protect the connection, but it appears still bonded, I would not worry about it and just don't touch it (so the other rubber does not peal off).

Glad the display works, I would save that sketch and take note of all the connections so you can return to that point if things start to not work again. As mentioned above, believe you are using the hardware SPI interface, and those pins are fixed, it can be seen that those pins are not specified in the initialization below.

Adafruit_ILI9340 tft = Adafruit_ILI9340(_cs, _dc, _rst);

The only pins that you can change are CS (chip select), DC (data/command select), and RST (reset) unless you switch over to a software SPI implmentation. As the hardware SPI might be more reliable I would keep it as is.

Glad you got the LCD working, hope you get the other parts figured out too.

midnight acorn
#

This code is for my dot matrix display I have run this code with dot matrix display. Now I am trying to run this code with P10 LED matrix display with some necessary changes like define pins of P10 display, define pin functions for P10 display etc. I tried but didn't succeed. Please, can anyone tell me how can I add SPIDMD function for P10 display, and how can I change this code according to P10 display. How to change functions according to P10 display. Please guide me.
Thank you.

bitter needle
# midnight acorn This code is for my dot matrix display I have run this code with dot matrix disp...

Are you talking about one of these displays? https://www.adafruit.com/product/420
First I would connect up the display and follow one of the Adafruit guides on how to get that display working.
Follow the guide's wiring instructions, etc, to minimize any sources of error.

Once that sample is working, you can add it to your existing project. First confirm the display works, and your hardware connections are good.
Next, you can start to modify the sample to match the project you would like to merge it into.
Were you able to get a sample project with the display working?

bitter needle
midnight acorn
#

Anyone can me provide SPIDMD.h library, I need this library for my code.
If anyone have this library please send.

nimble cobalt
#

Hi folks. I have a serial problem with a Trinket, which looks like a popular option, today. I think mine is slightly different, though. I'm programming a Trinket M0 on a Mac, with the Arduino IDE. Was working fine, then halfway through my 5 or 6th upload, the Trinket disappeared (not literally). Power cycling Trinket, Mac, try different cables, still no Trinket serial port. So, I tried a different Trinket, and the serial port just appeared. So, back to the faulty Trinket, I tried putting it in Bootloader mode. Double click, and it appeared as a removable drive. So, cable okay, Trinket serial port okay, why doesn't the Trinket serial port appear on my Mac, anymore? Any help appreciated.

quick maple
#

is it a trinket pro ?

nimble cobalt
#

Nope, Trinket MO.

vale mauve
#

My feather m0 adalogger is still not detecting its RTC

manic jewel
north stream
nimble cobalt
#

@north stream Unfortunately, it seems not:

#

"Failed uploading: no upload port provided"

#

Unless there's something else I should set.

north stream
#

Huh. I thought I'd had a similar situation after I installed CircuitPython on one but somehow Arduino was able to put code on it.

nimble cobalt
midnight acorn
#

In the provided code file, I get this error.
error: expected primary-expression before 'char'
Please say me how can I solve it.

cedar mountain
midnight acorn
alpine axle
#

hey everyone. i had a question for yall. im new to the robot space and im trying to find a expansion board for some servo's because a breadboard wont do enough. i got told to get this one. but its an american product. as a european id have to pay minimum 100 dollars shipping for a 10 dollar part which isnt worthed for me. if one of you has another board that would work or another idea i'd appriciate the help

north stream
north stream
#

There are also boards with PWM generators you can use if you want to control more servos than your controller supports directly. For example, this one if you happen to be using an Arduino https://www.adafruit.com/product/1411

quick maple
#

Before you say "american company" Digikey Germany has 17 in stock at 16.10 euros

#

Shipping is free with a min order - in case you didn't know. Also like I said in the other channel servocity has an european distributor in italy 🙂

vale mauve
#

My arduino code here on my feather m0 adalogger is not logging anything after "log file opened". Code below:

cedar mountain
# vale mauve

This line might be tripping some stuff up, though I'm not sure if it would be problematic enough to crash the code:c logFile.print(unix_time + ",");You probably need to convert the time to a string before trying to concatenate it.

vale mauve
#

that seems to have fixed it

#

Thanks a lot

quick maple
#

that is what I dislike a lot in arduino c

#

printing stuff is not at all like C or C++. It looks so at first glance but it isn't

north stream
#

Wiring is pretty much like C++. Low level languages like that don't do a lot for you.

quick maple
#

I mean when I wrote to an LCD I had to use a weird format like %something. vs serial.print which is very simple

#

C++ has cout >> which is very simple too and .net has string literals/string.format

#

Everytime I have to print a mix of string with the values of variables on an LCD it's much more hard than it should be

north stream
#

There are libraries that let you print to an LCD

quick maple
#

You have to compose the string first and mix it with vars that is the issue

#

and it's not as easy as serial.print

north stream
#

Serial.print is the same in that respect

quick maple
#

(time to find some example code to show what I mean rather than talk about a vague problem that happened months ago)

#

Is there a better to write the values out in println and have it prints in %4.2f C-like format ?

#

near line 80

#

there's 2 sensors there hence the 1 and 2 in variable name, goal is to make them more accurate using average filtering

violet oak
#

so I just got a feather RP2040 with USB host and i was wondering if someone can help me write an Arduino sketch that takes keyboard presses from a USB key board via the USB host port and create different key combos like CTRL+C and CTRL+V together as ALT+D, or when one the keyboard I press ALT+#[0 - 9] or CTRL+ALT+#[0 - 9] it types a set string automatically.

twilit hare
#

has anyone ever come across an equivalent to circuit python displayio "layers" in arduino? Specifically, I want show/hide a background image with squares (add them and "pop" them one by one)

alpine axle
#

thanks in advance

nimble cobalt
#

Well, for the zero people following my Trinket M0 serial port disappearing problem, uploading a new bootloader solved the problem.

nimble cobalt
#

Um, maybe I spoke too soon. Although I can now upload code via Arduino IDE, the board type keeps flipping to 'Adafruit pIRK (SAMD21)' like it's being autodetected as the wrong board. The UF2 package I used to update was 'update-bootloader-trinket_m0-v3.7.0.uf2'

north stream
#

I have been following along. That is odd indeed, I figured a Trinket package would identify as a Trinket board. That looks like what I'd expect for a UF2 package for the abandoned pIRKey product, I didn't even know there were UF2s for that.

nimble cobalt
alpine axle
#

Thank you

bitter needle
# north stream I believe the IDE can still upload code to it even if the serial port does not a...

@nimble cobalt @north stream
After note: After I wrote this, I saw a Trinket m0 is being used, well this information might still be useful to someone.
Note: this conversation applies to the ATtiny85 based Trinkets.
The trick with the Trinkets is that the USB protocol is bit banged (which is why it doesn't work well with USB3.0).
The device enumerates as a USB device (not as a serial device, and only when the LED is flashing), need to choose the programmer "USBtinyISP" and just choose any serial port (it won't actually use it), but it will it will find the USB device (from the USB vendor/product IDs).
You will notice a USB device enumerates for a brief second while the LED is flashing (bootloader is active), then goes away (or re-enumerates).
You need to reset the Tricket (double click the reset button on the Trinket) then immediately (I do mean immediately) hit the "write" button on the Arduino software. The programming must start before the Trinket bootloader times out. Might require multiple attempts.
It is a little finicky but this is how I program them.
Also, use a USB 2.0 hub between your PC and the trinket (the bit banged USB protocol is not timed well enough for USB 3.0).
I still use the Trinkets, they are great when you just need a small simple MCU.
If others have some experience with Trinkets, please share...this is my experience above and how I work with them.

#

However, I will add, the Trinket m0 can most likely be used as a replacement for the ATtiny85 Trinkets (and has native USB3.0 support), but I do still like the simplicity of the original Trinkets.

quick maple
#

Couldn't you use like an USB HID/HOST between the trinket and a computer to handle the bit-bang and convert it ?

bitter needle
#

Maybe it is possible, but I just throw a USB2.0 hub between the PC (I am on a MacbookPro) and the Trinket, and it resolves the timing issues (seems USB2.0 isn't as strict).

quick maple
#

I find it hard to believe that one cant bypass that on usb 3 like with a windows driver in C++

bitter needle
#

That is if we are talking about the ATtiny Trinkets.

quick maple
#

Or usb 3.0 hides raw packets and you cant access them at all or set polling rate etc ?

bitter needle
#

Quite possible the USB3.0 controllers expect timing to be followed more strictly? It is bit banging the USB after all... it most likely is using USB 1.1 anyway...

quick maple
#

assuming that bit banging is only software

bitter needle
#

For the ATtiny85s yes, it is 100% software, there is no hardware USB, and a 8Mhz (or 16Mhz) clock. I don't think it even has a hardware UART.
However, I like the super simplicity of the ATtint85, very low power, and super simple, sometimes it just fits the bill.

quick maple
#

Im curious to get one just to figure it out why it cant be solved

#

even if I have to click I accept 4 times on adafruit website to get one 🤣

bitter needle
#

If you just want something dead simple to flash some LEDs, poll data from a I2C sensor, or control a NeoPixel, I think it is great.
Software UART (at maybe 9600 baud) works ok too. Maybe just need something simple to interface a I2C sensor and forward data out a UART connection...

quick maple
#

how does it compare to esp 8266 which even has i2c bit banging 😦 ?

bitter needle
#

Well, it does have hardware SPI and I2C support, partial UART support (implements some hardware buffers).
Yeah ESP 8266 would work too (at higher current draw maybe?).

quick maple
#

Anyway it does seems possible with a driver since that is what USB FIFO devices seems to be using and they dont require a MCU (uses the usb wires as data wires with bit banging)

bitter needle
#

I think the bootloader just needs to be fixed, it was developed before USB 3.0 released, and not touched after I think...
See if I can figure out what bootloader it is using...

#

It is an open source bootloader.

quick maple
#

It seems that bit-banging worked on usb 1/2 but dosnt work on 3 anymore since it's not electrically backward compatible as far as bit banging goes

bitter needle
quick maple
#

and you cant tell the host to be in usb 1.1 mode and not 3.0 mode

quick maple
#

so youd have to write a driver to define the protocol yourself and then it should be possible

violet oak
#

so I just got a feather RP2040 with USB host and i was wondering if someone can help me write an Arduino sketch that takes keyboard presses from a USB key board via the USB host port and create different key combos like CTRL+C and CTRL+V together as ALT+D, or when one the keyboard I press ALT+#[0 - 9] or CTRL+ALT+#[0 - 9] it types a set string automatically.

quick maple
# bitter needle That is very possible.

So lets assume one would be able to communicate with the trinker in some way (driver/low-level user-mod program that use raw USB) any idea how would one make arduino ide be able to uses the data to operate normally ?

quick maple
bitter needle
quick maple
#

I think they want to use it to macro stuff on pc games

#

ie: connect keyboard to the rp2040 connect rp2040 to pc as a keyboard

#

but that requires usb host AND usb HID

bitter needle
#

Yes, but you can do this with TWO rp2040s I think? Use a UART interface between the two, however, this will input lag your keyboard for gaming I think...

quick maple
#

not sure that feather RP2040 is an usb hid

#

usb hid is pretty rare on MCUs

violet oak
#

like if i press ALT+D on the usb keyboard pluged in it dose CTRL+c and then CTRL+v

bitter needle
#

I have done this with a STM32F401 (enumerate an iPhone), but don't recall have done this in Arduino.

quick maple
bitter needle
#

The thing to solve here is... how to you get the keypress from the keyboard into the rp2040. The two device might be connected the same USB hub, but the USB connection is between the PC/keyboard, and PC/rp2040. There is no communication between the keyboard/rp2040. I don't even think the USB hub will pass the packets through.

violet oak
bitter needle
#

I am not sure you can use it in host AND device at the same time, let me look.
But, we still have the lag issue, the rp2040 will need to forward your keypresses through (can it process them fast enough?).

quick maple
#

that is linked from the adafruit tutorial about that mcu

bitter needle
#

I just found that too, you beat me to the copy/paste!

#

Yes, so it seems possible.

quick maple
#

Im just not sure how you would send ctrl+c ctrl+v, probably USB ID specific keycodes

bitter needle
#

There will be two scan codes to keep track of, just implementing some state machine logic... If Ctrl is followed by c.... then send Ctrl followed by v

#

But, you will need to wait for the release of the keys (there are key press/key release scan codes). There can only be so many keys active at a time (I think).

#

Maybe some gaming keyboards (and drivers) have bypasses for that multiple keypress limit.

#

But, yes, that seems it could work, so I would recommend purchasing one (or two/three if you can incase you blow one up) and start programming. It looks like it will be a fun project, and you will learn a lot about USB keyboard protocols too.

quick maple
#

normally on a regular keyboard it's like 2-3 key pressed at the same time

#

before it beeps in panic 🤣

bitter needle
#

As a general rule, I usually buy three of something I only need one of, it sucks when you blow something up (and can't continue), or need to compare to answer the question (did I break it?).

quick maple
#

report->modifier & (KEYBOARD_MODIFIER_LEFTSHIFT | KEYBOARD_MODIFIER_RIGHTSHIFT); in the firmware seems to suggest that if there is more than one key pressed it can be separated with binary AND

bitter needle
#

Okay, so somewhere they actually break the scan codes out for you, that is cool.

quick maple
#

no that's the thing

#

those symbols in the code dont resolve so I dont know how it does the scancodes

bitter needle
#

Somewhere in some .h file... it must exist...

quick maple
#

I uses github respository search 😦

bitter needle
#

When that happens to me, I open up sublime and do a "search all files" and search for that text string in every file in the project folder.
For Arduino you will need to do that to all the Arduino (and compiler tool chain) folders...

quick maple
bitter needle
#

Yes! Codes are all standardized so yes that will help, would be nice to know where those definiations are though.

quick maple
#

I guess it comes from that + trial-error by sniffing the key codes when a keyboard uses custom keys

bitter needle
#

A very long time ago I made a PS/2 (before USB came) to GameCube keyboard adapter (using a PIC microcontroller) and was an eyeopener to keyboard scan codes.
I am pretty sure the USB spec still uses the same scan code IDs.

quick maple
#

you can apparently have 6 keys at the same time in the packet

#

limited by the keyboard being able to buffer it/send it I guess

#

because most business keyboards starts crying at 3

bitter needle
#

Yea, but there are also release, and hold codes too I think...

#

There is a press/release/hold code I think...

quick maple
bitter needle
#

@violet oak
Yea sorry, got carried away, but yes, short answer, looks like what you want to do is possible.
The first step is to grab one (maybe a few) of those rp2040 with USB host connector, then start experimenting!

quick maple
#

you will basically have to intercept the correct keycodes and account for release of the key in the correct order

bitter needle
#

...and forward the key presses through...

#

all keypresses

quick maple
#

and account for some time delta between these actions as the user is only human and might not always do it in the same time

#

then if you have those keypresses you'd send other keycodes to the PC

bitter needle
#

This project looks very similar to a USB keylogger, so keep that in mind when thinking about it.

#

I mean thinking about how to make it (program it).

quick maple
#

this is something games have to do all the time in general so it is a well-known problem

#

especially fighting type games

thick vector
#

Hey guys, anyone know who to achieve a similar rgb keyboard effect on arduino?

lethal yarrow
#

That is an extremely general question.

thick vector
#

Opps, to specify, With the ws2812b led strsips

#

and one of the effects is basically a fade/wave patten, when the color shifts from red to green to blue like a wave

thick vector
#

Basically trsistions to this state to the other and then cycles in a smooth fashion

quasi lily
#

We are having trouble detecting the Adafruit M0 Feather as a port on the Arduino IDE. Is there something we are doing wrong? It is not showing up at all.

silk token
#

How would I make a PWM output for a specified period of time while allowing other actions such as "emergency stop" without using delay() ? I need to keep a motor spinning until the thing its moving reaches a specific point, this interval is controlled by an encoder which changes function to modifying the motor speed when the encoder button is pressed.
I am jumping back into coding after some time not doing much so my C++ skills and coding steel are tarnishing a bit.
https://github.com/flyingfishfuse/rawr_auto_cat_feederz_uWu/blob/main/automatic_cat_poop_THING.ino

Line 259 wait_for_motor_to_spin() is the problem spot

GitHub

arduino code for an automated cat feeder using RFID - rawr_auto_cat_feederz_uWu/automatic_cat_poop_THING.ino at main · flyingfishfuse/rawr_auto_cat_feederz_uWu

novel igloo
#

Hi, could anyone help me with exiting the boot mode on ESP32-S2 board? It's recognized as METROS2BOOT as opposed to CIRCUITPY. I'm a little confused.

quick maple
#

do you want circuit python on it or arduino ?

novel igloo
#

circuitpython

quick maple
novel igloo
#

Thanks

tame veldt
#

Hello everyone,

I have the Arduino Uno R3 and I am attempting to use the LM386 (low voltage audio power amplifier) to drive an 8 ohm speaker, playing .wav files (converted the files into 8 bit resolution, rate 16000 Hz, Mono channel) from a MicroSD card module.

I've seen a few tutorials and have tried replicating them. However as I am fairly new to electronics, I failed. I noticed uses of capacitors (electrolytic and monolithic) are common in these tutorials but not sure where to place them correctly.

The specific one I am following is from the Arduino site: https://docs.arduino.cc/tutorials/generic/simple-audio-player

(It's not for the UNO but I assume the Fritzing schematic can still be applied here?)

The following components I have are:

  • 100uF capacitor 25V (I don't have 250uF, I am assuming it's not enough?)
  • 10uF capacitor 25V
  • 104 Monolithic capacitor (for the 100nF capacitor because I didn't have the specific one listed on hand but a Google search says it can be the alternative?)

Apologies for the long post, thanks everyone.

quick maple
#

Well sorry to stop you right there but no that library require either of those 3 the UNO wont do and dont have what it takes on-board to do this that is because these have a much more powerful SAMD . Possibly the UNO doesnt have the required DAC / DAP either

#

the UNO is primitive vs these modern cortex/samd

tame veldt
#

Thanks for the reply Mulhorand, is there any alternative? I am not using the AudioZero library but instead TMRPCM. The last build I did "work" but the only audible noise was the speakers making a slight popping noise.

quick maple
#

even on the new uno r4 it would need a specific library to do that. Others could advice what to do with a normal uno using audio shields 9Not very familiar with them)

#

as for the capacitors that would be a good time to get some basic 10$ capacitor kit with a variety of capacity / materials / voltage 🙂

#

for audio having the right capacitor matters a bit more and 250uf vs 100uf might make a difference depending on what is the purpose of it exactly

quick maple
#

and which uno and brand is it ?

tame veldt
#

From what I've read in tutorials, it seem that I had to format the .wav files into 8 bit resolution, sampling rate of 16000 Hz, Mono channel.
It's an UNO R3, ATmega328P chip

quick maple
#

so Im kinda surprised that you may have gotten it to read a wav file

tame veldt
#

Yea in the above post, I forgot to mention that it is a MIcroSD card module I used

quick maple
#

which one ?

#

The one in the tutorial ?

tame veldt
#

I'm not too sure on the brand, but it is from here:
https://www.canadarobotix.com/products/2077

Canada Robotix

This Micro SD Card Breakout Module allows you to read directly off a Micro SD Card and into your microcontrollers such as Arduino & Raspberry Pi. The data is easily accessable via microcontroller using the popular SPI protocol. Specifications: Power Supply Voltage: 4.5 - 5 V Logic Level: 3.3V / 5V Supports Micro SD

quick maple
# tame veldt I'm not too sure on the brand, but it is from here: https://www.canadarobotix.co...

There a tutorial with the nano/uno using that library and the lm386: https://quartzcomponents.com/blogs/electronics-projects/arduino-music-player-with-amplify-audio-using-lm386. When said said "format the .wav files into 8 bit resolution, sampling rate of 16000 Hz, Mono channel." that is what on the sd card right ? Can you take a pic of your circuit or a fritzing or a schematic to see how you connected it?

#

I dont have an lm386 or I would have done the circuit on my uno 😦

tame veldt
#

Yes that's what it says on the files.

Sure I can provide a picture but I am not too sure if it'll help much as it's a bit messy. Shall I post it?

quick maple
#

well mainly want to see the connections on the arduino pins and the layout on the breadboard to see what you put and where

#

If it quits after the very beginning and it's not the wiring it is that it cant read the file for some reason

tame veldt
#

First picture is the build I did for the most recent tutorial.

Second one is the "working" one (I made a note on the noise the speaker outputted)

quick maple
#

You should post the code too (ie: upload the file/remove identifying information first) because you may have to use several libraries here. For instance the SPI might not be initialized here with the SPI library.

#

My instinct is that the problem the sd card reader that doesnt have any documentation / datasheet 😦

tame veldt
#

For the second picture, I ran the CardInfo example and it successfully listed all .wav files.

Sure I'll post the code too. I just have to BRB but I'll get back to you.

quick maple
#

Also Im asking you probing questions Im not necessarily the most experienced here but someone ore experience can see the answers to them and it might help them to help

tame veldt
#

No worries, I'll gladly accept as much as help.

This for the second pic, I also noted the link to remind myself where I followed this.

/**
https://www.instructables.com/Make-Your-Own-Song-Player-Using-Arduino-Uno/
**/


#include <TMRpcm.h>
#include <pcmConfig.h>
#include <pcmRF.h>
#include <SD.h>
#include <SPI.h>

const int SD_ChipSelectPin = 10;
TMRpcm tmrpcm;
File root;

void setup() {

  Serial.begin(9600);

  tmrpcm.speakerPin = 9;

  if(!SD.begin(SD_ChipSelectPin)){
    Serial.println("SD fails");
    return;
  }

  root = SD.open("sample/sounds");
  printDirectory(root, 0);

  tmrpcm.setVolume(7);

  play();

}

void loop() {
  // put your main code here, to run repeatedly:

}

void play(){
  
  // tmrpcm.stopPlayback();

  tmrpcm.play("Intro.wav");
  delay(1000);
  tmrpcm.play("Perfect.wav");
  delay(1000);
  
}

void printDirectory(File dir, int numTabs) {
  while (true) {

    File entry =  dir.openNextFile();
    if (! entry) {
      // no more files
      break;
    }
    for (uint8_t i = 0; i < numTabs; i++) {
      Serial.print('\t');
    }
    Serial.print(entry.name());
    if (entry.isDirectory()) {
      Serial.println("/");
      printDirectory(entry, numTabs + 1);
    } else {
      // files have sizes, directories do not
      Serial.print("\t\t");
      Serial.println(entry.size(), DEC);
    }
    entry.close();
  }
}
quick maple
#

Im going to play games for a while been doing electronics all day. If you get no reply for a while Id try in #help-with-projects

#

Also I hardly see how you can not need the lm386 since it doesnt seem to be used. Cant see the side on it of the left pic either. Also have you tried intro.WAV or Intro.WAV ?

tame veldt
#

Yeah the second pic was before I purchased the LM386. Perhaps I should try to integrate this into the project...?

Yep, tried renaming and everything. Still popping/static noises.

Appreciate the help.

quick maple
#

how long you get the nolses or they never stop ?

#

as long as the .wav duration ?

#

didnt realize the tutorial I linked used a breakout and not the chip directly...

tame veldt
#

The noises stop after it runs the .play(..); then delay(..), afterwards another.

north stream
low verge
#

Hello. Looking at this value (int)((0.99/3.3)*32767) what represents the constant 32767 and why we use it there ?

trail swallow
#

So I'd call that "scale 0.99/3.3 to a 15-bit integer"

low verge
#

the code is used to calculate the scaling factor of an input voltage between 0.99 and 2.5 and convert it throuht 3.3V ADC ref

dry quiver
#

It likely means you have a 15-bit ADC, though that makes me wonder why 15 in the first place, not that it matters.

trail swallow
#

okay, so I'm assuming that's set as a constant named "lowVolage" or something?

dry quiver
#

Well, that's its level of accuracy in a way, something you scale with given the number of bits. If it were a 10-bit ADC, I'd be expecting 1023.

trail swallow
#

Sorry, I meant to direct that question to @low verge out of curiosity for the use case

lavish karma
#

Does anyone know how to, or is it's possible to, connect a strain gauge to an Arduino with an op-amp or feedback circuit? It's in a wheatstone bridge configuration

(not using an hx711 or similar chip) I need sensor data updated at a very fast rate, the hx711 is slow

north stream
#

Yeah, it's possible, but you'll need to be careful with wiring and shielding as you're dealing with low-level signals.

edgy ibex
#

Looking at the compiler options handed to gcc, I note that exceptions are disabled. Rightly so, they add a huge amount of code to the executable.
That does however raise the question of what happens if operator new is unable to allocate memory? C++ standard says it's supposed to throw an exception, but we don't have them enabled.

elfin sparrow
#

Hi everyone, I'm trying to use an ESP32 feather V2 to communicate over I2C. I've tried multiple devices with no luck. I'm not seeing any I2C devices. Currently trying with SPL06-007 pressure sensor module to keep it simple.
I've tested power and ground, tested with other controllers and they all work. I'm new to the esp32 pico and suspect it might be a pin definition issue in the code? Any help would be appreciated.

#

Here's a screenshot of the serial monitor while running an I2C scan

#

These are the connections on the breadboard

sick ridge
#

I have an arduin uno communicating with a gamepad QT that i just received and i think the documentation is a little light yet ( i understand its a new project) I was just trying to read in the values .. I was able to locate it at 0x50 and handshake but The values i receive do not seem right, but i am un farmilure with the seesaw platform i am using this with the pin out https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout/pinouts. but i am not reading analog or digital pins in the following loop void loop() { //Serial.print(ss.digitalReadBulk(mask), BIN); Serial.print(ss.analogRead(2)); Serial.print(" "); Serial.print(ss.analogRead(3)); Serial.print(" "); Serial.print(ss.analogRead(4)); Serial.print(" "); Serial.print(ss.digitalRead(9)); Serial.print(" "); Serial.print(ss.digitalRead(10)); Serial.print(" "); Serial.print(ss.digitalRead(11)); Serial.print(" "); Serial.print(ss.digitalRead(14)); Serial.print(" "); Serial.println(); delay(500); }

#

the 3 analog printed values act like they are floating until you puress y button then goto 0 then shoot up and drift back down to 290

sick ridge
sick ridge
#

Working ArduinoUno GamePad QT Test Code

/*
 * This example connects to the Gamepad QT
 */

#include "Adafruit_seesaw.h"
Adafruit_seesaw ss;

// GamePad QT Array 
int pinArray[] = {16, 0, 1, 5, 2, 6, 14, 15};
String pinName[] = {"Start", "Select", "B", "A", "Y", "X", "AnalogX", "AnalogY"};
int analogDeadZone[] = { 515, 10 }; // Center Value , Dead Zone Delta

void setup() {
  Serial.begin(115200);
  
  if(!ss.begin(0x50)){
    Serial.println("ERROR!");
    while(1) delay(1);
  }
  else Serial.println("GamePad QT started");
  
  for (int i = 0; i <= 5 ; i++) {         // Setup Digital Internal Pullups
    ss.pinMode(pinArray[i], INPUT_PULLUP);  
  }
}

void loop() {
  for (int i = 0; i <= 5; i++) {          // print digital pinout 
    Serial.print(pinName[i]);
    Serial.print(": ");
    Serial.print(ss.digitalRead(pinArray[i]));
    Serial.print(" ");
  }
  
  for (int i = 6; i <= 7; i++) {        // print Analog Readout
    Serial.print(pinName[i]);
    Serial.print(": ");
    int analogValue = ss.analogRead(pinArray[i]);
    // Detect Dead Zone and Convert from +- 0-1
    if (analogValue >= (analogDeadZone[0] - analogDeadZone[1]) && analogValue <= (analogDeadZone[0] + analogDeadZone[1]) ) {
      Serial.print("0");
    } else {
      Serial.print(1-(analogValue/(float)analogDeadZone[0]));
    }
    Serial.print(" ");
    Serial.print(ss.analogRead(pinArray[i]));
    Serial.print(" ");
  }
  Serial.println();
  delay(50);
}
obtuse blade
#

I have a quick question about the minimum resistance i can use on an arduino. Im using an output pin from the arduino to power an IR led diode but it seems like i need a little more power (for range. I unfortunately do not have another LED to add in series). Would it be safe for the arduino if i were to drop the resistor in series with the LED down to 50 or 10 ohms?

#

For context, i only ever occasionally send very brief pulses to the LED and am not sending a sustained current. Thanks!

north stream
lethal yarrow
quick maple
#

isn't it 40 ?

#

from atmega 328p datasheet ?

lethal yarrow
#

Maybe 40 for the port

#

I'd have to look.

mystic raven
#

I have a programming question regarding interrupt service routines (ISRs) and the arduino uno.
I do want to move this solution to a smaller board such as trinkit or cell modem enabled avr eventually.
I have an incoming bit stream of 150 bits and the bit timing is 1 millisecond.
There are 15 milliseconds of zero bits at the end of the bit stream and then it repeats.
The bit stream starts with a rising edge.
I am using pin2 (INT 0) and set an interrupt to watch for a rising edge.
This tells me when the bit stream begins.
When the pin2 interrupt fires, I then turn on Timer1 interrupt.
Timer 1 was setup to fire a Timer1 ISR every 1 millisecond.
Once the external pin2 interrupt fires, I need to immediately call the Timer1 ISR from the pin2 interrupt, so that I can
process the first incoming bit.
I can't wait for the timer interrupt to fire, because I would loose the first bit
since the timer wouldn't fire until the first millisecond has elapsed.

My issue is that I don't know how to directly call the Timer1 ISR , from within the external pin2 ISR.

#
// Timer interrupt handler
ISR(TIMER1_COMPA_vect) {
  timerInterruptOccured = true;

  // Read the state of the incoming data stream
  bitValue = digitalRead(2);

  if (currentblockbits >0) {
    currentblockbits--;

    if (bitValue ==0) {
      
      if (bitValue == lastbitValue) {
        adjacentZeroBits++;
        if (adjacentZeroBits >= maxgapbits) {
          intraGapDetected = true;
        }
      }
    } else {
      adjacentZeroBits = 0;
    }
  } else {
      if (currentgapbits >0) {
        fetchingBlockBits = false;
        currentgapbits--;
      }
  }

  lastbitValue = bitValue;

  if ( ((currentblockbits ==0) && (currentgapbits ==0)) || (intraGapDetected)) {
    disableTimerInterrupt();
  }
}


// Function to handle interrupt triggered by incoming data on pin 2
void pinInterrupt() {
  // immediately enable the timer interrupt so the timer doesn't drift from bit stream
  // don't use a subroutine, which will add additional stack push/pop delay

  cli();  // disable all interrupts
  // enable Timer1 ISR
  // reset the Timer 1 counter
  TCNT1 = 0;  // Reset the timer counter
  
  // Enable Timer 1 interrupt
  TIMSK1 |= (1 << OCIE1A);  // Enable Timer1 compare interrupt    

  // set the state of the Timer interrupt processing flag
  timerInterruptOccured = false; 

  // set interrupt flag vars
  timerInterruptEnabled = true;    
  
  // disable pin Interrupt
  EIMSK &= ~(1 << INT0);  // Disable INT0, external interrupt on pin 2
  sei();  // re-enable the interrupts


  // set interrupt flag vars
  pinChangeInterruptEnabled = false;

  // intialize the variables after enabling counter
  // to minimize time drift
  initializeVars();

  // now call the Timer 1 ISR so we don't loose the first bit

}
north stream
#

I'd probably simplify the problem by moving the action part of the interrupt into a separate subroutine, and call that from both ISRs

mystic raven
#

I actually thought of that, but was worried about the timing overhead of calling a function within the Timer1 ISR. The pin Interrupt isn't so critical, since it is only triggered once and then disabled, until the next data stream block arrives (150 bits later).

#

The Time1 ISR, is more critical, since I don't want any drift from the detecting the incoming bits, since they are spaced exactly 1 millisecond apart.

north stream
#

You might have to go spelunking into how the ISR functions are wrapped in order to figure out how to call them directly, but there should be a way to do so.

mystic river
#

Does somone know the resitor value of the adafruit pt19 light sensor?

cedar mountain
mystic river
#

thanks

blazing crane
#

I have a continuous servo that expects a PWM pulse between 500 and 2500μs at what I can assume is a period of 20ms. Even at 2500μs, the servo is too slow for my application. Using a smaller period (like 5ms) makes it run slightly faster. Is this damaging the servo?

#

(moved question from general)

lavish jacinth
#

In my experience it seems like continuous rotation servos pretty much are j it st either on or off; no noticable change in speed. Maybe I've just been buying crummy servos... In any event I'm pretty sure it won't hurt them no matter what speed you command

quick maple
#

lol post from 7 years ago about the arduino dev env: "Industry will laugh at you if you claim to be an expert in Arduino. I am sure there are exceptions to this with some companies, but once they burn through their kickstarter money, it won't be relevant."

#

"32kb ought to be enough for everybody" IBM 1981

safe crown
#

does anybody have / had vanishing firwmare on a M4 board with the standard UF2 / serial CDC bootloader (arduino, not micro python) ? It's the 3rd time we run into this issue, the board powers up or end in bootloader mode, like the fw has vanished and we don't know what is happening.
we are on bootloader UF2 Bootloader v2.0.0-adafruit.7 SFHWRO
thanks

stable forge
safe crown
#

I see @stable forge thank you so much. So it could be power. Would makes sense then, the board has jacks 1/4" (analog to MIDI controller)

#

inserting the jack was made harmless by taking the power of them from I/O, but I guess it could still create a power glitch with weird insertion from customers

#

@stable forge sent the customer the new 3.15 bootloader to see if things stick. Thank you so much, I didn't see the notice about the glitch when I did the dev, now the device is being disseminated and the issues arise with "random use cases and users"

stable forge
native dagger
#

WHen you set a pin to INPUT_PULLUP, specifically PB06 on a 32u4, does that make it an analog pin with an input pullup?

valid hazel
#

No, it fires up the pullup resistor

native dagger
#

*analog input pinb

valid hazel
#

So you "see" a 1 when reading it. Unless something external grounds it

#

Try it and see

native dagger
#

I don't have one, I'm trying to make sure I understand another circuit. My chip doesn't have input pull-ups in analog mode

valid hazel
#

Why would you want an unspecified amount if ohms messing up your analog input?

native dagger
#

I don't, I'm trying to make sure I have an understanding of the firewalker project

civic tartan
#

I am facing an issue with my current setup. I have an ESP32 devkit running WLED with 32 ws2812b led strip and an IR break beam sensor. The LED's are connected to gpio 2, the IR sensor is connected to gpio 23 with a 10k resistor connected to the IR output and positive (no necessary reason for these gpio connections other than its easily accessible) The issue is that when the IR sensor is obstructed for about 2 seconds, the color of the LED's change when they should not (set to solid color) and after about 5-10 seconds, the ESP board resets WLED to factory settings.

quick maple
#

how are you powering the leds ?

civic tartan
#

@quick maple Currently directly off the 3.3v rail. This is just for testing purposes

quick maple
#

well

#

well theres your problem no wonder your board reset

#

It's not going to stop using 30 ish watts just for testing purpose out of a device that can supply like 2.5W and reset once it go past its limits

#

On the basic level there is 2 things you cant power from an MCU: motor/servos, lots of leds

civic tartan
#

So if I disconnect the LED's or power them from a separate supply (with connected grounds) the issue should stop happening?

quick maple
#

that is why there are separate shields for these to use another power supply because they uses a lot of voltage generally or a lot of watts

#

Unless you are using another led strip than you said but even then there are not really leds under 5mA @ 2V

#

what happens afaik is that the led get much less miliamps then they require and because of that they cant function normally

#

and then it probably cause the board to reset which cause everything connected to reset as well

#

and no afaik you cant share the ground current flow from the ground might be too much amps for the board too

civic tartan
#

I just disconnected the LED strip and tested and the board still resets to factory settings after blocking the IR sensor for 5-10 seconds

civic tartan
#

I have the console logs that show when this occurs.

#

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
AS: Analog Microphone (left channel only).
Ada

quick maple
#

Sounds like you'll need someone with more knowledge than me if the led strip wasnt the problem

#

hopefully they see your question soon 🙂

civic tartan
#

@quick maple Thank you!!!!

north stream
tardy zealot
#

Hello everyone, I'm currently facing a problem with my ESP32 and SN65HVD230 CAN bus communication. I have set up the ESP32 as the CAN transmitter, using the ESP32CAN library and the SN65HVD230 transceiver. The issue I'm experiencing is that while I am able to send CAN messages successfully, I can only send a few commands using ESP32CAN before my Arduino sketch stops outputting any further commands.

I am able to read CAN messages with this exact hardware configuration with no issues. I have verified the connections and ensured the correct bit rate configuration. I've also tested different CAN message IDs, but the problem persists. I would greatly appreciate any insights or suggestions to help resolve this issue. I'd be happy to provide code, wiring and other details upon request.

inner moon
#

do you have any other boards on the bus?

#

can requires an acknowledge bit that is implemented by other devices pulling the bus dominant during that bit

#

@tardy zealot

tardy zealot
modern seal
#

Trying to communicate to an ethernet module that uses a w5500 chip. I have it hooked to my wifi router and trying to send it data from my computer via Wi-Fi.. obviously wiring it straight to my laptop works but not this route. I assume that both router and module subnets need to match, yeah?

willow mortar
#

Hi, I am trying to power a servo motor with 5V using an ESP8266. From what I've found online I need to connect 5V into the servo from my power source, then short GND with the power source and the ESP, then just plug the digital pin into the ESP. I tried doing this and the ESP kept rebooting or the servo kept running in completely random patterns.

jade lichen
#

I'm trying to make a custom 4x2 macropad using the 5x6 Snap-apart mechanical key switch PCB. (https://www.adafruit.com/product/5157) I've attempted to use both the circuitpython and arduino code examples and and I don't feel like I'm getting anywhere. Help?

north stream
north stream
willow mortar
#

it works i guess?

jade lichen
north stream
#

You've adjusted ROWS, COLS, rowPins, and colPins in the code to correspond with your pins and layout?

jade lichen
#

Yes

#

Is there any example code that uses this hardware that's streamlined for use as a customizeable HID device? John Park's numpad is almost that but it seems to have a few abstraction layers for key assignments. And there's plenty of examples that use this as a MIDI interface, but I don't want that.

north stream
#

It looks like the code waits on .available() and prints out what it receives. Do you see any of that in the serial monitor?

jade lichen
#

I finally got some code working and it's generating output on the serial monitor. I had the wrong pin assignments for my COLS values

#

But I'm still struggling to get it working as a HID device

jade lichen
#

But when I press one of the key switches, it repeats the key until I reset the board.

north stream
#

That's irksome, but seems like a less-hard fix than getting HID working in the first place

jade lichen
#

I messed around with the LUTs to make it match my arrangement and it seemed to make the problem go away.

#

This code seems to be an excellent starting point for my project. I wish it was commented a little better so I know how to extend it without breaking stuff. Alas.

north stream
#

When I find code like that, I'll comment it myself as I figure it out (or imagine I am figuring it out). Sometimes I'll do a pull request with the comments.

rancid hamlet
#

Is this the right channel to ask about code for adafruit library (specifically the config in the MPR121 lib)?

leaden walrus
#

sure. for the arduino library.

rancid hamlet
#

Thanks. In the begin() function of the MPR121.cpp it has:

  writeRegister(MPR121_CONFIG2, 0x20); // 0.5uS encoding, 1ms period```
But that charge current doesn't line up with the documented charge for 1ms period polling here:
https://www.nxp.com/docs/en/application-note/AN3890.pdf
#

My goal is to have 1ms polling so I want to make sure I've got the config right.

fierce wyvern
#

Hey all - trying to use the 3v trinket with the arcade breakout, but can't seem to initialize i2c... can anyone help me trouble shoot

fierce wyvern
#

Code-wise I don't seem to be able to get past the begin() call for seesaw.

fierce wyvern
#

@charred salmon ```
void blink(int n) {
for (n; n > 0; n--) {
digitalWrite(1, HIGH);
delay(1000);
digitalWrite(1, LOW);
delay(1000);
}
}

void setup() {
pinMode(1, OUTPUT);

if (!ss.begin(DEFAULT_I2C_ADDR)) {
blink(3);

// while (1) delay(10);

} else {
blink(1);
}
}```

#

Blinks thrice... so no init.

charred salmon
#

That's a good sign that the code is running at least. Where and how are you declaring DEFAULT_I2C_ADDR?

fierce wyvern
#

Just as in the example :
#define DEFAULT_I2C_ADDR 0x3A

quick maple
#

have you confirmed yet with a serial println debug trace that 0x3A is indeed the correct adress ?

#

So we can at least eliminate that issue ?

fierce wyvern
#

The original trinket v3 deos not have serial.

#

Might try to switch to another board, I just wanted to make sure i wasn't doing something stupid.

quick maple
#

or a led that stays on ? 90% of the likehood of the problem is either not having the i2c correct adress or an issue with the pullups and you need to add ones until the scanner find an adress

charred salmon
#

I'd definitely try a different board if you can. Code wise, this looks like it should work judging by the data sheets.

fierce wyvern
#

The default I2C address is 0x3A. The other address options can be calculated by “adding” the A0/A1/A2/A3 to the base of 0x3A.

charred salmon
#

Which you presumably haven't done since it requires cutting traces

fierce wyvern
#

Yeah unless I need to daisy chain i2c, there's no point right?

charred salmon
#

Right. And even then, only if you want more of the same device.

quick maple
#

those pro trinkets seems very bad 🙄

#

reading the technical issues FAQ and it sounds like 8266 all kind of workaround around things that works perfectly fine on other boards

#

also the replacement bootloaderrs for it in 2015 uses serial.println but the technical faq says it doesnt have a serial port

#

so confusing

charred salmon
#

Everything I'm seeing says this should work. You definitely need some more feedback from the program. Initialization failed, but we don't know why. A different board won't tell us why it failed, but you can run better tests, like just blanket scanning the whole i2c address range and seeing if anything responds.

quick maple
#

could be useful to see the wiring at this point

#

just to make sure everything is connected right

charred salmon
#

You may also try disconnecting all the buttons and LEDs, just to rule out a fault there. While unlikely, also visually inspect the board, and check connections with a multimeter.

fierce wyvern
#

Okay, gonna try the feather 328p if i can figure out which programmer

#

Grrr... why is everything so difficult

#

I can't even get antthing uplaoded to this board

#

@charred salmon sorry to bither you - but any idea how to upload to the feather board? im struggling... i got one upload at some point but not again

charred salmon
#

Should be the same as other Arduino style boards.
Make sure you have the board library installed, pick the right board, the associated COM port, and upload.
What error are you getting?

fierce wyvern
#

Different errors for different selections

charred salmon
#

I'll try to help in a bit. Hands are full of ribs

fierce wyvern
#

Three ports exist

#

Haha nice - what style?

charred salmon
#

Texas dry

fierce wyvern
#

mehhhhhh 😄

mild elk
#

I made a simple IMU gamepad demo with RP2040 Connect and Adafruit TinyUSB library, and it works like a charm under Linux, but Windows refuses to read inputs from it (it's listed under "Devices and printers" as a gamepad). Is there some kind of magic trick required to get it working? A specific descriptor maybe?

charred salmon
#

Ok, belly is full of ribs, hands are full of keyboard.
The first problem I see is that you're on a Mac. I kid, I kid. Of those three, I'd wager the third one is the correct option. Unfortunately as I've only done Arduino on Windows, I don't know how port selection looks on Mac.

fierce wyvern
#

The 2nd one only showed up after the driver install

charred salmon
#

Ah, in that case it's probably the second one.

#

So what does the IDE give for an error? Board not found? Something else?

fierce wyvern
#

Current one is avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

#

If I hit reset on the board, I get ```
avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x00
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0xe0
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0xe0
Failed uploading: uploading error: exit status 1

charred salmon
#

Ok, for one thing it looks like the third entry in your serial port list is actually the correct one.

#

The protocol error messages are unfortunately just a generic error that crops up for any comms error during programming.

#

Additionally, I wonder if Adafruit uses their own bootloader on the ATmega328. Make sure you install and select Adafruit's version of that board and processor.

fierce wyvern
#

Grrrrrrrr I did. The code for this project is trivial.

charred salmon
#

Try doing an upload, and then while it's trying to do the initial sync, press the reset button.
Or double click the reset button and see if it goes into recovery mode.

fierce wyvern
#

nothin

#

I give up - this is freakin ridiculous

charred salmon
#

Wish I could help. It's definitely not supposed to be this hard.

fierce wyvern
#

I just never have any problems with native arduino boards.

#

I'm not 4 hours into like a 1 hr project. grr

#

At some point, I clearly got one upload - one of my serial outputs is spamming... but not updating.

#

I feel like I need a new bootloader

charred salmon
#

The challenge there being that you either need a programmer, or another (working) board to use as one.

fierce wyvern
#

I give up - I don't think there's a 3v board that will just work... how ridiculous

#

omg i got an upload - i had to hit the reset button a million times during upload

north stream
#

I suspect the usbserial one is the Feather

quick maple
mossy folio
#

I am having a strange issue with the SD Card on this adafruit product (https://www.adafruit.com/product/1947) using Arduino with an ESP32-S2 Metro.

After about 20 hrs, the SD card will stop working and I can no longer write to the file on the card. I tried a soft restart when the error occurs and the SD card would not initialize. However, if I just unplug and replug the device in, everything boots successfully and I can write to the file on the SD card again.

Has anyone seen this kind of error before?

north stream
#

That is a weird one. My first guesses are the controller in the card is running out of resources and giving up (maybe try a different card), or the Arduino is running out of resources (but depending on what you mean by "soft restart", that might reset it).

mossy folio
#

I am using this line of code to reset:
void(* resetFunc) (void) = 0;

I have other units that seem to go for days being fine and then randomly encounter the same error.

quick maple
#

looking for an adafruit sd card breakout that works with 5V/3.3V and is easy to use on an arduino

#

I have 8/16/32 and 64gb sd cards already would like to uses em if possible with it

#

seems that adafruit dont sell such a thing or it's flooding me with unrelated results and I missed it

#

so far only thing that seems to fit the bill is sparkfun DEV-13743 level-shifting microsd breakout

mossy folio
#

Well I would not recomend the one that I am using haha

north stream
edgy ibex
#

I seem to remember there's a terminal program (PuTTy / Serial Monitor) replacement that can auto-reopen com ports that momentarily vanish when you reset an Arduino type microcontroller. I just can't remember which one it is for the life of me.

safe shell
#

maybe tio

edgy ibex
#

That's starting to look about right.

charred salmon
#

So this is just a kind of informational question about what's going into the binary when I compile for two different targets. The program in this case is the basic blink sketch.
When compiled for the bare ATTiny85 it comes out to 676 bytes.
When I compile for the Trinket M0 it balloons out to 10016 bytes.
Just... What on earth is taking up an extra 9kB of program space?

north stream
#

You could look at the symbols in the executable to see what's there. My first guess is a library to support the Serial functions and translate them to USB transactions.

#

Give me a couple of minutes, I'll fire up Arduino and give it a go

charred salmon
#

I could see that, though I guess it's just adding them by default since blink doesn't use serial.

north stream
#

Wow, the link line is impressive: /Users/spam/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-g++ -L/var/folders/b6/60c379ms33d35cjmh5d612nr0000gn/T/arduino_build_200709 -Os -Wl,--gc-sections -save-temps -T/Users/spam/Library/Arduino15/packages/adafruit/hardware/samd/1.6.5/variants/trinket_m0/linker_scripts/gcc/flash_with_bootloader.ld -Wl,-Map,/var/folders/b6/60c379ms33d35cjmh5d612nr0000gn/T/arduino_build_200709/Blink.ino.map --specs=nano.specs --specs=nosys.specs -mcpu=cortex-m0plus -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -o /var/folders/b6/60c379ms33d35cjmh5d612nr0000gn/T/arduino_build_200709/Blink.ino.elf /var/folders/b6/60c379ms33d35cjmh5d612nr0000gn/T/arduino_build_200709/sketch/Blink.ino.cpp.o /var/folders/b6/60c379ms33d35cjmh5d612nr0000gn/T/arduino_build_200709/core/variant.cpp.o -Wl,--start-group -L/Users/spam/Library/Arduino15/packages/adafruit/tools/CMSIS/5.4.0/CMSIS/Lib/GCC/ -larm_cortexM0l_math -L/Users/spam/Library/Arduino15/packages/adafruit/hardware/samd/1.6.5/variants/trinket_m0 -lm /var/folders/b6/60c379ms33d35cjmh5d612nr0000gn/T/arduino_build_200709/core/core.a -Wl,--end-group

charred salmon
#

Well, at a minimum looks like it's including both the bootloader and a math library.

north stream
#

variant.cpp.o has 660 text and 28 data, it's probably not the culprit

#

The math library is pretty big, it it looks like the loader doesn't haul all of it in

charred salmon
#

I'm surprised it brings any of it in, but I suppose it's needed for something not directly in the sketch.

north stream
#

I ended up running /Users/spam/Library/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-nm -S /var/folders/b6/60c379ms33d35cjmh5d612nr0000gn/T/arduino_build_200709/Blink.ino.elf to give the sizes of all the bits that are actually included in the executable

#

I think it would be rude to paste all 262 lines of it here, but there is not only a Serial module (even though it's not used), but a Serial1 module, along with dozens of things like _ZN6SERCOM8initUARTE14SercomUartMode20SercomUartSampleRatem that are presumably concerned with USB over serial.

#

Amusingly, if I set the USB stack to "TinyUSB" instead of "Arduino" it grows to 15392 bytes: hardly "tiny"!

charred salmon
#

Well, I was just curious.
Also it dawned on me that before I get too far into this project, I should probably check to see if the NeoPixel library will fit on the Tiny.
Good news, the RGBW strand test compiles down to 4404 bytes!
And it has a sanity check that enforces a minimum clock speed.

#

I mean, 4404 bytes is over 50% of the program space, but I don't think I'll manage to fill the rest of it.

north stream
#

I managed to cram Crickit support into an ATtiny85 with 2 bytes left over once.

#

I remembered the Teensy targets give a choice of USB support, so I gave it a try with Blink. With USB Serial enabled, it's 3044 bytes (not bad, especially compared to the M0). With USB support turned off, it's 1588 bytes. The 32-bit CPUs will tend to take up more storage with their 4-byte instructions (unless they're using Thumb mode) than the 8-bit CPUs.

charred salmon
#

So it's definitely sounding like it's the serial library.

grand crater
#

anyone use Adafruit_SPIFlash with a Feather RP2040? I cant figure out how to get it to work. I literally only want to save one array to the flash so it can be loaded back into memory when the program is restarted

#

i do have the size of the flash correctly configured and i am able to read the size too

#

guessing i need to use these to read

muted gyro
grand crater
#

i think you're correct about Adafruit SPI flash, also god send for the pico core documentation ill read over that

grand crater
#

ok so when i try and do LittleFS.begin() it comes back false any idea why it could be failing to mount?

#

@muted gyro

#

wait nvm for some reason the flash size defaulted back to none?

grand crater
#

any idea why the application would be crashing?

#

just gets to the print save then boom whole Feather RP2040 just crashes as soon as little file system trys to do anything

#

same result

#

changed flash size to 64kb

#

seems like a ram thing would be my guess

#

i am using the dvi version and im already driving this

grand crater
#

Not a single person lol I'll just try using the simulated eproom then lol

quick maple
#

Lack infos for me and it serves no purpose to take low-probability wild guesses

grand crater
#

That's true, I'll mess around with eproom since it's the easier more straight forward method for what I need at the moment. I'll touch back on little filesystem at a later time if I need it

muted gyro
#

Are you doing multi-core stuff? Or doing anything that prevents the other core (that isn't saving the file) from stopping for a bit?
You're writing to the same flash that also holds your program. The flash can't be read while it's writing. So, while writing the file, other core gets paused. If that pausing process fails, it locks up @grand crater Same limitation applies to the simulated eeprom

grand crater
#

I am the Feather RP2040 dvi uses 1 core for video rendering

#

the other core is for you to use

muted gyro
#

Are you using the latest version of the core? 3.3.0 got released about 2 days ago and contains some bug fix

#

adjustments to linker script to place certain code in RAM, required for PicoDVI library when used in combination with flash-writing code (e.g. filesystem).

#

I don't understand what it's actually fixing and how but it sounds like it could maybe be your issue

grand crater
#

yes i updated yesterday went you sent me the documentation

muted gyro
#

hmmm then I really don't know

grand crater
#

im going to try and end the display and restart it

#

i cannont find the function to call to end it

#

the adafruit spi flash library does it tho

#

boom

#

maybe

grand crater
#

no dice

#

at least not like this

grand crater
#

lmao this kinda worked, but it bunked the display output

quick maple
#

would it not be easier to upload the code instead ? (upload not copy paste)

grand crater
#

i was but i forgot how to do the cpp code block syntax

muted gyro
# grand crater

I think idleothercore and resumeothercore are automatically done when flash is written.
In fact if you manually idled the core, then this happens:

  1. you idleothercore()
  2. you try to write to flash. The write automatically does idleothercore()
  3. the other core doesn't respond to the command from 2 because it's already idled.
  4. Everything is stuck
muted gyro
grand crater
#

clearly little fs isnt doing idleothercore

muted gyro
grand crater
#

lemme check this

#
if (digitalRead(7) == LOW) {
    Serial.println("boot button pressed attempting to open MaxForces.txt");
    File arrayFile = LittleFS.open("/MaxForces.txt", "w");
    Serial.println("MaxForces.txt has been opened");
    arrayFile.close();
    Serial.println("MaxForces.txt has been closed");
    delay(3000);  // Add a delay to avoid repeated calls while the button is pressed
    Serial.println("3000 delay done");
  }
#

it openes the file but crashes on close or something

#

anyway i can get any more info out of this? like exit status?

#

uh am i dumb do i need to configure the file system

#
if (digitalRead(7) == LOW) {
    Serial.println("boot button pressed attempting to save max g forces");
    for (int i = 0; i < lengthOfgMaxVaules; i++) {
      maxGDataFloatBuffer[i] = gMaxVaules[i].force;
    }
    Serial.println("array created");
    EEPROM.put(0, maxGDataFloatBuffer);
    Serial.println("EEPROM.put");
    EEPROM.commit();
    Serial.println("EEPROM.commit");
    delay(3000);  // Add a delay to avoid repeated calls while the button is pressed
    Serial.println("3000 delay done");
  }
#

this almost worked

#

the display did not come back on though

#

i still need to check if it actually saved anything though

#

yep its acually saving and working just not quite working

#
if (digitalRead(7) == LOW) {
    Serial.println("boot button pressed attempting to save max g forces");
    for (int i = 0; i < lengthOfgMaxVaules; i++) {
      maxGDataFloatBuffer[i] = gMaxVaules[i].force;
    }
    Serial.println("array created");
    EEPROM.put(0, maxGDataFloatBuffer);
    Serial.println("EEPROM.put");
    EEPROM.commit();
    Serial.println("EEPROM.commit");
    delay(1000);  // Add a delay to avoid repeated calls while the button is pressed
    Serial.println("delay");
    watchdog_enable(1, 1);
    while(1);
    Serial.println("this sholuld never print");
  }

#

its failing to properly reboot for some reason

#

rp2040.reboot() has the same effect

#

replaced with rp2040.wdt_begin(0); and it reboots now

muted gyro
#

I don't what else you're doing or what your end goal is. But to me, rebooting everything every time you write to flash seems more like a workaround than a solution

#

I suggest you try to make your sketch as minimal as possible while reproducing the problem. Then your chance of finding the problem are highest. It could be that you actually run into a bug with the arduino-core or a library. But you only know that if your own code is as short as possible

grand crater
#

hmmmm

#

ok bet

grand crater
#
#include <PicoDVI.h>
#include <EEPROM.h>
DVIGFX8 display(DVI_RES_320x240p60, true, adafruit_feather_dvi_cfg);
void setup() {             // Runs once on startup
  Serial.begin(9600);
  while (!Serial)
    delay(10);  // Wait for Serial Monitor to open
  Serial.println("Serial started");

  pinMode(7, INPUT);

  EEPROM.begin(4096);
  Serial.println("EEPROM started");

  if (!display.begin()) {  // Blink LED if insufficient RAM
    pinMode(LED_BUILTIN, OUTPUT);
    for (;;) digitalWrite(LED_BUILTIN, (millis() / 1000) & 1);
  }
  Serial.println("display started");

  display.setColor(0, 0x0000);  // Color 0: Black
  display.setColor(1, 0xFFFF);  // Color 1: White
  display.setTextColor(1);
  display.setCursor(3, 3);
  display.setFont();
}

void loop() {
  display.fillScreen(0);
  display.setTextColor(1);
  display.setCursor(3, 3);
  display.setFont();
  display.println(String(millis()));
  if (digitalRead(7) == LOW) {
    Serial.println("boot button pressed attempting to save max g forces");
    bool programState;
    EEPROM.put(0, true);
    Serial.println("EEPROM.put");
    EEPROM.commit();
    Serial.println("EEPROM.commit");
    EEPROM.get(0, programState);
    Serial.println("EEPROM.get: " + String(programState));
    Serial.println(programState);


    EEPROM.put(0, false);
    Serial.println("EEPROM.put");
    EEPROM.commit();
    Serial.println("EEPROM.commit");
    EEPROM.get(0, programState);
    Serial.println("EEPROM.get: " + String(programState));
    Serial.println(programState);
    delay(5000);
  }
  display.swap(false, true);
  delay(1000 / 60);
}
#

CONSOLE

boot button pressed attempting to save max g forces
EEPROM.put
EEPROM.commit
EEPROM.get: 1
1
EEPROM.put
EEPROM.commit
EEPROM.get: 0
0
#

afterwards PicoDVI stops producing video

#

before hand millis() is correctly displaying in the top left corner

#

wait a hot minute

#

yeah wow this is odd

#
#include <PicoDVI.h>
#include <EEPROM.h>
DVIGFX8 display(DVI_RES_320x240p60, true, adafruit_feather_dvi_cfg);
void setup() {  // Runs once on startup
  Serial.begin(9600);
  while (!Serial)
    delay(10);  // Wait for Serial Monitor to open
  Serial.println("Serial started");

  pinMode(7, INPUT);

  EEPROM.begin(4096);
  Serial.println("EEPROM started");

  if (!display.begin()) {  // Blink LED if insufficient RAM
    pinMode(LED_BUILTIN, OUTPUT);
    for (;;) digitalWrite(LED_BUILTIN, (millis() / 1000) & 1);
  }
  Serial.println("display started");

  display.setColor(0, 0x0000);  // Color 0: Black
  display.setColor(1, 0xFFFF);  // Color 1: White
  display.setTextColor(1);
  display.setCursor(3, 3);
  display.setFont();
}

void loop() {
  display.fillScreen(0);
  display.setTextColor(1);
  display.setCursor(3, 3);
  display.setFont();
  display.println(String(millis()));
  if (digitalRead(7) == LOW) {
    Serial.println("boot button pressed attempting to save max g forces");
    bool programState;

    EEPROM.put(0, true);
    Serial.println("EEPROM.put");
    EEPROM.commit();
    Serial.println("EEPROM.commit");
    EEPROM.get(0, programState);
    Serial.println("EEPROM.get: " + String(programState));


    EEPROM.put(0, false);
    Serial.println("EEPROM.put");
    EEPROM.commit();
    Serial.println("EEPROM.commit");
    EEPROM.get(0, programState);
    Serial.println("EEPROM.get: " + String(programState));
    delay(5000);
    Serial.println("delay 5000 over");
  }
  display.swap(false, true);
  Serial.println(String(millis()));
  delay(1000 / 1);
}

CONSOLE

Serial started
EEPROM started
display started
4363
5380
6397
7413
boot button pressed attempting to save max g forces
EEPROM.put
EEPROM.commit
EEPROM.get: 1
#

this one stopped here

3129
boot button pressed attempting to save max g forces
EEPROM.put
#

so who am I supposed to go to now

north stream
#

It could be a buffering issue. Sometimes I'll put a Serial.flush() after my prints to make sure the print happens before the code continues.

grand crater
#

Serial.flush() after every print?

#

new code:

#include <PicoDVI.h>
#include <EEPROM.h>
DVIGFX8 display(DVI_RES_320x240p60, true, adafruit_feather_dvi_cfg);
void setup() {  // Runs once on startup
  Serial.begin(9600);
  while (!Serial)
    delay(10);  // Wait for Serial Monitor to open
  Serial.println("Serial started");

  EEPROM.begin(4096);
  Serial.println("EEPROM started");

  if (!display.begin()) {  // Blink LED if insufficient RAM
    pinMode(LED_BUILTIN, OUTPUT);
    for (;;) digitalWrite(LED_BUILTIN, (millis() / 1000) & 1);
  }
  Serial.println("display started");

  display.setColor(0, 0x0000);  // Color 0: Black
  display.setColor(1, 0xFFFF);  // Color 1: White
  display.setTextColor(1);
  display.setCursor(3, 3);
  display.setFont();
  Serial.flush();
}

void loop() {
  display.fillScreen(0);
  display.setTextColor(1);
  display.setCursor(3, 3);
  display.setFont();
  display.println(String(millis()));
  Serial.println(String(millis()));
  Serial.flush();
  bool programState;

  EEPROM.put(0, true);
  Serial.println("EEPROM.put");
  Serial.flush();

  EEPROM.commit();
  Serial.println("EEPROM.commit");
  Serial.flush();

  EEPROM.get(0, programState);
  Serial.println("EEPROM.get: " + String(programState));
  Serial.flush();


  EEPROM.put(0, false);
  Serial.println("EEPROM.put");
  Serial.flush();

  EEPROM.commit();
  Serial.println("EEPROM.commit");
  Serial.flush();

  EEPROM.get(0, programState);
  Serial.println("EEPROM.get: " + String(programState));
  Serial.flush();

  delay(5000);
  Serial.println("delay 5000 over");
  Serial.flush();

  display.swap(false, true);
  delay(1000 / 1);
}
#

console output

Serial started
EEPROM started
display started
4867
EEPROM.put
#
Serial started
EEPROM started
display started
1386
EEPROM.put
EEPROM.commit
EEPROM.get: 1
#
Serial started
EEPROM started
display started
1946
EEPROM.put
EEPROM.commit
EEPROM.get: 1
EEPROM.put
EEPROM.commit
EEPROM.get: 0
delay 5000 over
#
Serial started
EEPROM started
display started
1056
EEPROM.put
grand crater
#

what i find interesting is that it will occasionally do both eeprom commits and get all the way to the delay but no matter what after the first EEPROM commit dvi output gets killed

#

deleting the pico dvi library off my pc and reinstalling it did not fix the problem

#

i think i remember reading that the cpu can outpace flashe read and cause problems

#

changing this from 2 to 4 did not fix the problem

#

im going to try little fs again

#

yeah this just locks up like it was before

#
#include <PicoDVI.h>
#include <LittleFS.h>
DVIGFX8 display(DVI_RES_320x240p60, true, adafruit_feather_dvi_cfg);
void setup() {  // Runs once on startup
  Serial.begin(9600);
  while (!Serial)
    delay(10);  // Wait for Serial Monitor to open
  Serial.println("Serial started");

  LittleFSConfig cfg;
  cfg.setAutoFormat(true);
  LittleFS.setConfig(cfg);
  LittleFS.begin();
  Serial.println("LittleFS started");

  if (!display.begin()) {  // Blink LED if insufficient RAM
    pinMode(LED_BUILTIN, OUTPUT);
    for (;;) digitalWrite(LED_BUILTIN, (millis() / 1000) & 1);
  }
  Serial.println("display started");

  display.setColor(0, 0x0000);  // Color 0: Black
  display.setColor(1, 0xFFFF);  // Color 1: White
  display.setTextColor(1);
  display.setCursor(3, 3);
  display.setFont();
  Serial.flush();
}

void loop() {
  display.fillScreen(0);
  display.setTextColor(1);
  display.setCursor(3, 3);
  display.setFont();
  display.println(String(millis()));
  Serial.println(String(millis()));
  Serial.flush();

  delay(5000);
  Serial.println("delay(5000);");
  Serial.flush();



  File testFile = LittleFS.open("/Test.txt", "w");
  Serial.println("LittleFS.open");
  Serial.flush();

  testFile.close();
  Serial.println("testFile.close()");
  Serial.flush();

  delay(5000);
  Serial.println("delay(5000);");
  Serial.flush();

  display.swap(false, true);
  Serial.println("display.swap");
  Serial.flush();
}
#

its picodvi

#
#include <LittleFS.h>

void setup() {  // Runs once on startup
  Serial.begin(9600);
  while (!Serial)
    delay(10);  // Wait for Serial Monitor to open
  Serial.println("Serial started");

  LittleFSConfig cfg;
  cfg.setAutoFormat(true);
  LittleFS.setConfig(cfg);
  if (!LittleFS.begin()) {  // Blink LED if insufficient RAM
    Serial.println("LittleFS failed to start");
  }else
  {
    Serial.println("LittleFS started");
  }


  Serial.flush();
}

void loop() {
  Serial.println(String(millis()));
  Serial.flush();

  delay(5000);
  Serial.println("delay(5000);");
  Serial.flush();



  File testFile = LittleFS.open("/Test.txt", "w");
  Serial.println("LittleFS.open");
  Serial.flush();

  testFile.close();
  Serial.println("testFile.close()");
  Serial.flush();

  delay(5000);
  Serial.println("delay(5000);");
  Serial.flush();


}

console

delay(5000);
LittleFS.open
testFile.close()
delay(5000);
23260
delay(5000);
LittleFS.open
testFile.close()
delay(5000);
33270
delay(5000);
LittleFS.open
testFile.close()
delay(5000);
43280
#

ect ect it keeps looping like it should

#

kinda new to this whole wow the problem wasn't my code its the library thing

muted gyro
grand crater
muted gyro
#

hmmm sorry I don't know further :/

grand crater
north stream
#

If I remember right, PicoDVI overclocks the RP2040 to get the timing right. It's possible that just doesn't work on certain chips.

grand crater
#

What even is an auto fisic reset.

#

I can't find anything online about fisic

#

Maybe typo?

north stream
#

I had been thinking maybe a timer conflict, but that issue refers to a DMA channel conflict, which could also cause behavior like that.

sour tide
#

You have to ensure that all of the code that PicoDVI uses is in RAM. Otherwise loading the code will conflict with the flash operation.

grand crater
#

How can I ensure that?

sour tide
#

It is tricky. The linker script can be changed to place functions in RAM or they can be annotated in the source so that they have a different section name.

grand crater
#

Where do i find examples or documentation of doing such a thing on these rp2040, i found some info for doing it on the esp32 but not rp2040

sour tide
#

I'm not sure. I've only done it in CP

vivid niche
#

any recommendations on methods/hw/etc that can have two(or more) boards that can kinda roughly tell if they're close to each other - example being if i had two and i bring them together make an led brighter, was thinking ble but figured i'd ask

cedar mountain
vivid niche
#

do those need los?

cedar mountain
#

Mostly, yeah.

#

The more pro-level solution would be a Decawave UWB radio.

vivid niche
#

This is more for 'kinda fun' not really precise, but ideally not LoS

cedar mountain
#

You might consider like coil-to-coil near-field inductive coupling?

vivid niche
#

i don't mind paying for a decent solution though if it's easy to implement

north stream
vivid niche
#

well this purpose is for like little 'rave lights' for friends but if we bring them together like captain planet style they all turn a specific color/go full brightness(i just like to do fun tinker things)

#

not the exact use case but best way i can describe it

vital lodge
#

Hello! I have a question of feasibility. I don't have enough knowledge to solve this problem: I have a project that I'm following instructions for. It has a panel of controls, but I've decided to make those controls remote. I've been content until now to make the controller wired, but I'm starting to not like the look of a wire coming out the back of this thing. is there a low cost solution to making this wireless that doesn't involve a big learning curve on setting up?

Here's the current schematic: https://content.instructables.com/FTR/15TK/KQ57CBJP/FTR15TKKQ57CBJP.jpg?auto=webp&frame=1&width=1024&height=1024&fit=bounds&md=515041fb08e7b28cc0b3bd71b7ed1e31

Here's the instructions: https://www.instructables.com/Easily-Build-a-MACHINE-THAT-DESTROYS-WHAT-IT-CREAT/

Appreciate any feedback!

Instructables

Easily Build a MACHINE THAT DESTROYS WHAT IT CREATES - Kinetic Sand Art Table: I’m going to show you exactly how you can easily make your own super cool automated kinetic sand art table step-by-step. Including smart LED lighting.
It is incredibly captivating to be beside this simple DIY wooden table as the steel ball magical…

proven ruin
#

Hi, all! I’m trying to automate data acquisition for a little chemistry setup. I want to monitor air pressure using the BMP280, which Adafruit has a library for (link). Thing is, the library doesn't work for ESP32 and ESP8266 (in PlatformIO).
First, there is the build problem that I must add the following libraries to lib_deps:
https://github.com/adafruit/Adafruit_BusIO
https://github.com/adafruit/Adafruit_Sensor
However, the Adafruit_BusIO library then causes the build to fail for the following reason:
#include <SPI.h>
^~~~~~~
compilation terminated.
*** [.pio\build\d1_mini\lib90c\Adafruit BMP280 Library\Adafruit_BMP280.cpp.o] Error 1
I'm a novice. Is there any way to fix this quickly in my case? I’ve already filed an issue on the Adafruit_BMP280 library GitHub page.
A big thank you in advance to any helpful wizards out there!

#

For an Atmel AVR board, including Adafruit_BusIO and/or Adafruit_Sensor should fix the issue.

north stream
# vital lodge Hello! I have a question of feasibility. I don't have enough knowledge to solve ...

The basic idea is you have a transmitter and a receiver. There are several choices for these, with various capabilities of speed/distance, but I'm guessing any of them would work for your use case. I might opt for something like one of the RFM69 boards AdaFruit offers. It is going to involve some programming to read the switches, package up the values, and transmit them (on one end), and receive the data, unpack it, and do with it what the controls would have done (on the other end).

dusk orchid
# vivid niche well this purpose is for like little 'rave lights' for friends but if we bring t...

You set my mind racing, so madbodger is totally right, UltraWideBand is the way to go, but these days bluetooth also has directionality (possible at least) and rssi strength, along with wifi having TimeOfFlight information if the routers/devices support it [ESP32-s2/s3 look up FTM/ToF - seems like each player would need to be an access point and also scanner (to detect the time to other access points) which may require two devices.] I'd have thought a strong RSSI for bluetooth / wifi would indicate being caught although it wouldn't facilitate Tag, more like hide and seek or the captain planet routine.
This is the demo ToF esp32-s2 project https://github.com/espressif/arduino-esp32/tree/master/libraries/WiFi/examples/FTM/FTM_Initiator

GitHub

Arduino core for the ESP32. Contribute to espressif/arduino-esp32 development by creating an account on GitHub.

vivid niche
#

guess i'll need to just get some esp32 like i planned and tinker

quick maple
#

having some connecting issues with my arduino mega 2560 board it's being mean to me 😦

#

Seems like the reason is because my mega 2560 is on the usb extender stick but I dont really have the choice since I only have 2 usb ports available (usb 2.0 stick, usb 3.0 port)

#

my grand central express on the same setup when on (and the 2560 off) shows me the boot partition and doesnt seem to mind

lethal yarrow
#

You likely need to buy a powered hub. I recommend StarTech.com.

quick maple
#

it can get the board info though

#

Im not sure a powered hub will fix this if the arduino ide dont know how to route on an usb stick

#

I was able to upload like twice out of 12-15 tries

lethal yarrow
#

That can be caused by power issues. Do you have anything else connected to either of those boards?

quick maple
#

on the arduino I had my ir receiver which is about 5ma, sd card reader usb key and keyboard wireless dongle

#

This seems like this is what happening so Im not question that. I just want to make sure there is a high probability it has that and not some sort of issue the issue has with usb sticks/extenders where it cant write to invidual usb ports on it or something

#

or it needs one it supports etc

lethal yarrow
#

SD cards can draw quite a bit while writing. Wireless anything tends to consume a notable amount of power as well.

#

If you try plugging the mega in directly does it program without issues?

quick maple
#

sd card was iddle not doing anything. . adafruit grand central also connected but the only ones on are the ones I listed (each of my usb port on the stick have a switch to power them in/off)

#

let me try the blinky too

#

yeah seems fine with the sdcard reader off. Both uploaded immediatly and serial port works

#

I had to keep the dongle otherwise I cant type here

pallid grail
#

@leaden walrus Are you pretend-idle or for-real-idle?

#

For real, it appears.

#

@north stream Are you around?

leaden walrus
#

@pallid grail wazzup?

north stream
#

I'm around?

#

Getting ready to make dinner, though

pallid grail
# leaden walrus <@330227457296957440> wazzup?

@north stream I talked to Dan. We figured out it's a hardware issue that can be resolved in code, but I have to find out what Limor wants me to do because there are a number of solutions. Also two pins are swapped on the schematic, and I don't know what she wants to do there either. Sigh.

#

As in there are a set of pin numbers related to the firmware, and those are swapped. Not that the physical pins are swapped.

#

Anyway. Thanks for replying.

leaden walrus
#

is there still a question? or is it figured out?

grizzled oak
#

using a bit of a modified verison of the gps software serial parsing example, so it prints the antenna status either way. the gps im using is w the ultimate gps, and i've attatched an external antenna. the problem is that im not geting any fix, and the antenna status is 0. what is happening?

grizzled oak
#

the code provided written in circuitpython works perfectly fine, but in arduino it does not work

north stream
#

That's really weird. Most of the things that could go wrong would break it with CircuitPython too, which leaves initialization or library-specific peculiarities.

pallid grail
# leaden walrus is there still a question? or is it figured out?

At the time, figured out. Also, correction, turns out it's not that the seesaw firmware pins are swapped, it's that the joystick is oriented differently on this breakout, so that X and Y axes are "swapped". So the issue on the schematic is that references to X and Y should be swapped, not that the seesaw firmware pins are wrong,

I do have a question now though. 😄

#

Should be an easy one, I bet. I know exactly what I'd do in CircuitPython. But I don't quite know how to do it in Arduino.

leaden walrus
#

with lots of {} and ;s

pallid grail
#

Haha

#

Also call show()

leaden walrus
#

show(); see...gotta have that ;

pallid grail
#

Ok, so, due to the orientation of the joystick on this board, the range of analog values is "backwards", i.e. if I push the joystick along the x-axis to the right, it hits 0, and if I push it along the x-axis to the left, it hits 1023 (max). This needs to be resolved in the code (the related section of which is below). I know I need to do 1023 - x somewhere to make the printed value be correct. But it seems not quite right to do it only in the print statement. Or maybe that is completely correct, and I'm overthinking it.

int last_x = 0, last_y = 0;

void loop() {
  delay(10); // delay in loop to slow serial output
  
  int x = ss.analogRead(14);
  int y = ss.analogRead(15);
  
  if ( (abs(x - last_x) > 3)  ||  (abs(y - last_y) > 3)) {
    Serial.print("x: "); Serial.print(x); Serial.print(", "); Serial.print("y: "); Serial.println(y);
    last_x = x;
    last_y = y;
  }
leaden walrus
#

int x = 1024 - ss.analogRead(14);

pallid grail
#

A ha!!

#

I knew it needed to be somewhere more fundamental.

#

Thank you!

leaden walrus
#

sure. np. probably other options.

pallid grail
#

Otherwise it wouldn't be obvious how to use it for other things. If it was in the print only,

leaden walrus
#

but general idea is to remap the behavior early on to what you want, and then the follow on code is what you want for that behavior

pallid grail
#

So, it never hit 1024. Which means now it's not hitting 0. Does that matter?

leaden walrus
#

oh. sry. maybe off by one. yah make it 1023 or whatever.

pallid grail
#

Ahhh right

#

Starts at 0

#

1024 values is 1023 max.

leaden walrus
#

yep

pallid grail
#

Perfect. Thank you so much!

#

I can call this done, and do it up in CP now. (Limor already had the Arduino so I started there, but that left me awkwardly troubleshooting this whole thing, heh.)

leaden walrus
#

"altering joystick behavior to desired orientation is left as a homework assignment "

pallid grail
#

The joystick is physically rotated on the breakout so what she usually calls "x" is physically Y and what she usually calls "y" is physically X.

#

So the schematic is misleading as it is.

#

Also the Pinouts page, if I match the schematic and not the code.

#

So I'm a little 😕 about this one for now.

leaden walrus
#

which pid?

pallid grail
#

5743

#

Dan and I did a deep dive into this last night, heh.

leaden walrus
#

there's no actual silk label for the joystick?

pallid grail
#

Nope

leaden walrus
#

you're working on guide?

pallid grail
#

Yep

#

Limor seemed busy today. I brought it up when I checked in (incorrectly, but mentioned the schematic nonetheless), and she didn't reply to that part. Only a question about the demo code. So, my plan is to continue through the guide, and when it's done, talk to her about the schematic.

#

I can make notes in the guide about it, but .... it should really be fixed in the schematic.

leaden walrus
#

could write it terms of "left/right" and "up/down"?

pallid grail
#

Well, the seesaw pins you need to use for x and y do not match the schematic.

#

So... do I swap them on the Pinouts page and then make a note on the schematic on the Downloads page? Or do I add warnings above all the demos saying "X and Y pins are swapped" or....?

#

Because anyone looking at Pinouts or schematic will be confused.

#

This Arduino demo is how it should be.

#

CP will be too.

leaden walrus
#

how were you going to define X and Y? (since there's no silk)

pallid grail
#

x is horizontal, y is vertical. A standard cartesian plane. Or, more importantly, a standard game controller.

#

That isn't really optional.

#

Or up for debate, I guess I mean.

#

And on the joystick the pins on the vertical mid-line affect the vertical axis, and the pins on the horizontal mid-line control the horizontal axis. It's not like the joystick knows the difference.

#

So it's all about naming.

leaden walrus
#

yah. it's basically just two pots 90 deg apart.

pallid grail
#

Right

leaden walrus
#

pots setup as voltage divider read into ADC

#

what "X" and "Y" are can be up to user

pallid grail
#

I mean... yeah. But what X and Y are "physically" is standard across math and gaming.

#

So however the joystick ends up, x is across, y is down.

#

In this case, they're simply named opposite.

leaden walrus
#

lemme look at schematic

pallid grail
#

Which I'm sure was carryover from the last board that was designed with it, or some such. But in that case, the joystick was probably oriented 90 degrees off from this one. (Joy FeatherWing for example.)

pallid grail
leaden walrus
#

rev A?

pallid grail
#

Yeah. That's the only one.

leaden walrus
#

that's what you're calling X and Y?

pallid grail
#

Correct

leaden walrus
#

schematic looks OK to me? if the pot pins are what i'd expect

pallid grail
#

It's not.

leaden walrus
#

joystick pins

pallid grail
#

Right.

#

I have to swap the seesaw firmware pins (shown in the schematic) to make it work right in code.

#

They're not right.

leaden walrus
#

would have to open datasheet for the joystick to verify. but its pinouts are actually like that?

pallid grail
#

Yes. There are no x-specific or y-specific pins. That's what I meant when I said the joystick doesn't know the difference. It all depends on how you rotate it. Whatever pins are on either side are X, and top or bottom will be Y.

leaden walrus
#

do you know if that's a PID 2765 joystick?

pallid grail
#

99% sure, yes.

leaden walrus
#

meh. only has a diagram. not real data sheet.

#

i guess it's a minor net name issue in the schematic

pallid grail
#

Yes.

#

That was my point 🙂

leaden walrus
#
  int x = ss.analogRead(14);
  int y = ss.analogRead(15);
pallid grail
#

Yep.

leaden walrus
#

and then also a sign swap

pallid grail
#

Exactly.

leaden walrus
#

should be ok in guides to use the 14 and 15 names and say like 14 is X and 15 is Y

#

and schematic is what is

pallid grail
#

Ok. I'm still going to ask about updating it when I'm through the rest of this. 😄

#

But fair enough.

leaden walrus
#

yah, it's just a label on the schematic. and without actually scoping the joystick to figure out exact pins, i would have guessed the same

#

and it can all be remapped in software

pallid grail
#

I know.

#

But someone is going to complain 😂

#

I try to do my best to mitigate that where I can.

leaden walrus
#

yep. i think hopefully minor. users just need to know its pin 14 for X and 15 for Y.

#

can add a little warn text or something to note the name diff on the schematic

pallid grail
#

Yeah.

quick maple
#

needs 2mm high and 10mm large LCD so you can change the X/Y lettering on the board

bitter galleon
#

I am working on a project using an Arduino Micro and a 16x2 lcd with an Adafruit I2C backpack. I am also using Platform IO and VS Code to write the code. When upload the project and use the console, everything works while connected to the PC and console. When I change over to using a wall wart for power connected to the USB on the Micro, the LCD screen is dark, no backlight. When I plug it back into the PC, the screen is dark until I reconnect with the console. I'm not sure how to troubleshoot this. Any ideas?

river kettle
#

Without supplying your schematic there is not much of a way of knowing how to help.

bitter galleon
#

I figured out the issue. It ended up being a code issue. In the setup I had a while loop to wait for Serial before printing output to the console. When not connected to the console, it was blocking execution of the rest of the code.

north stream
#

I've been bitten by that one before too

pallid grail
#

@leaden walrus Does it make sense to submit the example for the Gamepad QT to the Adafruit_Seesaw library? I added one to the CP lib. I don't know how it works with Arduino libs.

#

Which is to say do you only add specific examples, or ..?

leaden walrus
pallid grail
#

Yep I'm there already. Simply wasn't sure how it worked.

#

Ok. Thanks.

#

Does it need to be bumped at that point?

leaden walrus
#

it would for the examples to get published

#

so they could be opened through the arduino ide

pallid grail
#

Oh right.

#

Can I tag you on the PR and then have you bump it?

leaden walrus
#

sure. eva also does regular sweeps to update arduino libs.

pallid grail
#

I'm in the guide, so having it in the IDE ASAP would be idea. I think she does sweeps weekly.

leaden walrus
#

ok, yep. it's easy to bump. can ping me.

pallid grail
#

@leaden walrus Wait, is SPDX not set up on this library?

#

So not used to contributing to Arduino libs.

leaden walrus
#

that's just a licensing thing? i don't think the arduino libs are using that.

pallid grail
#

Ok, yeah it's licensing.

#

Obvs it needs to do all the testing or whatnot.

leaden walrus
#

@pallid grail you tested example? PID 5743 firmware doesn't appear to be in repo. so assuming i2c address is actually 0x50, etc.?

pallid grail
#

I didn't know it needed to be added to the lib.

#

CP flat out didn't work.

leaden walrus
pallid grail
#

Oh.

leaden walrus
#

like what's running on the seesaw chip itself

pallid grail
#

Oh right.

#

LImor gave me this code and told me to clean it up, so I did. That's where it came from.

leaden walrus
#

just for use in comparison to your PR (since don't have actual hw)

pallid grail
#

Fair enough.

leaden walrus
#

PR lgtm

pallid grail
#

Thanks!

#

Do you want me to merge?

leaden walrus
#

sure. gopher it

pallid grail
#

Donezo.

leaden walrus
#

i think maybe i know why CP didn't work. it needs some plumbing update.

pallid grail
#

No, it had to be added to the lib, so it knew which chip type it was.

#

That's already done and merged.

#

It was looking for a different chipset initially because the PID wasn't attached to the proper one.

#

At least that's what fixed it anyway.

leaden walrus
#

still didn't work after that?

pallid grail
#

Worked great after that.

#

I meant initially it didn't work.

leaden walrus
#

oh. ok. nvm.

pallid grail
#

Heh

leaden walrus
#

yah. that 'splains it.

pallid grail
#

Exactly

#

@leaden walrus Thanks for the help with this! Do I need to do anything else for it to be bumped?

leaden walrus
#

nah. i think your part is done.

pallid grail
#

Keen.

whole dagger
#

How can I quickly address a 4-bit multiplexer with a SAMD51 programmed with arduino? I'm guessing I should use direct register writing instead of the slower digitalWrite function. But I don't know which registers to use on the SAMD51 and exactly how to use them

leaden walrus
#

what's the interface between the SAMD and the multiplexer? just GPIO? or is it I2C?

agile hare
#

what is the problem with the "A programmer is required to upload" error

lethal yarrow
#

Usually it means you've selected the wrong serial port, but it can also indicate bootloader issues.

agile hare
whole dagger
#

Standard analog multiplexer. I have a MAX336 and a 74HC4067

lethal yarrow
whole dagger
#

Also make sure it isn't an extraneous "ghost" port

#

you can check what type of device is connected in device manager on windows

lethal yarrow
#

Yeah serial ports are kind of broken in Windows.

whole dagger
#

but what microcontroller?

whole dagger
#

might be related to some device I have connected in the past

lethal yarrow
#

There's also often a port related to remote management, and sometimes a few others.

#

There can also be "virtual" serial ports. Windows will see them as serial ports, but they are actually used for other hardware.

leaden walrus
lethal yarrow
#

It could produce some glitching though if the outputs don't change quickly enough.

whole dagger
#

I'm rapidly polling through an array of piezoelectric sensors using the two multiplexers, so it needs to be pretty fast

#

But microcontrollers are also much faster than the signals the piezos put out

#

for reference 50ms/div roll mode on my scope is good enough to see the signals

#

and it's only 8 pins to control

lethal yarrow
#

Oh that'll be fine.

#

I will say though that personally I always prefer register writes for GPIO.

whole dagger
#

Yeah and I think I'll use register for this one because it will take unnecessary processing power to convert a number to binary and output it through digitalWrite. With a register, it should just be shift some bits, and write to the register

#

But I am completely unfamiliar with interfacng with the registers in arduino on a SAMD51

#

How do I write to the GPIO registers?

lethal yarrow
#

Well with AVR the register definitions are included by default in your sketch, so you could do things like PORTB &= 0xf0 to clear the lowest 4 bits once you configured the pins as outputs. For SAMD51 there's probably a bit more setup, but I suspect it's similar.

fallow vapor
#

Hi all, I'm struggling with a Adafruit SSD1327 display. https://www.adafruit.com/product/4741. I'm trying to get the display working with the Raspberry Pi Pico, but I'm not having any luck. I am able to communicate with the display using I2C, but when I try to run the example here, I'm not getting any output from the display. I'm starting to wonder if there might be a chance the display might be defective. Looking at the solder joints, it looks like there is some "crud" between joints.

#

Any ideas on other things I can to do test the display?

#

Here are some images of the board

#

If there is a better channel for this question, please let me know

stable forge
#

You could try it with CircuitPython and see if you see anything: https://learn.adafruit.com/adafruit-grayscale-1-5-128x128-oled-display/circuitpython-wiring-and-usage/ There is an example at the bottom of that page. Also try the other STEMMA/QT connector on the display board, just in case. The junk you're seeing on the board looks like extra flux. You can just try brushing it away. But it's near the power-supply circuitry, and if you're able to talk to the device, that part is more likely to be OK.

#

@fallow vapor ^^

fallow vapor
#

Ah, That's a great idea! I'll give it a try. Thank you.

fallow vapor
#

Well unfortunatley that was also a bust. I tried the Circuit Python examples and still no display from the screen. I also tried connecting to both STEMMA connectors on the display https://github.com/adafruit/Adafruit_CircuitPython_SSD1327/tree/main/examples I also tried another I2C device, the Si7021 temperature sensor, using the same wiring, just unplugging the display, and plugging in the sensor, and it works as expected using this example code. https://github.com/adafruit/Adafruit_CircuitPython_SI7021/blob/main/examples/si7021_simpletest.py

GitHub

DisplayIO drivers for grayscale OLEDs driven by SSD1327 - Adafruit_CircuitPython_SSD1327/examples at main · adafruit/Adafruit_CircuitPython_SSD1327

GitHub

CircuitPython driver for the Si7021 temperature and humidity sensor - Adafruit_CircuitPython_SI7021/examples/si7021_simpletest.py at main · adafruit/Adafruit_CircuitPython_SI7021

#

Is there anything else I could be missing?

#

I tried following the example here https://learn.adafruit.com/adafruit-grayscale-1-5-128x128-oled-display/circuitpython-wiring-and-usage breaking it down piece by piece like it shown in the example, but still I get nothing out of the display. I feel like I've eliminated wiring, or pin number errors, by verifying another I2C device works, and I'm using the example of "known" good code. Is there anything else that it could be other than a defective part?

Adafruit Learning System

This cute little OLED is twice the size of out 128x64 OLED, plus it can do shades of grey.

stable forge
leaden walrus
#

@fallow vapor power is connected to wrong pin (ADC_VREF), move it one pin over to connect to 3V3 OUT.

#

just tested the arduino example on a pico w and it works as expected

fallow vapor
#

Sure enough, that was the problem.

#

So I guess I'm still a little confused as to why the Temperature Sensor worked when I had the power pin in the wrong slot, but the display did not. Is it safe to assume the ADC ref is still 3.3v but just much more limited current than the 3.3v OUT pin?

#

Thank you so much for the sharp eye, I still can't believe you were able to pick that out in a photo, and I'm over here looking at the board, and missed it.

leaden walrus
#

that'd be my guess - it was able to source enough current for the temp sensor, but not enough for the display. it was also enough to illuminate the power indicator LED on the display (green LED, can see in your photos), which would only need a few mA to be visible. display is probably more O(100mA)

#

glad it was a simple fix!

fallow vapor
#

Thank you again! I really appreciate the help

leaden walrus
#

np

novel igloo
#

Can someone answer some noob questions for me?

#

I'm trying to use my ESP32-S2 Metro with C after having previously installed CircuitPython. It's not running the tester code so I'm wondering what step(s) I am missing.

fiery iron
#

Hey, I'm trying to figure out how to fix this issue i'm having with a ssd1327. whenever there are many pixel on on the same line, this line shows up dimmed. Is there something I can do with the startup configuration? (using the Adafruit_SSD1327 library) video for example:

#

you can clearly see a darker band in the middle, where most of the pixels are on

muted gyro
#

huh, it's oled. Not sure how what I wrote applies then. But I still think it's probably a hardware limitation of the screen and I would still try reducing the brightnes

fiery iron
#

it happens no matter what contrast/brightness I set

north stream
# fiery iron

It could be a power supply issue, where the power supply sags when more current is drawn. You could try adding a capacitor across the power supply to see if that helps.

random zealot
#

Hello loves,

#

I have XIAO Seeed Nrf52840

#

connected to DAC (4x 30V) -> Potentiometer (1024-position) -> Current regulator (4x)

#

I need help coding

#

I AM SIMPLIFYING MY REQUEST

muted gyro
#

I don't understand. I think more information would be good

random zealot
#

I need help coding XIAO Seeed Nrf52840 board

#

1 current regulator from 0,1-3,0mA

#

inner timer set to 30 minutes

#

on/off button with automatic off

livid osprey
#

I think you need to approach this one step at a time. What kind of current regulator are you using, and how do you control it?

muted gyro
#

sorry, I still don't see where the programming problem even is.
How to set a timer? How to interface with the current regulator? Read the potentiometer or button?
The first step to solve a problem is to properly define it. And yes, that can be pretty hard 😄

#

Just in case english isn't your native language, that of course makes it harder. (For me, too.) You could try using deepl to translate it

north stream
#

I agree with the "divide and conquer", "one step at a time" approach. I'm guessing the MPU controls the DACs, how is that done? SPI? I2C? Parallel? Something else? Are these manual potentiometers or computer controlled?

random zealot
#

no DAC, too complicated, lets just leave that

#

mpu controls the potentiometer @north stream

north stream
#

How does it control the potentiometer? Is that part working?

random zealot
#

it is by simply making it go from 600k ohm to 20k ohm with 1024-steps 🙂

north stream
#

You're combining too much at once. A potentiometer does not control mA directly. When you command the potentiometer to go to 1/2 scale, does it do so?

random zealot
#

sorry, repaired

north stream
#

So if you send it to 512, does it give about 150k?

random zealot
#

no, I come from 60V on the output and I need it to lower all the way to 0,1mA

#

also I dont know if i need it since I have LM334

cedar mountain
random zealot
#

okay because I am trying to have an output of 3mA with 60+V behind it

#

0.1-3,0mA with 60+V

lethal yarrow
lethal yarrow
random zealot
#

it is controller -> buck converter (no idea which one to use) to 60V -> current regulator (LM334)

lethal yarrow
#

What exactly are you trying to accomplish here?

random zealot
#

I want 60V push for 0,1-3,0mA at the end

lethal yarrow
#

Yeah, I get that part. But what I'm wanting to know is why you need that.

random zealot
#

brain stimulation

#

you need to overcome layer of hair so you need a great voltage push äabout 60V should be reasonable

lethal yarrow
#

This sounds like something that you don't want to/shouldn't be building from general purpose components. It'd be better to get biomed chips that are actually designed for the task.

random zealot
#

yes, I have that and about 60 hardwares already made 🙂

cold lagoon
#

Im struggeling since 1h trying to get this nrf24l01 connection to work, it just wont work. So to test whether the NRF works i used this test code https://pastebin.com/vtdj79AB (receiving code is the same just with the the writing and reading swapped). The wierd part is not even the buildin led blinks with this code. The boards are fine tho (blink sketch works)

#

this is how i wiered it. (ive built my whole smarthome with nrf24l01's and i never had problems like this)

random zealot
lethal yarrow
#

An MDAC will do it, but like I said previously, I recommend against hooking it up to your head.

random zealot
#

I understand, thank you! I will proceed further as Ive been working on it with you as well but I will certify it! 🙂