#help-with-arduino
1 messages · Page 9 of 1
What would you recommend for power source ( for microservos, up to seven,for now just four) that works well?
Does it need to be portable?
Wdym?
Would a power cord like https://www.adafruit.com/product/1466 work?
I am not sure (once again, am new to this)
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.
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?
https://www.adafruit.com/product/1385 would work with a 3s lipo battery to deliver ample current.
Connectors may need some attention though.
I will try to get some of those then, and hope it works, thanks for the help @livid osprey and @dry quiver
opened a new issue for this:
https://github.com/adafruit/ArduinoCore-samd/issues/343
Thank you! I'll be watching this one, definitely a strange bug
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.
Nevermind I decided to just go ahead and solder. My first time ever though. Any suggestions, anyone?
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
Those look shiny and have good adhesion, should be good electrical and mechanical performance. They bulge out slightly, so you can use slightly less solder, but top marks for your first time.
I agree with your assessment about it cold starting each time. I would have guessed your approach of keeping it powered would have addressed this, I'm not sure why it didn't. Some such modules have a pin for a backup power supply, some don't. It may be resetting for some reason depending on the commands the ESP32 sends it on power-up, but I'm totally guessing at this point.
There are 2 pins on the module that are currently unused so one of them might be some sort of backup power, no idea but gotta do more research. I was reading the datasheet and I found out I can flash a GPD file with the satellite maps to the GPS Module and hot start it using PGKC commands, just have to figure out how the commands work now lol
Technically that would be a warm start, not a hot start, but would save some time if the ephemera are up to date.
Top marks especially with the fact my stupid Walmart brand soldering iron started melting it’s own handle without even being touched. I got it a few years ago and just never touched it until now. I let it cool down then threw it in the trash. I’ll be getting a new one soon.
But thank you!
We've all been there
I have a deep appreciation for the cow boy boots
And the soldering iron laying on carpet lol
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
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
Looks like it’s in the uf2 boot loader mode. Either your sketch did not upload properly, or something bad happened in your arduino code and cause it to automatically reset into boot loader mode again.
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.
Yes. YAML allows different syntaxes for representing arrays. https://www.w3schools.io/file/yaml-arrays/
How best to report "fixes needed" to learn guides? Specifically to learn guides for feather s2 reverse tft. PR somewhere, or other way?
If you see bugs in the code, open an issue in https://github.com/adafruit/Adafruit_Learning_System_Guides. If there are issues with the guide text, use the "Feedback? Corrections?" link in the left sidebar in the guide.
@stable forge thanks dan ! never noticed that. will do it now
I'm reading thru the arduino github for Adafruit_Neopixel and I'm trying to figure out where functions like colorWipe and whiteOverRainbow come from? I'm not seeing them in the .cpp or .h fileshttps://github.com/adafruit/Adafruit_NeoPixel/blob/master/examples/RGBWstrandtest/RGBWstrandtest.ino
They’re defined in the example
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?
weak on my arduino skills. I'm trying to verify some code and I'm getting "14 Unavailable: No connection established"
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
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.
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.
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)
That's a good choice. A Pi Pico (W) or another RP2040-based board is also a handy stocking-stuffer to have lying around.
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.
interesting... I'm not even sure how to use a logic analyzer... which means that I should absolutely buy one - just so I can learn!
Do you think I could use a logic analyzer to look at 1-wire traffic? [Answered my own question - thanks youtube - it can certainly be used one look at one wire transactions!!!]
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.
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)
I want to save on SD card, but what library I should to use for ov2640
I Google it, but I didn't find something to work
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
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?
Possibly the filenames contain unprintable characters?
Maybe try the ArduCam library https://www.arducam.com/knowledge-base/mini-tutorial/
Or the whole filesystem is corrupted.
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
Could be a failed card.
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?
I can write to it from windows
I do have a failed 128GB which failed after less than a day that I can't even format on Windows
Seesaw is on default I2C (SDA, SCL), there shouldn't be a change needed to the library
Hmm... RP2040 feather has two I2C ports - Wire and Wire1. Seesaw initializer defaults to Wire.
the TFT-joystick wing Seesaw uses the SCL and SDA pins as silkscreened on the 2040 feather, that should be Wire
So why does my miniTFTwing show up only on Wire1?
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
Stacked using the usual thin-pin header/sockets that Adafruit sells.
Using latest version of the RP2040 board files and Seesaw lib
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)
I haven't modded any of the jumpers.
FWIW when I plug stuff into the Stemma/QT jack that also shows up on Wire1
Additional Boards Manager URLs: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json ?
(checking the .zip file to try to make sense of it)
yeah, the Stemma QT connector uses the same pins, SCL and SDA
Yes - that's the URL I'm using
#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
Currently at V3.2.0
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
Yeah. Makes things a bit difficult. 🙂
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)?
Sounds good to me - I'll do that. Thanks for your help digging into the root cause!
but of course a change now would probably break all kinds of stuff
true, an issue there perhaps?
Yeah - maybe issues on both and then point them at each other & let them fight it out. 🙂
Thanks - I'll add that info to the issue I submit.
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
Different board revs?
Anyone here have issues with TinyGSM GSM_location.ino compiling with SoftwareSerial missing error
on esp32 dev board settings
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.
@broken violet you can delete all that boilerplate text
Thanks
@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.
I was following that, sounds good, thanks to cater for getting involved
Anyone here have issues with TinyGSM GSM_location.ino compiling with SoftwareSerial missing error
on esp32 dev board settings
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?
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
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?
@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.
@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.
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.
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
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.
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.
You cannot safely fit a relay large enough to switch mains anything on a feather-sized board. And even if you could it'd be unenclosed.
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.
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).
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.
what is the name of this flat joystick
3ds style
thumb joystick
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?
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```
Hey folks! I just wanted to make sure I'm not overlooking something but this https://github.com/adafruit/Adafruit_TinyUSB_Arduino should work with the Seeed Studio XIAO nRF52840 board right?
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
One of those resistors is going to the wrong rail so it's not getting power
are the header pins soldered to the board?
No
I can’t believe I didn’t know that
Do they have to be soldered on the sensor too?
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?
yes. all headers pins need to be soldered to the boards.
https://learn.adafruit.com/how-to-solder-headers/overview
Windows is finicky with USB. Reboot, and if that doesn't work try disconnecting and reconnecting in a different port.
I'll give it a shot, thanks
Nah, it didn't work. rebooted and tried all the ports on my computer
Any other ideas?
Wrong driver perhaps.
Oh wait a sec...
https://www.adafruit.com/product/2000
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.
So it just won't work then huh
Well I guess you can try from a different machine, or maybe via a USB hub or something.
Yeah, I'll try them. I guess the ItsyBitsy's the way to go
Hello everyone, I am new, I would like to know if you can help me with a question: I want to know if it is possible to activate a feed through a single url, example https://io.adafruit.com/api/v2/{my_User}/feeds/{my_Feed}/data?value=0&x-aio-key={my_apiKey}
I've soldered them now, only thing I'm confused about is what to connect SDO to.
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!
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
the script accompanying this schematic is here, https://paste.md-5.net/hereyotuca.cpp
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
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.
Use a USB2.0 hub between your USB3 port and the Trinket to get it work, this is my technique. It MUST be a 2.0 hub, not 3.0 hub.
↑ please try the USB2 hub method.
I would recommend testing each part one by one. Is this on a breadboard so you can easily separate the parts? Create a new sketch and test the HX711 board first (does that work). Next connect only the Adafruit_ILI9340 and test it by itself, does it work?
Use Serial.println("message") and start printing out messages in the debug to see how far it gets in execution and where it stops, etc.
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...
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"
Do you have an PCF 8523 or only a feather m0 and an arduino ?
Feather m0 adalogger
Using Arduino ide
so I was going to do this today, and now the arduino is not responding to anything at all, I have a println in the loop and nothing else at all
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
I happen to have a biological microscope, so I made some closeups of the damaged area, not ideal but I think its safe to conclude the wiring is intact?
https://gyazo.com/6a877011e96c1c3739f965ef209cc525
https://gyazo.com/26682d8320110304369546dc4f9047e5
https://gyazo.com/2ca5a77065dff5a3b970f80c5ae71539
https://gyazo.com/12a91aa5dd6a69dede6d0249ea794cfc
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?
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.
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.
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?
I would delete your authentication token/info (/********* Adafruit.io Setup ***********/) from your source code, that is now public... I would recommend changing your token.
Anyone can me provide SPIDMD.h library, I need this library for my code.
If anyone have this library please send.
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.
is it a trinket pro ?
Nope, Trinket MO.
My feather m0 adalogger is still not detecting its RTC
You may be looking for this https://github.com/pkourany/DMD2_Library
I think you are referring to https://github.com/freetronics/DMD. This repository also includes examples.
I believe the IDE can still upload code to it even if the serial port does not appear. If you need the serial port for monitoring, it should show up once the code is running.
@north stream Unfortunately, it seems not:
"Failed uploading: no upload port provided"
Unless there's something else I should set.
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.
Could my bootloader be corrupted?
No, i'm used P10 LED Matrix Display which is available on Amazon. I not used this display.
In the provided code file, I get this error.
error: expected primary-expression before 'char'
Please say me how can I solve it.
That seems like a potential problem in a header file before it gets to the char line. Did you create/edit any of them yourself, or are they all library includes?
Thanks for your peacefull response and don't worry now my error is solved
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
I don't know enough about it. I thought Arduino didn't use a bootloader in those boards the same way as in USB-serial boards. But I really don't know for sure.
No, you probably don't need that thing. There are daughterboards for various microcontroller boards that fan out the GPIO pins with servo connectors, one of those might fill the bill, depending on what you're using to control your robot.
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
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 🙂
My arduino code here on my feather m0 adalogger is not logging anything after "log file opened". Code below:
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.
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
Wiring is pretty much like C++. Low level languages like that don't do a lot for you.
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
There are libraries that let you print to an LCD
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
Serial.print is the same in that respect
(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
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.
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)
i cant seem to find it on digikey. would you have a link for me?
thanks in advance
Well, for the zero people following my Trinket M0 serial port disappearing problem, uploading a new bootloader solved the problem.
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'
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.
Yes, that's what I thought. It's usable, and got me going, again. But...odd.
https://www.digikey.de/en/products/detail/adafruit-industries-llc/1411/5353644?s=N4IgTCBcDaIIYBM4DMBOBXAlgFwAQEYAWffEAXQF8g for the Adafruit #1411 madbodger mentionned that I was replying to with that ping to you
Thank you
@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.
Couldn't you use like an USB HID/HOST between the trinket and a computer to handle the bit-bang and convert it ?
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).
I find it hard to believe that one cant bypass that on usb 3 like with a windows driver in C++
That is if we are talking about the ATtiny Trinkets.
Or usb 3.0 hides raw packets and you cant access them at all or set polling rate etc ?
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...
assuming that bit banging is only software
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.
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 🤣
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...
how does it compare to esp 8266 which even has i2c bit banging 😦 ?
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?).
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)
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.
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
Looks like it is here, source is available...
https://learn.adafruit.com/introducing-trinket/downloads
https://github.com/adafruit/Adafruit-Trinket-Gemma-Bootloader
and you cant tell the host to be in usb 1.1 mode and not 3.0 mode
That is very possible.
so youd have to write a driver to define the protocol yourself and then it should be possible
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.
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 ?
what will you do with the key combos ? send it on a PC ?
You want to connect two USB devices to it?
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
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...
like if i press ALT+D on the usb keyboard pluged in it dose CTRL+c and then CTRL+v
I have done this with a STM32F401 (enumerate an iPhone), but don't recall have done this in Arduino.
can you answer my question about uses on a pc please ? That is why I didnt answer before because you didnt give out enough infos
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.
here's the board link https://www.adafruit.com/product/5723 @quick maple i want this to work as a usb keyboard remapped to keyboard typing shortcuts please
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?).
seems possible: https://github.com/adafruit/Adafruit_TinyUSB_Arduino/blob/master/examples/DualRole/HID/hid_remapper/hid_remapper.ino
that is linked from the adafruit tutorial about that mcu
Im just not sure how you would send ctrl+c ctrl+v, probably USB ID specific keycodes
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.
normally on a regular keyboard it's like 2-3 key pressed at the same time
before it beeps in panic 🤣
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?).
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
Okay, so somewhere they actually break the scan codes out for you, that is cool.
no that's the thing
those symbols in the code dont resolve so I dont know how it does the scancodes
Somewhere in some .h file... it must exist...
I uses github respository search 😦
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...
this would help if one cant find it I guess: https://stackoverflow.com/questions/27075328/list-of-hex-keyboard-scan-codes-and-usb-hid-keyboard-documentation
Yes! Codes are all standardized so yes that will help, would be nice to know where those definiations are though.
this is the USB organization spec from 2001: https://www.usb.org/sites/default/files/documents/hid1_11.pdf
I guess it comes from that + trial-error by sniffing the key codes when a keyboard uses custom keys
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.
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
Yea, but there are also release, and hold codes too I think...
There is a press/release/hold code I think...
hold we didnt lose you but basically you have a lot of work ahead 😄
@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!
you will basically have to intercept the correct keycodes and account for release of the key in the correct order
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
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).
also its very similar to key sequence in games in unity like: https://answers.unity.com/questions/1146027/c-make-something-happen-if-i-press-a-sequence-of-k.html to give an idea of algorithm to do it
this is something games have to do all the time in general so it is a well-known problem
especially fighting type games
Hey guys, anyone know who to achieve a similar rgb keyboard effect on arduino?
That is an extremely general question.
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
Basically trsistions to this state to the other and then cycles in a smooth fashion
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.
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
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.
do you want circuit python on it or arduino ?
circuitpython
then you are on the wrong channel, try #help-with-circuitpython
Thanks
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.
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
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.
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
what did you do for the sd-card ?
and which uno and brand is it ?
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
yeah but what I am asking is that normally an uno r3 dont support an sd-card unless you have a shield. Youd have to write the wav file in raw format in the source but the uno dont have enough memory for that
so Im kinda surprised that you may have gotten it to read a wav file
Yea in the above post, I forgot to mention that it is a MIcroSD card module I used
I'm not too sure on the brand, but it is from here:
https://www.canadarobotix.com/products/2077
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
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 😦
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?
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
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)
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 😦
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.
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
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();
}
}
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 ?
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.
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...
The noises stop after it runs the .play(..); then delay(..), afterwards another.
Many of the libraries offer "color wheel" type functions you can build this out of
Hello. Looking at this value (int)((0.99/3.3)*32767) what represents the constant 32767 and why we use it there ?
Do you know what the code is doing? It's the maximum value that'll fit in 15 bits: 2^15 is 32768.
So I'd call that "scale 0.99/3.3 to a 15-bit integer"
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
It likely means you have a 15-bit ADC, though that makes me wonder why 15 in the first place, not that it matters.
okay, so I'm assuming that's set as a constant named "lowVolage" or something?
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.
Sorry, I meant to direct that question to @low verge out of curiosity for the use case
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
Yeah, it's possible, but you'll need to be careful with wiring and shielding as you're dealing with low-level signals.
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.
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
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
Well using https://learn.adafruit.com/adafruit-attiny817-seesaw/arduino-analog-in as its an ATtiny816 I have the analog pins at
Serial.print(" ");
Serial.print(ss.analogRead(15)); // analog value Y
Serial.print(" ");
``` but the ``` digitalRead Values of 0-6, 8, 11, 16 ``` looks like floating values / missing pullup ? as they pull down
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);
}
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!
You probably don't want to draw more than 20mA or so from a GPIO pin. For driving IR LEDs, the usual approach is to use a transistor to allow you to send greater current through the LED.
20mA is the absolute maximum on AVR chips at 5V. Even then you can only do it on one pin per port, and you don't want to exceed the max power for the chip.
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
}
I'd probably simplify the problem by moving the action part of the interrupt into a separate subroutine, and call that from both ISRs
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.
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.
Does somone know the resitor value of the adafruit pt19 light sensor?
The schematic labels it as a 10k.
thanks
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)
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
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
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
A number of things have been fixed since that old version. It's easy to upgrade the bootloader. It wil be more robust to power glitches. The SAMD51 can get into a state where it clears the first writable page of flash if there is a power glitch.
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"
the latest update is pretty recent, and was "random use cases and users" too 🙂
WHen you set a pin to INPUT_PULLUP, specifically PB06 on a 32u4, does that make it an analog pin with an input pullup?
No, it fires up the pullup resistor
*analog input pinb
So you "see" a 1 when reading it. Unless something external grounds it
Try it and see
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
Why would you want an unspecified amount if ohms messing up your analog input?
I don't, I'm trying to make sure I have an understanding of the firewalker project
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.
how are you powering the leds ?
@quick maple Currently directly off the 3.3v rail. This is just for testing purposes
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
So if I disconnect the LED's or power them from a separate supply (with connected grounds) the issue should stop happening?
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
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
When powering LEDs using a separate power supply than the one powering the ESP board, you are instructed to connect grounds together to prevent flickering on the LED strip
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
Sounds like you'll need someone with more knowledge than me if the led strip wasnt the problem
hopefully they see your question soon 🙂
@quick maple Thank you!!!!
It's not to "prevent flickering", it's because the LEDs need a common reference for both the power supply and the data signal, and those are shared on a single wire.
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.
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
Yes, I am interfacing with an existing CAN port off an embedded device I own. It’s running at 250K baud rate and I made sure to match that in my code. Again, I can read all the CAN messages without an issue
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?
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.
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?
For folks who want ready-to-go keeb action, we've got the lovely Adafruit Macropad with a 3x4 grid of MX+NeoPixel key switches - but for those who like to forge their own path, we now ...
That's a common problem when running low impedance or noisy loads (servos are both) from the same power supply that's powering your logic. Normally there's a separate power supply for them, or you can use a decoupling network to protect the logic from the power supply glitches.
So what happens? Does the code compile? Do the switches work? Do the LEDs work?
i ended up making a janky little cable that just bridges ground on both and plugs into the servo
it works i guess?
So far I've been getting code to compile and the key switch LEDS light up and respond to code. I haven't seen any reaction to key switch presses, neither int he serial monitor nor as a HID
You've adjusted ROWS, COLS, rowPins, and colPins in the code to correspond with your pins and layout?
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.
It looks like the code waits on .available() and prints out what it receives. Do you see any of that in the serial monitor?
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
Now I'm working from John Park's Numpad 4000 code (https://learn.adafruit.com/numpad-4000-mechanical-keyswitch-data-entry-device/code-and-use-the-numpad-4000), and I have it working as a HID (huzzah!)
But when I press one of the key switches, it repeats the key until I reset the board.
That's irksome, but seems like a less-hard fix than getting HID working in the first place
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.
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.
Is this the right channel to ask about code for adafruit library (specifically the config in the MPR121 lib)?
sure. for the arduino library.
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.
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
Code-wise I don't seem to be able to get past the begin() call for seesaw.
@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.
That's a good sign that the code is running at least. Where and how are you declaring DEFAULT_I2C_ADDR?
Just as in the example :
#define DEFAULT_I2C_ADDR 0x3A
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 ?
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.
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
I'd definitely try a different board if you can. Code wise, this looks like it should work judging by the data sheets.
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.
Which you presumably haven't done since it requires cutting traces
Yeah unless I need to daisy chain i2c, there's no point right?
Right. And even then, only if you want more of the same device.
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
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.
could be useful to see the wiring at this point
just to make sure everything is connected right
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.
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
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?
Different errors for different selections
https://learn.adafruit.com/adafruit-feather-328p-atmega328-atmega328p/arduino-ide-setup <--- followed direcitons here
I'll try to help in a bit. Hands are full of ribs
Texas dry
mehhhhhh 😄
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?
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.
The 2nd one only showed up after the driver install
Ah, in that case it's probably the second one.
So what does the IDE give for an error? Board not found? Something else?
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
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.
Grrrrrrrr I did. The code for this project is trivial.
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.
Wish I could help. It's definitely not supposed to be this hard.
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
The challenge there being that you either need a programmer, or another (working) board to use as one.
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
I suspect the usbserial one is the Feather
it can do serial but with an FTDI cable whatever this is. Must be something from the telegraph MCU ielectronbic kits n the 1890s
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?
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).
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.
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
Well I would not recomend the one that I am using haha
Like this one? https://www.adafruit.com/product/254
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.
maybe tio
That's starting to look about right.
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?
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
I could see that, though I guess it's just adding them by default since blink doesn't use serial.
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
Well, at a minimum looks like it's including both the bootloader and a math library.
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
I'm surprised it brings any of it in, but I suppose it's needed for something not directly in the sketch.
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"!
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.
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.
So it's definitely sounding like it's the serial library.
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
Do you want to write to the flash that's on the board? And are you using earlephilhower's arduino-pico core? Then I think these would be right:
https://arduino-pico.readthedocs.io/en/latest/fs.html
https://arduino-pico.readthedocs.io/en/latest/eeprom.html
I think Adafruit SPI flash is only for additional flash, not the flash that's used for the program.
i think you're correct about Adafruit SPI flash, also god send for the pico core documentation ill read over that
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?
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
Not a single person lol I'll just try using the simulated eproom then lol
Lack infos for me and it serves no purpose to take low-probability wild guesses
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
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
I am the Feather RP2040 dvi uses 1 core for video rendering
the other core is for you to use
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
yes i updated yesterday went you sent me the documentation
hmmm then I really don't know
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
would it not be easier to upload the code instead ? (upload not copy paste)
i was but i forgot how to do the cpp code block syntax
I think idleothercore and resumeothercore are automatically done when flash is written.
In fact if you manually idled the core, then this happens:
- you idleothercore()
- you try to write to flash. The write automatically does idleothercore()
- the other core doesn't respond to the command from 2 because it's already idled.
- Everything is stuck
```ino
[code here]
```
clearly little fs isnt doing idleothercore
btw this is all "if I understand correctly" 😆
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
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
#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
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.
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
im guessing its a multicore handling thing like @muted gyro said
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
uh so how do i report this issue if https://github.com/adafruit/PicoDVI has no issues tab
kinda new to this whole wow the problem wasn't my code its the library thing
Have you tried it without this library?
Yes see this @muted gyro
hmmm sorry I don't know further :/
If I remember right, PicoDVI overclocks the RP2040 to get the timing right. It's possible that just doesn't work on certain chips.
What even is an auto fisic reset.
I can't find anything online about fisic
Maybe typo?
I had been thinking maybe a timer conflict, but that issue refers to a DMA channel conflict, which could also cause behavior like that.
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.
How can I ensure that?
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.
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
I'm not sure. I've only done it in CP
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
Radio signal strength can be a little fiddly. TDK has some ultrasonic Chirp sensors that do pretty good rangefinding within a few meters.
do those need los?
This is more for 'kinda fun' not really precise, but ideally not LoS
You might consider like coil-to-coil near-field inductive coupling?
i don't mind paying for a decent solution though if it's easy to implement
Depending on the distances involved, you could do other things, like induction or these things https://theelectronicgoldmine.com/products/g24774b
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
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!
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…
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!
whoops here's the link: https://github.com/adafruit/Adafruit_BMP280_Library
For an Atmel AVR board, including Adafruit_BusIO and/or Adafruit_Sensor should fix the issue.
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).
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
guess i'll need to just get some esp32 like i planned and tinker
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
You likely need to buy a powered hub. I recommend StarTech.com.
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
That can be caused by power issues. Do you have anything else connected to either of those boards?
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
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?
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
@leaden walrus Are you pretend-idle or for-real-idle?
For real, it appears.
@north stream Are you around?
@pallid grail 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.
is there still a question? or is it figured out?
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?
the code provided written in circuitpython works perfectly fine, but in arduino it does not work
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.
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.
with lots of {} and ;s
show(); see...gotta have that ;
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;
}
int x = 1024 - ss.analogRead(14);
sure. np. probably other options.
Otherwise it wouldn't be obvious how to use it for other things. If it was in the print only,
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
So, it never hit 1024. Which means now it's not hitting 0. Does that matter?
oh. sry. maybe off by one. yah make it 1023 or whatever.
yep
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.)
"altering joystick behavior to desired orientation is left as a homework assignment "
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.
which pid?
there's no actual silk label for the joystick?
Nope
you're working on guide?
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.
could write it terms of "left/right" and "up/down"?
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.
how were you going to define X and Y? (since there's no silk)
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.
yah. it's basically just two pots 90 deg apart.
Right
pots setup as voltage divider read into ADC
what "X" and "Y" are can be up to user
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.
lemme look at schematic
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.)
Search for Gamepad QT
rev A?
Yeah. That's the only one.
that's what you're calling X and Y?
Correct
schematic looks OK to me? if the pot pins are what i'd expect
It's not.
joystick pins
Right.
I have to swap the seesaw firmware pins (shown in the schematic) to make it work right in code.
They're not right.
would have to open datasheet for the joystick to verify. but its pinouts are actually like that?
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.
do you know if that's a PID 2765 joystick?
99% sure, yes.
meh. only has a diagram. not real data sheet.
i guess it's a minor net name issue in the schematic
int x = ss.analogRead(14);
int y = ss.analogRead(15);
Yep.
and then also a sign swap
Exactly.
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
Ok. I'm still going to ask about updating it when I'm through the rest of this. 😄
But fair enough.
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
I know.
But someone is going to complain 😂
I try to do my best to mitigate that where I can.
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
Yeah.
Done.
needs 2mm high and 10mm large LCD so you can change the X/Y lettering on the board
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?
Without supplying your schematic there is not much of a way of knowing how to help.
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.
I've been bitten by that one before too
@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 ..?
yep. in that repo. can see the other misc examples there:
https://github.com/adafruit/Adafruit_Seesaw/tree/master/examples
Yep I'm there already. Simply wasn't sure how it worked.
Ok. Thanks.
Does it need to be bumped at that point?
it would for the examples to get published
so they could be opened through the arduino ide
sure. eva also does regular sweeps to update arduino libs.
I'm in the guide, so having it in the IDE ASAP would be idea. I think she does sweeps weekly.
ok, yep. it's easy to bump. can ping me.
@leaden walrus Wait, is SPDX not set up on this library?
So not used to contributing to Arduino libs.
that's just a licensing thing? i don't think the arduino libs are using that.
Ok, yeah it's licensing.
@leaden walrus https://github.com/adafruit/Adafruit_Seesaw/pull/86
Obvs it needs to do all the testing or whatnot.
@pallid grail you tested example? PID 5743 firmware doesn't appear to be in repo. so assuming i2c address is actually 0x50, etc.?
Yes, thoroughly tested. Worked with no changes to the lib.
I didn't know it needed to be added to the lib.
CP flat out didn't work.
different lib. the firmware lib:
https://github.com/adafruit/Adafruit_seesawPeripheral/tree/main/examples
Oh.
like what's running on the seesaw chip itself
Oh right.
LImor gave me this code and told me to clean it up, so I did. That's where it came from.
just for use in comparison to your PR (since don't have actual hw)
Fair enough.
PR lgtm
sure. gopher it
Donezo.
i think maybe i know why CP didn't work. it needs some plumbing update.
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.
oh. yah. see it. this:
https://github.com/adafruit/Adafruit_CircuitPython_seesaw/pull/117
still didn't work after that?
oh. ok. nvm.
Heh
yah. that 'splains it.
Exactly
@leaden walrus Thanks for the help with this! Do I need to do anything else for it to be bumped?
nah. i think your part is done.
Keen.
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
what's the interface between the SAMD and the multiplexer? just GPIO? or is it I2C?
what is the problem with the "A programmer is required to upload" error
Usually it means you've selected the wrong serial port, but it can also indicate bootloader issues.
just GPIO
how do i know which serial prot to use
Standard analog multiplexer. I have a MAX336 and a 74HC4067
It should be listed in the Arduino IDE. I haven't used the new one though so it's probably in a different place now.
Also make sure it isn't an extraneous "ghost" port
you can check what type of device is connected in device manager on windows
Yeah serial ports are kind of broken in Windows.
but what microcontroller?
I just have this COM8 (Serial over bluetooth) port that never goes away lol
might be related to some device I have connected in the past
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.
i'd suggest just trying digitalWrite() and see how it works. might be fast enough.
It could produce some glitching though if the outputs don't change quickly enough.
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
Oh that'll be fine.
I will say though that personally I always prefer register writes for GPIO.
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?
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.
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
The example I'm trying to run https://github.com/adafruit/Adafruit_SSD1327/blob/master/examples/ssd1327_test/ssd1327_test.ino
If there is a better channel for this question, please let me know
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 ^^
Ah, That's a great idea! I'll give it a try. Thank you.
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
DisplayIO drivers for grayscale OLEDs driven by SSD1327 - Adafruit_CircuitPython_SSD1327/examples at main · adafruit/Adafruit_CircuitPython_SSD1327
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?
Sounds like it might be a hardware problem. Open a thread in https://forums.adafruit.com, describe the problem, include your picture, and someone will get back to you about any further diagnosis if necessary, and then replacement.
@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
I'm so embarrassed.
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.
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!
Thank you again! I really appreciate the help
np
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.
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
I guess that's a hardware limitation of that screen. I noticed the same behaviour on various LCDs like that. Including my RC remote controller (which is a "mainstream" commercial product).
You can try to adjust the contrast. That may make it less noticeable or even remove it.
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
it happens no matter what contrast/brightness I set
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.
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
I don't understand. I think more information would be good
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
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?
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
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?
no DAC, too complicated, lets just leave that
mpu controls the potentiometer @north stream
How does it control the potentiometer? Is that part working?
it is by simply making it go from 600k ohm to 20k ohm with 1024-steps 🙂
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?
sorry, repaired
So if you send it to 512, does it give about 150k?
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
Digital potentiometers often do not like dealing with voltages larger than their own supply voltage, so you may need either a specialized chip for that, or more or a current controller instead of a pot.
okay because I am trying to have an output of 3mA with 60+V behind it
0.1-3,0mA with 60+V
This isn't mains output, is it?
Some MDACs might be able to handle it
it is controller -> buck converter (no idea which one to use) to 60V -> current regulator (LM334)
What exactly are you trying to accomplish here?
I want 60V push for 0,1-3,0mA at the end
Yeah, I get that part. But what I'm wanting to know is why you need that.
brain stimulation
you need to overcome layer of hair so you need a great voltage push äabout 60V should be reasonable
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.
yes, I have that and about 60 hardwares already made 🙂
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)
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
this is how i wiered it. (ive built my whole smarthome with nrf24l01's and i never had problems like this)
what kind of specialized chip to use if I have voltage higher than a potentiometer VDD
An MDAC will do it, but like I said previously, I recommend against hooking it up to your head.
I understand, thank you! I will proceed further as Ive been working on it with you as well but I will certify it! 🙂
what is MDAC? 🙂