#help-with-arduino
1 messages · Page 17 of 1
Pretty sure it's DHT dht; instead of dht DHT;
(type followed by variable name rather than variable name followed by type)
Like double trouble; or float boat;
#include <Wire.h>
#include <Adafruit_MLX90614.h>
#include "MAX30105.h"
#include "heartRate.h"
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
MAX30105 particleSensor;
const byte RATE_SIZE = 4; // Increase this for more averaging. 4 is good.
byte rates[RATE_SIZE]; // Array of heart rates
byte rateSpot = 0;
long lastBeat = 0; // Time at which the last beat occurred
float beatsPerMinute;
int beatAvg;
void setup() {
Serial.begin(9600);
Wire.begin();
mlx.begin();
Serial.println("Initializing MAX30105...");
if (!particleSensor.begin(Wire, I2C_SPEED_FAST)) {
Serial.println("MAX30102 was not found. Please check wiring/power.");
while (1);
}
Serial.println("Place your index finger on the sensor with steady pressure.");
particleSensor.setup();
particleSensor.setPulseAmplitudeRed(0x0A); // Turn Red LED to low to indicate sensor is running
particleSensor.setPulseAmplitudeGreen(0); // Turn off Green LED
}
void loop() {
float body_temp = mlx.readObjectTempC();
float ambient_temp = mlx.readAmbientTempC();
Serial.print("Body Temperature: ");
Serial.print(body_temp);
Serial.println(" °C");
Serial.print("Ambient Temperature: ");
Serial.print(ambient_temp);
Serial.println(" °C");
long irValue = particleSensor.getIR();
if (checkForBeat(irValue) == true) {
long delta = millis() - lastBeat;
lastBeat = millis();
beatsPerMinute = 60 / (delta / 1000.0);
if (beatsPerMinute < 255 && beatsPerMinute > 20) {
rates[rateSpot++] = (byte)beatsPerMinute;
rateSpot %= RATE_SIZE;
beatAvg = 0;
for (byte x = 0; x < RATE_SIZE; x++)
beatAvg += rates[x];
beatAvg /= RATE_SIZE;
}
}
Serial.print("IR=");
Serial.print(irValue);
Serial.print(", BPM=");
Serial.print(beatsPerMinute);
Serial.print(", Avg BPM=");
Serial.print(beatAvg);
if (irValue < 50000)
Serial.print(" No finger?");
Serial.println();
delay(1000); // Delay for 1 second
}
can someone help me with this code because the code is error the output its says nan
you might have a division by zero on beatsPerMinute the first time you run through.
try moving the delay(1000); // Delay for 1 second at the beginning of the loop()
@tame raptor it's always worth asking GPT4 about these things - it gets better day-by-day: https://chat.openai.com/share/8fe31a55-e623-4d97-bba8-b5405c479343
@eternal cloud There's a code-of-conduct that includes "Engaging in behavior that creates an unwelcoming or uninclusive environment" ... giving your 🚫 with zero explanation on a useful suggestion qualifies. Explain what you mean, or take that away.
its still error
hmm, does it say at what line is the error?
can you turn on verbose https://support.arduino.cc/hc/en-us/articles/4407705216274-Use-verbose-output-in-the-Arduino-IDE
and show a screenshot of your output
its not error but its the output still say nan the body tempretaure and ambient temperature
Ah, I see ... that's error reading the temp sensor, it's probably not connected correctly
If you post your circuit, with the wiring clear, you can get it double checked.
do you want to see my prototype the wiring sensor to esp32 first?
i just meant a picture of the actual circuit, with the connections as visible as possible 🙂
is it correct the wired like this?
the microcontroller and the sensor pins are not visible, so can't check.
you probably need multiple pics, from different angles.
Please help:
// Try Everything! Happy Hacking 🙂
#include <Arduino.h>
#include <Servo.h>
Servo servo_9;
void setup() {
servo_9.attach(9);
}
void loop() {
Serial.begin(9600);
if (Serial.available()) {
servo_9.write(receivedDataFromSerial);
}
}
Assuming that the data coming from serial is binary values (0 to 190), replace receivedDataFromSerial with Serial.read()
if it is text values instead, it will need something like Serial.readBytes or Serial.readString plus processing to convert to a value that Servo.write() can handle. Better would be to write a separate function to do the read, validate the result, and provide the value as it's result. See https://www.arduino.cc/reference/en/language/functions/communication/serial/ for options and details for serial reads.
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.
I'm trying to use a cheap PCM5102 I2S DAC with an ESP32-S3 feather and for some reason it's not outputting anything, here's my setup code:
I2S.setDataInPin(DIN_PIN);
I2S.setSckPin(SCK_PIN);
I2S.setFsPin(LCK_PIN);
if (!I2S.begin(I2S_LEFT_JUSTIFIED_MODE, 44100, 16)) {
Serial.println("Failed to initialize I2S!");
while (1); // do nothing
}
DIN_PIN is connected to the "DIN" pin
SCK_PIN is connected to the "SCK" pin
LCK_PIN is connected to the "LCK" pin, but I'm not sure if it's just the "FS" pin with a different name like I assumed.
I think I found the problem, it should be I2S.setDataOutPin, not I2S.setDataInPin
Any idea why declaring a NeoPixel strip on a RP2040 USB Host Feather would hang the chip and/or the USB stack?
I don't have to do anything but this declaration:
Adafruit_NeoPixel pixels(NUMPIXELS, PIN);
NUMPIXELS is 1 and PIN=PIN_NEOPIXEL
I'm starting to think it has something to do with using multiple cores
Adafruit TFT LCD Arduino -- File not found issues.
Ok, I understand - the Neopixel library uses a PIO so if I enable Pico-PIO-USB, they conflict. Big Bummer. Anyone know if the NeoPixel library can revert to bit-banging?
Hey Ya'll, I am testing out my little model rocket payload that i wrote. It is using a feather m4 express. It was all working yesterday, but now I am running into an issue where it always fails to write to the file using the onboard storage and I cannot for the life of me debug why!
Here is my repo: https://github.com/deibeljc/rocket-telematics/tree/main
And here is explicitly where it is failing: https://github.com/deibeljc/rocket-telematics/blob/main/FileHandler.cpp#L62
I have confirmed it successfully creates and opens the file, just dies when it tries to write to it. This same code had worked awhile ago, but I was wrangling with the GPS module for a long time.
Here is what the output looks like:
09:36:42.057 -> Trying to get GPS Fix 0
09:36:56.232 -> Got GPS Fix10
09:37:01.851 -> Calibrated Ground Level Altitude: 243.00
09:37:20.952 -> State changed to LAUNCHING
09:37:44.373 -> Error writing to file
09:37:44.373 -> Error writing to file
09:37:44.373 -> Error writing to file
09:37:44.373 -> Error writing to file
09:37:44.373 -> Error writing to file
09:37:44.405 -> Error writing to file
09:37:44.405 -> Error writing to file
09:37:44.405 -> Error writing to file
09:37:44.405 -> Error writing to file
09:37:44.405 -> Error writing to file
09:37:44.405 -> Error writing to file
09:37:44.439 -> Error writing to file
09:37:44.439 -> Error writing to file
09:37:44.733 -> State changed to DESCENDING
09:37:44.764 -> State changed to LANDED
Any help or direction would be greatly appreciated! I banging my head against a wall atm!
I was using the Trinkey Neo as a rubber ducky, and was wondering if i could still use the rgb lighting when using the ducky scripts and features
Maybe have one led as a status indicator and the other 3 as rgb fading in and out...possible?
Yeah the official docs are really confusing. Here's what I use, using your pin names:
I2S.setAllPins(/* BitClkPin */ BCK, /* LRClkPin */ LCK, /* dataOutPin */ DOUT, /* dataInPin */ -1, /* mclkPin */ -1);
You do not need the SCK pin wired, if you tie it to ground on the PCM5102.
I tried this, but I still get silence. I tried switching to an RP2040 Feather and Pico W with a different library and same pinout but it still gave me nothing.
Can someone find pinout for this ir sensor?
PLEASE HELP! im trying to get a range value from this maxbotix XL sensor, its works with the UNO i have but the UNO is too big, ive been trying to get it to work on an itsy bitsy 5v and even with the SCL and SDA pins pulled high i am getting 0s in the serial monitor
what does it print? Does it find the device?
did you set the board to Itsy?
it goes throuh and checks each addresss and returns 0s for the range reading, i dont think its finding the sensor at all
maxbotix thinks it has something to do with the processor
are you looking at the serial monitor? It will print "Device found at:" or "Couldn't start"
did you set the board to the right board in Arduino IDE?
14:39:21.660 -> 222
14:39:21.751 -> 224
14:39:21.843 -> 226
14:39:21.913 -> 228
14:39:22.031 -> 230
14:39:22.114 -> 232
14:39:22.249 -> 234
14:39:22.343 -> 236
14:39:22.420 -> 238
14:39:22.529 -> 240
14:39:22.654 -> 242
14:39:22.749 -> 244
14:39:22.842 -> 246
14:39:22.915 -> 248
14:39:23.031 -> 250
14:39:23.156 -> 252
14:39:23.250 -> 254
14:39:23.250 -> Address polling complete.
14:39:23.343 -> Sensor range: 0
14:39:23.435 -> Sensor range: 0
14:39:23.559 -> Sensor range: 0
14:39:23.651 -> Sensor range: 0
yes for sure
it should be the default address at 224
are you sure SCL and SDa are not swapped?
I have the pull up resistors going through the push button bc I wanted to see if it made a difference when it was pulled high or left alone.
the soldering on the SDA pin and some others doesn't look that great.
does the maxbotix already have pullups?
Yeah, I hate my cheap iron
I can get this board to work with other I2c elements like the OLED screen and the rotary dial
is that a DPST pushbutton? or just a regular tactile button? If you have a meter make sure there is 5v on both resistors when pressed
what value resistors are you using?
those ones have pullups already
could you give me a link to the maxbotix?
measure the resistors with your multimeter and make sure they're the right value
also looks like the scl one is not connected
1kohm
thats parts of the issue, lemme get this rewired up and ill check back, Big thank
yah, depending on the rotation of the button, you might not be connecting anything
with a tactile button, it always works to use diagonally opposite corners. You don't need separate 5v wires to the resistors here. but in any case, you don't need the button, because you do need pullups
is that a long breadboard? Many have a split in the middle: the power rails only go halfway across. Make sure there is 5v on the resistors
what is the color code on the resistors. I am color-deficient
it's a bit fishy to me it says 4.5v instead of closer to 5v
though if the display is working the pullups are probably ok
Honestly I had the display working a few weeks ago without the pullups so that's what had me confused. It could be my Kline I've had it for a few years but it's consistent along the rail
It's brown, black black, brown brown from what I can tell
brown black black is 10 ohms. but they measure 1k ohms??
ok never mind, I read the reading
The display has its own pullups so it would work regardless
if you have resoldered you could try swapping SCL and SDA just to the Maxtronic. I don't have any other suggestions. The i2C code they supplied is very low level. I looked for a better library but I didn't find it. The chip used on this is a 32u4, which is the same as on the Leonardo. Do they have any experience with that?
they said they dont, they only tested it on the UNO
works great on the uno with the SoftI2c
I havent tried on the uno with regualr wire
they are using low-level I2C operations
I think there might be a softi2c for 32u4 also
is there?
same behavior... 16:21:32.752 -> 220
16:21:33.856 -> 222
16:21:34.981 -> 224
16:21:36.136 -> 226
16:21:37.269 -> 228
16:21:38.387 -> 230
16:21:39.530 -> 232
16:21:40.610 -> 234
16:21:41.772 -> 236
16:21:42.860 -> 238
16:21:44.029 -> 240
16:21:45.135 -> 242
16:21:46.238 -> 244
16:21:47.391 -> 246
16:21:48.511 -> 248
16:21:49.633 -> 250
16:21:50.783 -> 252
16:21:51.886 -> 254
16:21:52.913 -> Address polling complete.
16:21:53.055 -> Sensor range: 0
16:21:53.179 -> Sensor range: 0
Did you resolder the SCL and SDA pins?
Try just detaching the wiring from the Itsy board and plugging it into an Arduino, without disturbing anything else, using the existing breadboard wiring, and retry with the Arduino. Make sure your source code is the same on the two boards.
inspect the soldering on all the pins
I just reflowed each one to be sure
So after messing around a bunch it seems like i can only get the sensor to give me a reading when this code is intact, on the uno. i tried to just change the 2 pin definitions to the itsy bitsys (SCL 3 SDA 2) and that didnt work. changing the Library to add the OLED didnt help either, pretty sure i cant get a reading without it set up just like it is in the example. at least so far. I will return to this because i really wanna solve it but im pretty sure i am way out of my league
Big thanks for all your help today, I'm sure I sound like a goon
Not at all. This is somewhat mysterious. The I2C code is pretty fragile.
I'm trying to use the adafruit motor shield v3 with a Arduino Mega2560 to run a stepper motor, but none of my motor outlets showing voltage when I run my code. There is power getting through to the shield though since if I put my multimeter probes on the 5v and Gnd circles it shows 5V. Could I please get help?
Here is the code I used for the motor (testing with a DC motor rn for troubleshooting purposes):
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
void setup() {
AFMS.begin();
myMotor->setSpeed(150);
}
void loop() {
myMotor->run(FORWARD);
}
You don't need "power getting through to the shield", that is not enough to make motors work.
Motor shields have their own VIn and GND pins, and need to be powered separately, from a good, high current, power source, in the voltage indicated in the board datasheet.
(if you have this board https://docs.arduino.cc/hardware/motor-shield-rev3/ the voltage supported is 5-12V , and there is a tutorial there too)
Hello, I'm doing my own LED strips using IR receiver, transmitter and WS2812b. Everything went well until I tried to do some effect with adafruit_neoPixel.h library (the official one). I opened examples and tested it on 8 led diodes, tried to add effect from examples and found out, it blocks my arduino. I have IR read in void loop, so if I press any button for example 2, it will recognize it and tell it to be red color, but when I do some effect where is delay(), it blocks my arduino and I wanna ask, is there any possibility to do it with millis() instead?
void colorWipe(uint32_t color, int wait) {
for (int i = 0; i < strip.numPixels(); i++) { // For each pixel in strip...
strip.setPixelColor(i, color); // Set pixel's color (in RAM)
strip.show();
// Update strip to match
delay(wait); // Pause for a moment
}
}
millis just tells you what time it is. So you can use it to see if a certain time has elapsed.
The problem above is that colorWipe is "blocking": it doesn't return until the wipe is completely finished. You'll have to break up what it's doing and do each step in the main loop(), checking the time (with millis() ) to see if it's time to do the next step.
https://learn.adafruit.com/multi-tasking-the-arduino-part-1 (and parts 2 and 3)
https://www.programmingelectronics.com/tutorial-16-blink-an-led-without-using-the-delay-function-old-version/
https://www.reddit.com/r/arduino/comments/13otfza/psa_youre_probably_using_delay_when_you_want_to/
Also it's blocking here, when I do it with the while function @stable forge
it's blocking there because colorWipe is blocking, yes
I only know with millis the base if(currMillis - prevMillis > interval) do something
The "Multi-tasking" guide (first link) includes neopixel exmaples
that's the point of millis, it's just saying what time it is. So you can see how much time has elapsed. It's not really comparable to delay except that both deal in time
and how to implement it in colorWipe?
ended up with this, but in the end, it doesn't work and skip all colors to the end and it's blue, don't see the animation
please paste text, not screenshots, which are difficult to read and quote from. See
you want to do the setPixelColor() and show at a certain time. so they need to be controlled by an if statement. And you can't use a for-loop there, because you're not doing anything else in the loop. Please study the first link I sent you and the subsequent guides.
Czech discussion, may or may not be helpful: https://botland.cz/content/227-multitasking-s-arduino-cast-treti
unfortunately one of your comments in the code contains a substring that is a blocked words
That is the rev 3 board. I have the v3. here is a picture. I couldn't follow the tutorial with that board. Is there one specific for this one?
headers need to be soldered
https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/install-headers
Based on the picture, it seems to be an adafruit product, so this guide should help https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino
You need to power it from 5-12V
Also, what cater said, please solder your headers **AND **the block terminals - it doesn't show in the pic if you soldered those or not, but they **must **be
Thanks for your responses and your patience with me. I found sublibrary for adafruit_Neopixel with 56 light effects (WS2812fx by Harm Aldick) and did it that way, it was easier for me cuz I'm not the best programmer and I'm still learning the basics
that looks like a really nice library. You just call .service() as often as you like to get it to do one step, and it takes care of all the timing details. And you can check buttons, etc. in loop() as you like.
kk, I haven't soldered anything yet, the voltage was getting through so I assumed it was fine. I'll test it again with the solder, is my code fine? I was looking at another forum post earlier and it said I had to connect A4 to SDA and A5 to SCL, and solder the logic bridge 5v to IOREF. I'll try soldering the headers and terminals and retesting it.
Wait the block terminals are the green bits right? That came attached when I bought it.
when you probe loose electrical connections with a meter, you’re often temporarily completing the connection well enough to get a measurement, but it’s misleading, because it won’t be stable once you remove that pressure
Here is my current setup the headers are soldered along with the logic bridge, I still can't get the motor to run.
code:
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
void setup() {
AFMS.begin();
myMotor->setSpeed(150);
}
void loop() {
myMotor->run(FORWARD);
}
oh ok, didn't think about that, thx
“logic bridge”? also, how are you powering the motor?
the photo isn’t clear enough to tell what’s going on here. what are the red and black jumpers across the shield? are they soldered?
the jumpers weren't soldered, I was following the diagram I saw in another forum:
https://forums.adafruit.com/viewtopic.php?p=1014630&hilit=arduino+shield+v3#p1014630
I'll try to solder it and retry, unless I'm doing it wrong
exactly which Arduino board are you using?
mega 2560
which rev?
it says adafruit motorshield v3 on the front, it's not the rev3 motorshield though
which rev of the Mega board? do the SCL/SDA pins match the shield locations? the forum post you linked to is for older revs of Arduino board that lack dedicated I2C routing
sorry I'm new to this. wdym by rev of the mega board. The pins are lined up properly though
does the Mega board have pin header locations labeled SCL and SDA, and if so, do they line up with the same pins on the shield?
the SCL and SDA pins of the shield are lined up with the SCL1 and SDA1 of the mega board
ok can you try loading a I2C scanner sketch to see if it finds the shield?
How would I do that? what's a scanner sketch?
I'm trying to load it, but my serial monitor is stuck on loading
that looks like the Arduino web IDE. people have reported lots of problems with it, i think. maybe try the Arduino desktop?
I'll try downloading it and updating you
It says there are no I2C's
I ran
//
// SPDX-License-Identifier: MIT
// --------------------------------------
// i2c_scanner
//
// Modified from https://playground.arduino.cc/Main/I2cScanner/
// --------------------------------------
#include <Wire.h>
// Set I2C bus to use: Wire, Wire1, etc.
#define WIRE Wire
void setup() {
WIRE.begin();
Serial.begin(9600);
while (!Serial)
delay(10);
Serial.println("\nI2C Scanner");
}
void loop() {
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
WIRE.beginTransmission(address);
error = WIRE.endTransmission();
if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");
nDevices++;
}
else if (error==4)
{
Serial.print("Unknown error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}
But this is what my serial monitor outputted:
Scanning...
No I2C devices found
yeah, it’s probably still not connected correctly. could you take a clear photo of the current wiring? and did you solder the jumper for the I2C voltage? (5V is probably right for the Mega, but you should check)
If you're talking about the jumper right in front of the motor port, there was a black piece that came in the box I attached, it isn't soldered though
sorry, are you sure about SDA1 and SCL1?
I am looking at the board here:
https://docs.arduino.cc/hardware/mega-2560/
andi only see pins SDA and SCL, I don't see SDA1 and SCL1
and looking at your photo, looks like not all header pins are soldered
this is the most likely cause
most of those solder joints look cold, with the pad barely wetted by the solder. they’re likely not making good connections. they need to be reflowed, and some might need more solder
i can see actual gaps around the SCL and SDA pins
i meant the logic voltage jumper. looks like you set it to 5V
The pins on the left need a going-over too...
Looks like you might have a little (potential) bridging going on there.
though supposedly, that rev of the shield is supposed to default the logic voltage to IOREF, so you might not need that solder jumper @signal dome
Ok I resoldered. here's what i got for the i2c
Scanning...
I2C device found at address 0x60 !
I2C device found at address 0x70 !
done
I can probably unsolder the logic jumper later, as the stepper motor I have is 12V.
You still need to power your motor shield from a 12V power supply, if that's what your motor needs.
It cannot work straight from Arduino
I have a 5V motor i'm using to test it rn. I can get a 12V source though.
Powering the shield is still necessary.
Either the motor won't work, or you will burn your Arduino.
If i run the 5V motor shouldn't it be fine? I'll make sure to get a 12V power source before running the stepper
I'll find a battery. thx
My motors work now, thank you all for the help. I really appreciate it
Any interest in a bug report for the Airlift Breakout running with the WiFiNINA package downloaded from the link in the Learn guide for the breakout. MCU in use is a Pi Pico, and while I very much doubt it's causing the problem, it's using a userdefined set of pins for SPI rather than whatever the default is on the Pi Pico.
Hey so I'm having problems with an ESP32S3 board, the compiler keeps saying there's multiple "SD.h" libraries and the "FS.h" library supplied with the ESP32 boards library prints out a bunch of errors that look like this:
C:\Users\jaide\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.16\libraries\FS\src/FS.h:24:10: fatal error: memory: No such file or directory
#include <memory>
^~~~~~~~
compilation terminated.
What is the bug? We are always interested in issues, but let’s figure out where to report the problem.
The multiple libraries are a warning, so you can put that off until later. However, it looks like there may be something wrong with that FS library, as most header files have a .h (for "header") extension, like memory.h and that one doesn't. You could look for a file just named "memory", but it seems odd to me.
@edgy ibex I don’t think there are default pins for spi on pico
in fact, it is indeed code from FS library for ESP32 Arduino core:
https://github.com/espressif/arduino-esp32/blob/master/libraries/FS/src/FS.h
can you copy the error messages about multiple versions of the library?
and also tell which board you have selected in Arduino ide?
Ahh - that's good to know. In any case, I'd specified a set of pins, and that worked fine.
Possible Airlift Breakout Bug
anyone knows what is the value of size_t for ESP32 Arduino core (to be precise, ESP32S3 if it matters)?
Likely a uint32_t, but you can override the casting if you need to
has anyone else gotten lots of random segfaults with a debugger attached to a nRF52840, but only if BLE is being used in the code? the code runs fine if no debugger is attached
On the newer nRF SDK, I’ve struggled getting Bluetooth to enable on the nRF52811, it hard faults and doesn’t return 🥲
52811 is a trimmed down 52840
M4, just less ram and flash
This is even using the nRF examples so it’s possible newer bootloaders could be causing issues
ugh, i was hoping it was something weird with how Bluefruit use FreeRTOS. not going to have time soon to try out the nRF SDK or raw SoftDevice
in related news, turning on Serial1 debug on Arduino causes spins deep in FreeRTOS due to task list corruption, because TinyUSB calls logging functions from inside ISRs
🥲
I haven't tried that in a long time, but I remember if I set any breakpoints it would break BLE because of the timing requirements.
thanks. even if i just turn on RTT, that seems to throw things off enough that it segfaults
Hey can someone quickly help me correctly setup platformio?
For some reason code completion isn't working at all and it doesn't even know that PINTachOuter and the other ones are undefined
I created a new platformio project, cloned my existing code into main.cpp, added the libraries in pio
https://devzone.nordicsemi.com/f/nordic-q-a/17/how-can-i-debug-a-softdevice-application
apparently this is a known issue. seems like resuming from a halt causes an assertion failure. it sounds kind of like it might be because the radio peripheral keeps running, but its state is out of sync with what the SD expects?
When I'm running a BLE application with the debugger, and the CPU halts on a breakpoint, it seems to end up in the assert handler when I start it again. How can
Thanks, that explains what I was seeing. Maybe I even read that at the time.
I remember it failing on asserts
and running a RTT client might disrupt timing enough to cause similar problems, even if it doesn’t halt (i imagine that reading the MEM-AP to get RTT data can cause wait states for the core)
i’m used to being able to debug USB device firmwares and not have them blow up at breakpoints. then again, USB peripherals usually offload all the low-level stuff that has microsecond-level turnaround requirements, so i just have to worry about higher-level timeouts around tens of millisecond, many of which are recoverable
i probably ended up doing printf debugging, and/or pin toggling.
platform.io configuration is extremely picky, unfortunately. i never got it to work quite right for me. i remember the Arduino support was especially difficult
https://github.com/Xinyuan-LilyGO/LilyGO-T-A76XX when trying to download the library i can’t get it to add. i did try removing the “master” at the end. any ideas ?
also tried moving it to the lib folder , doesn’t show in the listings
There are detailed instructions in the README https://github.com/Xinyuan-LilyGO/LilyGO-T-A76XX?tab=readme-ov-file#4️⃣-arduino-ide-quick-start , do they not work ?
no luck… MacOSX Arduino IDE 2.3.2
the suggested method is:
- download the zip archive
- unpack/extract it
- in the extracted folder find sub-folder
lib
- manually copy all files/folders from
libto your arduino library folder (by default, on Mac it is/Users/{username}/Documents/Arduino/libraries)
so you would have, e.g. /Users/{username}/Documents/Arduino/libraries/ArduinoHttpClient
Yes, this is extremely ugly way of istalling arduino libraries
I am trying to add an oled display to a diy breadboard mintysynth to display current pot values. I have some basic idea of what to do, but I'm having difficulty putting it all together.
Hello everyone,
I'm really new to programming. I created a small program with Arduino IDE, it works ^^
I wanted to give it a visual aspect, that is to say a logo at startup which remains for example 4 seconds.
I don't know at all how to do it, I have an EPS8266 card with an SSD1306 screen.
My current program has just one main file and I understand that it is necessary to create another file "logo.h".
I have already taken information on how to create an image file for OLED screens: https://javl.github.io/image2cpp/
If anyone can tell me that would be great.
Thank you so much
display with logo
thank you, works perfectly
When I hit build project on platformio it tries to build and then also displays the (syntax-) errors i put in the problem panel but it doesn't update and there's still no code-completion or function peeking or whatever
Hello guys I ran into an issue the Arduino IDE does not open in full screen, I tried restarting the pc several times but the problem persists:
In the image you can see that it is there but it won't open, Do you know what the solution for this could be?
I'd suggest asking in https://forum.arduino.cc/ and including some larger screen shots
press win+arrow right a few times
it might be on a different workspace or outside visible area on the monitor
Hi all,
I've been trying to understand why my ESP8266 card doesn't want to connect to WiFi for several days and I finally solved the problem, the password and SSID include special characters: "!@#$%^&*( )-_+=[]{}|;:,.<>?" Is it possible to find a function to add so that it supports these special characters? Thank you so much
problem solved, thanks anyway 😄
my student is trying to connect an esp32 s3 rev tft, but keeps on getting the wrong board in the port name; usbmodem101 (ESP32 C3 dev module). using Arduino IDE. what to do?
c3, not s3?
has your student installed the Espressif board support package in Arduino? The name of the port may not matter if they can successfully set the proper board in the Board menu, and the name is corret in the lower-right hand corner of the Arduino window.
Hey all. Is it possible to build a serial connection using the USB port on circuit playground express? I want to write some local software to send commands to the CPE to change lights
The CPX shows up as a serial port (COM port on Windows, /dev/cu.* on Mac, etc.). Usually one uses this to talk to the REPL (>>> prompt). However, you can also write a program (say, a Python script) on the host computer to talk to a running program on the CPX. The CPX code can use input() or sys.stdin.read() to read data.
In addition, you can activate a second serial port that is independent of the REPL. See https://learn.adafruit.com/customizing-usb-devices-in-circuitpython/circuitpy-midi-serial#usb-serial-console-repl-and-data-3096590
Thanks danh, I've been reading over at https://arcanesciencelab.wordpress.com/2019/08/05/working-with-the-adafruit-circuit-playground-express-using-the-raspberry-pi-4-part-4/
Seems to be working... is there a way to non-blocking version to read - I don't presume I can add threading to the CPE 😄
are you doing this in arduino or circuitpython?
we're in the wrong channel maybe
circuitpython
and if circuitpython, are you using the secondary port?
no, primary
you can user supervisor.runtime.serial_bytes_available to find out if there's any input to read
Oooh, checking
Hi everyone,
I have a problem with LCD NV3030B . I found a library that works well with the Arduino Uno. Can someone help me make it work with the ESP DVKits v1 or another ESP32?
https://github.com/nstepanets/NV3030B
the LCD works on the UNO? but not on the ESP?
i try this code
“`#include <Adafruit_GFX.h>
#include <Adafruit_NV3030B.h>
#include <SPI.h>
// Define the pin connections
#define TFT_CS 15 // Chip select control pin
#define TFT_DC 2 // Data/command control pin
#define TFT_RST 4 // Reset pin (could connect to Arduino RESET pin)
// Initialize the Adafruit_NV3030B object
Adafruit_NV3030B tft = Adafruit_NV3030B(TFT_CS, TFT_DC, TFT_RST);“`
This is for all the pins I use.
GND (display) -> GND (ESP32)
VCC (display) -> 3.3V (ESP32)
SCL (display) -> GPIO18 (ESP32, SCLK)
SDA (display) -> GPIO23 (ESP32, MOSI)
RES (display) -> GPIO4 (ESP32)
DC (display) -> GPIO2 (ESP32)
CS (display) -> GPIO15 (ESP32)
BLK (display) -> GPIO21 (ESP32)
whats the name of the board selection in Arduino IDE? under Tools-> Board
is it DOIT ESP32 DEVKIT V1 ?
hmm. not sure then.
those connections seem fine
that's the right SPI pins for that board def:
https://github.com/espressif/arduino-esp32/blob/d164df89de350aa945ccb0cb4261f56306bfdb3c/variants/doitESP32devkitV1/pins_arduino.h#L16-L19
and the same hardware worked ok on the UNO?
is it logic level maybe?
I'm trying to run this code:
#include <Keypad.h>
#include <Wire.h>
#include <Adafruit_LiquidCrystal.h>
// Define the keypad connections
const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns
char keys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {23, 25, 27, 29}; // Connect to the row pinouts of the keypad
byte colPins[COLS] = {31, 33, 35, 37}; // Connect to the column pinouts of the keypad
// Create the keypad object
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
// Initialize the LCD object. The default I2C address for the Pi Plate is 0x20
Adafruit_LiquidCrystal lcd(0);
// Setup function
void setup() {
// Start the serial communication
Serial.begin(9600);
// Initialize the LCD with 16 columns and 2 rows
lcd.begin(16, 2);
lcd.setBacklight(LOW); // Turn on the backlight
lcd.print("Keypad Ready");
}
// Loop function
void loop() {
char key = keypad.getKey();
if (key) {
// Print the key to the serial monitor
Serial.println(key);
// Print the key to the LCD
lcd.clear();
lcd.print("Key Pressed: ");
lcd.print(key);
}
}
But i get this error
In file included from C:\Users\hgodhrawala24\Documents\Arduino\I2Ctest\I2Ctest.ino:3:0:
C:\Users\hgodhrawala24\Documents\Arduino\libraries\Adafruit_LiquidCrystal-master/Adafruit_LiquidCrystal.h:9:31: fatal error: Adafruit_MCP23X08.h: No such file or directory
#include <Adafruit_MCP23X08.h>
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I can't find any library named Adafruit_MCP23X08. I've downloaded this one though: https://github.com/adafruit/Adafruit-MCP23008-library.
that library is deprecated
you want this one:
https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
should be available in the Arduino Library Manager
search for Adafruit MCP23017 Arduino Library
in arduino
#include <Wire.h>
#include <Adafruit_LiquidCrystal.h>
// Define the keypad connections
const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns
char keys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {23, 25, 27, 29}; // Connect to the row pinouts of the keypad
byte colPins[COLS] = {31, 33, 35, 37}; // Connect to the column pinouts of the keypad
// Create the keypad object
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
// Initialize the LCD object. The default I2C address for the Pi Plate is 0x20
Adafruit_LiquidCrystal lcd(0);
// Setup function
void setup() {
// Start the serial communication
Serial.begin(9600);
// Initialize the LCD with 16 columns and 2 rows
lcd.begin(16, 2);
lcd.setBacklight(LOW); // Turn on the backlight
lcd.print("Keypad Ready");
}
// Loop function
void loop() {
char key = keypad.getKey();
if (key) {
// Print the key to the serial monitor
Serial.println(key);
// Print the key to the LCD
lcd.clear();
lcd.print("Key Pressed: ");
lcd.print(key);
}
}
in esp32
Wiring Connections:
GND -> GND (ESP32)
VCC -> 3.3V (ESP32)
SCL -> GPIO18 (ESP32, SCLK)
SDA -> GPIO23 (ESP32, MOSI)
RES -> GPIO4 (ESP32)
DC -> GPIO2 (ESP32)
CS -> GPIO15 (ESP32)
BLK -> GPIO21 (ESP32)
**/
#include <Adafruit_GFX.h>
#include <Adafruit_NV3030B.h>
#include <SPI.h>
#define TFT_CS 15
#define TFT_DC 2
#define TFT_RST 4
// Initialize the Adafruit_NV3030B object
Adafruit_NV3030B tft = Adafruit_NV3030B(TFT_CS, TFT_DC, TFT_RST);
void setup() {
Serial.begin(9600);
Serial.println("NV3030B Test!");
tft.begin();
Serial.println(F("Benchmark Time (microseconds)"));
delay(10);
Serial.print(F("Screen fill "));
Serial.println(testFillScreen());
delay(500);
Serial.print(F("Text "));
Serial.println(testText());
delay(3000);
Serial.print(F("Lines "));
Serial.println(testLines(NV3030B_CYAN));
delay(500);
Serial.print(F("Horiz/Vert Lines "));
Serial.println(testFastLines(NV3030B_RED, NV3030B_BLUE));
delay(500);
Serial.print(F("Rectangles (outline) "));
Serial.println(testRects(NV3030B_GREEN));
delay(500);
Serial.print(F("Rectangles (filled) "));
Serial.println(testFilledRects(NV3030B_YELLOW, NV3030B_MAGENTA));
delay(500);
Serial.print(F("Circles (filled) "));
Serial.println(testFilledCircles(10, NV3030B_MAGENTA));
Serial.print(F("Circles (outline) "));
Serial.println(testCircles(10, NV3030B_WHITE));
delay(500);
Serial.print(F("Triangles (outline) "));
Serial.println(testTriangles());
delay(500);
Serial.print(F("Triangles (filled) "));
Serial.println(testFilledTriangles());
delay(500);
Serial.print(F("Rounded rects (outline) "));
Serial.println(testRoundRects());
delay(500);
Serial.print(F("Rounded rects (filled) "));
Serial.println(testFilledRoundRects());
delay(500);
Serial.println(F("Done!"));
}```
The LCD works with the Arduino Uno, but not with the ESP32.
@leaden walrus I uploaded this code, and it works fine with the same wire and LCD!!!
^^ that's the code that works on the UNO?
Without changing anything, the code is working, and the graphical LCD is functioning. I'm confused 😮
I will try it with the Uno right now.
oh. wait. it's working on the eps32 now?
yes
I'm confused
the SPI pins are set behind the scenes
that's why they don't show up explicitly in code
the ESP32 Arduino Board Support Package is taking care of these pins (SPI pins):
SCL -> GPIO18 (ESP32, SCLK)
SDA -> GPIO23 (ESP32, MOSI)
so they must match the hardware SPI pins for the board being used
which it looks like you are doing
these other pins are just digital pins:
RES -> GPIO4 (ESP32)
DC -> GPIO2 (ESP32)
CS -> GPIO15 (ESP32)
and could be any available digital pins
code just needs to be updated to match
which you've also done
#define TFT_CS 15 // Chip select control pin
#define TFT_DC 2 // Data/command control pin
#define TFT_RST 4 // Reset pin (could connect to Arduino RESET pin)
which esp32 you advice me to use
I used this code, but i'm getting errors in the mapping. for example, if I press 1 i get 5, if i press 2 I get 8, and the third column never outputs anything. also although the serial monitor displays something. the lcd screen doesn't. (it just lights up).
#include <Keypad.h>
#include <Wire.h>
#include <Adafruit_LiquidCrystal.h>
// Define the keypad connections
const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns
char keys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {23, 24, 25, 26}; // Connect to the row pinouts of the keypad (from pin 23 to 30)
byte colPins[COLS] = {27, 28, 29, 30}; // Connect to the column pinouts of the keypad
// Create the keypad object
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
// Initialize the LCD object. The default I2C address for the Pi Plate is 0x20
Adafruit_LiquidCrystal lcd(0);
// Setup function
void setup() {
// Start the serial communication
Serial.begin(9600);
// Initialize the LCD with 16 columns and 2 rows
lcd.begin(16, 2);
lcd.setBacklight(LOW); // Turn on the backlight
lcd.print("Keypad Ready");
}
// Loop function
void loop() {
char key = keypad.getKey();
if (key != NO_KEY) {
// Print the key to the serial monitor
Serial.println(key);
// Print the key to the LCD
lcd.clear();
lcd.print("Key Pressed: ");
lcd.print(key);
}
}
This is the wiring. I have no clue what's causing the mixup.
they followed the primary guide, so i assume so (which is not the right thing to do with student :)). they can choose the correct board, but the type is wrong in the port tab. and that is the same as down to right corner. they get an error upon uploading.
you dont have to go to the repository of esp/arduino right? they can folllow the rest of the guide?
your picture doesn't show what is actually connected to what, if the pins are correct. you need to take pics of the peripherals too (also, the red wire in scl looks broken)
The board definitions link looks correct, so there should be no need to check the espressif repo.
Do they have multiple boards connected to the computer?
Also, make sure they use the installed version of the Arduino IDE, the online one doesn't work great.
Is this better?
I replaced that red wire as well with another one
Only slightly better, haha ... still can't see clearly how the keypad is connected 😅
But it does seem like one of the pins is connected to pin 22 on the Arduino, and you declared in code rows 23-26 and columns 27-30
The LCD lighting up, but not showing any characters may be a problem of contrast ... do you have a small potentiometer next to the LCD ? If you do, you need to adjust that until characters are visible.
ok, sorry for the extra ping, but I got the keypad working by using your tip and messing with the code. for the LCD I don't have a potentiometer connected, Although if this makes a difference the LCD does display boxes for where the digits should be. I don't know how to use a potentiometer to be honest, but I can get one.
The yellow thingie marked contrast is the pot 🙂 You need to turn it slowly with a small screwdriver until you can see clearly on the LCD
Oh I thought you meant an extra one like this. I turned it all the way, it displays like the earlier picture when I turn it all the way it, if I turn it the other way the boxes dissappear. Text won't appear though
Nvm I figured it out, I used a different library in the code and it worked for some reason
Yea, figures, I was checking what library would work with the LCD you have, since it's a board designed for raspberry pi.
Which one does it work with ... just out of curiosity ?
it's
#include <Adafruit_RGBLCDShield.h>
I'm trying to use 5 motor shields. Is the gap too big for the connection?
No, that's not necessary. I have the "esp32 by Espressif Systems" board manager installed. It displays the correct board for me on versions 2.0.15 and 2.0.16.
Which version of Arduino IDE are they using, and on what operating system? And there are many settings in the Tools menu that need to be right:
(This is on Linux.)
If it's on Windows, it's possible that a driver has been installed for another similar board, and that's why it's identifying as that board. That may have nothing to do with the uploading problem.
IF the UF2 bootloader is installed, the upload mode can be "TinyUSB". If the UF2 bootloader is not installed, then it can be installed, or you can use the "UART0/Hardware CDC" mode, but then it has to be put into ROM bootloader mode, by holding down the BOOT button and pressing RESET.
I think I figured out another problem. my 12V batteries aren't giving 12V of power. it's giving 4-6V when plugged. But when I test an unplugged battery it gives 12V. How do I solve the voltage drop
what kind of batteries are they?
sounds like they are sagging from too much current being drawn
Amazon basic 12v batteries
can you give me the amazon link?
what kind of motors are you trying to drive, and how many?
never mind, found the battires
this is a very low-current battery. it's basically stacked coin cells. It has a capacity of about 55 mAh. It's design to power key fobs, Bluetooth headsets, etc., garage door openers (radio) etc.
is there anyway to run motors on it?
only the tiniest motors. It's not suitable for motors at all, really
which motors are you using?
that battery has about 1/10 the mAh capacity of a AAA battery
I'm using these: Adafruit Accessories Stepper Motor NEMA17 12V 350mA
the A23 is desinged to supply only about 1mA
Could it work with a 5V hobby motor?
no
would a 9V battery work with a 5V hobby motor?
it would make it run too fast, probably not good for it. What's the application?
a stepper motor is a specialized thing, designed to hold its position. when doing so it draws a lot of current
It's a school project. I'm designing the electronics of a vending machine. the problem is its due tomorrow. I have 5V stepper motors as well I could use. Is there no way to code for just using 5V
is this a design project or are you building a prototype?
a vending machine doesn't need to run on batteries. You can use a 5v power supply
Building a protrotype. I have one variable power supply, but don't I need 5. one for each shield?
I need to run 9 motors. I have 5 shields
do you need stepper motors for precision? What's the amp rating of the variable power supply?
what's its voltage range?
Ideally I'd use stepper motors bc I said I'd use them in my project. I could probably use dc motors if there's no other option
power supply can supply 5A (I did a websearch). so 350mA motors *9 = 3.15A. So OK.
I think you are not going to get much sleep. Good luck!
you wouldn't want to use steppers in a vending machine though, because it would take too much power. Unless you have some mechanism for turning them off when not in use and they won't slip
and if you're not going to run all of them at once, then no problem
How would I connect one power supply to 5 shields though?
just run five wires from a terminal. You need some way to connect multiple wires together, like a terminal strip
e.g on one side you run a jumper one screw to another five times. On other side you run a wire to the shield five times
I don't have a terminal. Could a breadboard or smth work?
Wire nuts, Wago connectors, bus bars, anything like that.
An ordinary 6V lantern battery might power them.
breadboard isn't designed for such large currents. I don't know if the shield has multiple connection points for the motor voltage. If so you could daisy chain, but use heavy wire and tighten well
... how fast would the 9v battery on the 5v motors be. Would anything blow?
the 9v battery cannot drive the steppers
it won't supply enough current
your power supply is fine!
Can it drive a DC
From the motor guide:
You can't run motors off of a 9V battery so don't waste your time/batteries!
OK so I got a bit of a weird one.
I'm designing a signal light system out of neopixels. I've turned on the left turn signal by pressing a button, meaning it is currently flashing without any input. Then I hit the brake lever and the right turn signal on the same neopixel strip turn solid red. Is it possible to do this without interrupting or restarting the flashing of the left turn signal?
Take a look at the e-part "Multi-tasking the Arduino" guide here: https://learn.adafruit.com/search?q=multi-tasking
It can also be done easily in CircuitPython with asyncio: https://learn.adafruit.com/cooperative-multitasking-in-circuitpython-with-asyncio. The independently blinking NeoPixels example is https://learn.adafruit.com/cooperative-multitasking-in-circuitpython-with-asyncio/concurrent-tasks#blinking-leds-with-asyncio-3106269
But I suggest you start from the beginning of that guide.
MULTI-TASKING
that's what I couldn't remember the word to google it. Thank you so much.
Theyre using Macos, 13 and 14 and latest Arduino IDE. they have just tried wippersnapper, which worked fine, and come from there to arduino using the guide (i dont think they used the espressif repo). i will have a look at the upload mode, and their exact error message.
This is the error message:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
exit status 1
Compilation error: exit status 1
problem solved thanks for the help
Great! What was the fix?
I opened terminal and typed: xcode-select --install
Hey everyone. Brand new to arduinos and have a question. I see the NeoPixel Ring - 24s have a timing-specific protocol. Would a Tiny2040 be able to run two of these?
Ultimately, I would just need them to randomly flash their LEDs.
Yeah, should be able to. You can hook them end to end and run them on a single pin. Note that the ItsyBitsy has a 5V level shifter built in, which is useful for running NeoPixels.
Ok, thanks. Space is really limited, so I'll see if it fits.
I'll often peel the innards out of USB chargers to save space.
Like this update I built for an odd antique homemade decoration. While there was plenty of room, I still removed the charger innards (small board at lower left) along with the plug prongs, so I could just solder wires to it.
Whoops, that reply went with another conversation.
Still on the Arduino topic, as the controller (small daughterboard on left) is a 32U4.
I have another error. My keypad and lcd both work. But my motors don't spin (ignore the weird LCD matrix. i think my wiring was wrong at some point, but it maps right):
code:
#include <Keypad.h>
#include <Wire.h>
#include <Adafruit_RGBLCDShield.h>
#include <Adafruit_MotorShield.h>
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_DCMotor *myMotor = AFMS.getMotor(1);
// Define the keypad connections
const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns
char keys[ROWS][COLS] = {
{'D', '#', '0', '*'},
{'C', '9', '8', '7'},
{'B', '6', '5', '4'},
{'A', '3', '2', '1'}
};
byte colPins[COLS] = {26, 27, 28, 29}; // Connect to the column pinouts of the keypad (from pin 26 to 29)
byte rowPins[ROWS] = {22, 23, 24, 25}; // Connect to the row pinouts of the keypad (from pin 22 to 25)
// Create the keypad object
Keypad keypad = Keypad(makeKeymap(keys), colPins, rowPins, COLS, ROWS);
// Initialize the LCD object
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
void setup() {
// Start the serial communication
Serial.begin(9600);
// Initialize the motor shield
AFMS.begin();
myMotor->setSpeed(150); // Set motor speed
// Initialize the LCD with 16 columns and 2 rows
lcd.begin(16, 2);
lcd.setBacklight(0x6); // Turn on the backlight (blue color)
lcd.print("Keypad Ready");
}
void loop() {
char key = keypad.getKey();
if (key != NO_KEY) {
Serial.println(key);
if (key == 'A' || key == 'B') {
lcd.clear();
lcd.print("Motor Spinning: ");
lcd.print(key);
// Run motors when 'A' or 'B' is pressed
myMotor->run(FORWARD);
} else if (key == '*') {
// Clear LCD when '*' is pressed
lcd.clear();
lcd.print("Cleared LCD");
} else {
lcd.clear();
lcd.print("Symbol: ");
lcd.print(key);
}
} else {
// Stop motors if no key is pressed
myMotor->run(RELEASE);
}
}
I already ran an i2c test and 0x60 and 0x70 came through.
What are you using as a motor power supply?
12v was coming through to one motor. I'm replacing the motors currently
M1 gives a slight humming sound. and the port reads 12V.
M2 doesn't read any voltage
The code doesn't do anything with motor 2.
Oh ok. Is my wiring right?
That wiring diagram is for a stepper motor, and the code is set up for a brushed DC motor.
Ok, I have the adafruit ST7735 display and everything is correctly wired with a custom pcb that i made, but it wont display bitmaps. its not an issue with the sd card, and all the libaries are up to date, is there a best way to convert images into bitmaps that can be read by the display?
I have this board it is not showing up in Arduino ide. https://learn.adafruit.com/atmega32u4-breakout/using-with-arduino
When pressing the reset button it wont result in the led blinking (not trigerring bootloader mode)
Tried multiple cables, and it wont show up in device manager.
Does an unrecognized device show up (possibly under Other Devices rather than Ports)
Did you try double tapping the reset button?
Yes, double tapping to see if it shows up in the device manager. It didn’t. Is there anything beyond that o could try?
Hmm... install drivers ?
Are you on windows ?
Yes, you mean drivers for that particular device?
Make sure to click Scan for new Hardware changes in device manager after bootloader procedure, it should show up under one category or other if needing a driver.
Wouldn't the bootloader LED light up anyway without drivers?
What do I look for in the other categories?
probably something like "unrecognized device", if it's missing driver
Your board is discontinued, but the other Adafruit board using that microcontroller mentions windows drivers https://learn.adafruit.com/introducing-circuit-playground/windows-driver-installation
You shouldn't need them on win 10+
this but the micro isnt even plugged in
well, it looks like windows sees it ... many times over, lol
the board i have isnt listed here:
are you using arduino ide installed, or the online version ?
the installed version
if i unplug it those still show up - nvmd after relaunch its gone
ok, so if you plug the board , with device manager open, does something show up?
no
yes, nothing even after pressing or double tapping
windows doesn't see it at all then
if you could try a different machine, it would help to check it's a board problem
nothing pops up on macOS either
That is an unusual board because it has a mini-USB jack, I think? Since the cables are rare are you sure it's a data and not a power-only cable (even multiple cables)?
hello guys, please does anyone use the Kalman filter with the BNO055?
this is for a rocket project
BNO055 has data fusion on chip, which already includes various filters (details are not published, but I expect they use Kalman filter, too). Thus, normally you do not need to apply any other filters on top of it.
... unless you want to actually control the filter parameters.
By my knowledge, I was of the idea they only use a complementary filter at best.
I would love to have that kind of flexibility
Well, it's running a Cortex-M0 internally I believe. With no meaningful documentation on what processing they do internally, I wouldn't trust it either.
I am trying to display the next bus arrival time on a sh1106 and a esp8266, but I can't get it to work.
What happens? What doesn't happen? What have you tried?
I'm at the point now where I get a json parse error. I am able to view the api data in a web browser, but it is quite large.
I'd take a "divide and conquer" approach. Maybe set up a trivial web server somewhere to fetch data from that returns a small amount of JSON.
That's a good idea. I'll give it a shot. Thanks
That worked extremely well! Thank you!
Hey guys, I am working on a rocket project.
I am trying to get my flight computer turn on the Runcam split 4 camera; 10minutes after launch.
I would appreciate it if anyone that has experience with this setup could help. Thank you.
Are you using a custom PCB of your design or is it bought? I need to see the wiring to be able to help. Thanks in advance
We will be using a custom pcb that we will design and order
Do you just need to switch power to the camera, or send it initialization data, or what? I don't know anything about this particular camera, or what it requires.
We need to switch it on; then send a command to start recording, 10 minutes after our rocket flight computer is turned on.
Our flight computer microcontroller is a teensy 4.1
It looks like the camera can do that for you, you just send it commands to turn on, start recording, etc. Apparently there's an asychronous serial protocol to do so.
Pls fix: ```c
// Try Everything! Happy Hacking :slight_smile:
#include <Arduino.h>
#include <LiquidCrystal_I2C.h>
#include <Keypad.h>
#include <Stepper.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {{'1','2','3','A'},{'4','5','6','B'},{'7','8','9','C'},{'*','0','#','D'}};
byte rowPins[ROWS] = {9, 8, 7, 6};
byte colPins[COLS] = {5, 4, 3, 2};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
Stepper stepper_1(2048, 13, 11, 12, 10);
char key;
bool isKeyPressed(){
key= keypad.getKey();
return key!=0;
}
void _delay(float seconds) {
long endTime = millis() + seconds * 1000;
while(millis() < endTime);
}
void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
lcd.backlight();
stepper_1.setSpeed(1);
}
void loop() {
if (isKeyPressed()) {
Serial.print(key);
if ((key == String("") + String("#")) || ((key == String("") + String("*")) || ((key == String("") + String("A")) || ((key == String("") + String("B")) || ((key == String("") + String("C")) || (key == String("") + String("D"))))))) {
stepper_1.step(receivedDataFromSerial * 5.68);
_delay(0.5);
}
}
}```
see #welcome message for how to paste code
I use serial for saving integer
What’s the issue? Does it build, if so, what does it do on hardware?
This feels a bit of a stretch to ask here in the Arduino Forum, but I wonder if anyone has ported the Adafruit SSD_1306 library to work on the CH55x series. I was starting down this path and wasn't sure if anyone had already tackled it.
Rotating stepper motor like you typed on keyboard
You're comparing incompatible data types. I'm not sure what your string comparisons are trying to do, but they're all going to fail. You might want something like:
void loop() {
char key = keypad.getKey();
switch (key) {
case '#':
case '*':
case 'A':
case 'B':
case 'C':
case 'D':
stepper_1.step(key * 5.68);
_delay(0.5);
break;
}
}
Please help with my library
I fix bool in header and c++ file
So you have it sorted?
pinMode is part of the Arduino core. not sure what you are trying to do there.
this should just work. no need for the #include or the other files
also, there's no return, so the serial print won't show anything
you generally don't want to use a literal integer for the second parameter, instead use INPUT, OUTPUT, or INPUT_PULLUP
I need help, I'm using a Adafruit RFID/NFC shield for the Arduino and I'm using the example code "mifareclassic_updatendef" which works great but lets say i want to add more information to the tag say two different websites URLs and some phone numbers how do I go by doing that?
You can write your info in different sectors of the tag, number of the sector is the first param of
nfc.mifareclassic_WriteNDEFURI(1, ndefprefix, url);
Just create multiple urls, with whatever ndefprefix you want, and write them in different sectors ( the available ndefs are here: https://github.com/adafruit/Adafruit-PN532/blob/f4e1a91afd0163d8601b243ddcbb2a580da6552a/Adafruit_PN532.h#L94 )
Ohh okay and I notice that the line you showed is stored in "success" do I have to make a new variable for each additional information or can I also just use success to store all the different URLs?
the success variable is used there just to test if the info was written correctly, so after you print the success / fail message for one sector, you can reuse it for the following sector writes
Ohh Okay I understand thank you so much I appreciate you
hello. I've been working on a small project driving a stepper via a TMC2208 and i was planning to use a qtpy M0 for the logic. Everything works fine on other boards, but moving it to the qtpy i encounter a strange error where the board stops starting up. After some tests I found that there is a short between 3v and ground
has anyone run into this?
Sometimes a voltage surge will damage something and it will fail shorted.
ahh yeah, that makes sense. thanks!
Hi guys, I am having an error where my ESP32-S3 Feather No PSRAM boards have all suddenly stopped being able to connect to the serial port of my arduino IDE. I can still upload code to them, but I can no longer connect to them after code has been uploaded. Previously I would have to hold down boot and click reset to get the board to show up (Port 8), then upload, then after I clicked reset it would dissapear and come back as a new port (Port 9). Now after I upload and reset it, the board does not change what port it is recognized as and gives the following error:
Port monitor error: command 'open' failed: Invalid serial port. Could not connect to COM8 serial port.
I have tried factory resetting, switching boards, and switching USB ports but the issue remains
sometimes it also throws this:
00:31:34.377 -> [0;32mI (613) esp_image: segment 0: paddr=00010020 vaddr=3c030020 size=102e0h ( 66272) map[0m
00:31:34.414 -> [0;32mI (623) esp_image: segment 1: paddr=00020308 vaddr=3fc93600 size=02af8h ( 11000) load[0m
00:31:34.414 -> [0;32mI (626) esp_image: segment 2: paddr=00022e08 vaddr=40374000 size=0d210h ( 53776) load[0m
00:31:34.414 -> [0;32mI (639) esp_image: segment 3: paddr=00030020 vaddr=42000020 size=2fec0h (196288) map[0m
00:31:34.445 -> [0;32mI (670) esp_image: segment 4: paddr=0005fee8 vaddr=40381210 size=02308h ( 8968) load[0m
00:31:34.445 -> [0;32mI (678) boot: Loaded app from partition at offset 0x10000[0m
Good morning. Is there a way to have the adafruit version of WiFiNINA co-exist with the Arduino version? I use both kinds of boards from time to time, and well, the Airlift version A. keeps alerting about needing an upgrade due to the name collision, and B. Well many Arduino devices now exist using the ublox modules so switching back and forth becomes problematic
I do not have issues with either driver working, but the name collision is awkward.
Seems like it's still reappearing as a different port. Note that the board doesn't change what port is recognized as, the operating system and drivers do this when USB re-enumerates. With modern operating systems, it's possible to specify what port something should be so it doesn't move.
The easiest approach might be to build a version that avoids the name collision.
You mean a 2nd ide install for each version?
I mean, sure, but I cannot imagine I am the only one with this issue. I just wish the name could be changed. I understand the idea of both the ublox and the "bare" esp32 being named Nina since they are both ESP32s, but...yeah. Just awkward.
I assume the name can be changed, however, I could be wrong
I think you could do this:
- Copy the directory of one of the libraries to another name.
- rename WiFiNINA.h to a different name.
- Make the corresponding change in library.properties
if the modified one gets updated, you'll have to do that by hand. Note that we are working on updating the NINA-FW firmware to make it closer to the Arduino version: https://github.com/adafruit/nina-fw/pull/62. I'm not sure what that implies for the library yet.
Well, updates are always nice!
(changing the version of the library so it stops asking to be updated with the Arduino one would also be nice.)
I dont know how popular the airlift products are to know how much time gets invested in maintaining working code for quality of life, but the shield, and the module both work great.
The current adafruit NINA-FW has newer certs, but doesn't work right with at least some elliptical cryptography chains. That is one of the main things we wnat to fix.
Sounds good 🙂 Working hardware is always nice.
So is it a mismatch of how its connecting vs how its showing up in the IDE? I still can't connect to it after the code is launched
I am just trying to figure out why it suddenly stopped being able to connect
Update: When i factory reset the board, it goes back to connecting on Serial Port 9 as it normall used to, and I am able to read serial messages from the board in my IDE. If I put it back into boot mode it switches back to port 8, and then is unable to recover and leave that port after the code is uploaded. I have tried restarting the program and my computer but no success
I am also unable to upload using the dev board module as suggested in the guide
https://learn.adafruit.com/adafruit-esp32-s3-feather/using-with-arduino-ide
Hi, I am building a MIDI controller with the Adafruit I2C Quad Rotary Encoder. All works well! Is there a way to get the speed at which the encoders are turning via the default library?
While there may be a library function to do so, I do not know of one. I'd probably just get the position two times with a time delay, then divide the difference in position by the time to yield the speed.
The bno085 IMU learn page claims you'll need a >300B uart buffer to use it in UART mode. What MCUs even have that much? It's not an easy stat to look up
it depends on the MCU. most of the ones i've seen have a very short buffer on the UART peripheral, and you get to implement a larger ring buffer on top of that using general RAM
do anyone know why i cant get the brd and the schematics of this https://www.tinkercad.com/things/77aP6Ll5Rw2-copy-of-4-x-7-segment-display-with-74hc595/editel?returnTo=%2Fthings%2F77aP6Ll5Rw2-copy-of-4-x-7-segment-display-with-74hc595 ?
This is a broken link.
And please don't cross post in multiple channels.
wdym by broken link?
this is the original https://www.tinkercad.com/things/dp58KkWWPhV-4-x-7-segment-display-with-74hc595
@eternal cloud can you manage to get the brd file and the schematic file?
or know some way to do it? i cant get it on the page of thinkercad of the dowload of the brd file and schematic, i let it load for 20 minutes an it did nothing
Nah, it just spins the arrows for ages... I think there are just too many objects in the design.
I don't use Tinkecad often, but I did notice at other times that it gets very slow when the design is complex.
do you know if there is any way that i can get the brd and schematics?
No, sorry 😔 I think it's just extremely slow, you can try letting it "work" for a while...
ok ty
do you think that its possible to copy it to another program/site that work better than thinkercad?
or an ai that whit this picture can make the pcb or the brd file?
With a brd and/or sch file, exporting to another program is definitely doable. With just the image, though, it's more of a manual entry kind of job. I don't think there is a board or schematic file associated with this project at all, so your best bet is to draw your own schematic with that project as a reference.
What is your goal for this project? Do you just need the 7-segment display on a board, or are you merging it with an onboard microcontroller?
Wow, direct drive, that brings back memories
Can I use a pair of nrf52840 modules commercially with ble communication or does the project require special licensing because of the Bluetooth specification being used?
Thanks! I ended up implementing your suggestion and it works great.
i just want to recreate that on an pcb, whit eagle
It should not be hard to re-create it. The shift register and digit could be made into a subcircuit and then replicated four times. There are existing Eagle designs of Arduinos you could re-use if you wanted to build the Arduino into your circuit board.
wdym? im not that good at inglish
Instead of drawing the same circuit four times, Eagle will let you draw it once and re-use it
ok
im trying to semplyfy the circuit, i want to download the brd or the shematics on tinkercad, i managed to semplify the connection but it wont still let me dowload it, do you have any idea of why after the seplification it wont still let me dowload?
If I were you, I wouldn't bother with trying to download it, it seems less effort (and a better result) would be to just draft the circuit in Eagle.
can you help me to create it on eagle?
@north stream do you know how i can set the resistor value?
Yeah, click on a resistor to select it and then click on the information or properties button
I haven't used Eagle in a while (switched to KiCAD) so I don't remember the details
<@&617066238840930324> do anyone know how i can use this (image 1) instead of the wires (image 2) ?
Hey guys i have an issue when i try uploading via the arduino IDE onto my Matrix portal M4
maybe someone has an idea what the issue could be
Did you follow all the Arduino steps described in the product guide? https://learn.adafruit.com/adafruit-matrixportal-m4/arduino-ide-setup
I think you can set the allowed wire angles in the drawing screen.
Does anyone know if Power Delivery Modules are interchangeable with Charging Modules?
I am experience crashes on an ESP32S2 during one period where I am updated a string of 512 neopixels quickly for about 30 minutes. My guess is the FastLED code is getting into trouble with the WiFi code.
My uninformed guess is I need to shut down WiFi during this activity.
Does this sound like the likely cause and resolution? or a red herring?
This is a common problem with ws2812 since one needs to turn off interrupts to keep the timing right. FastLED has a page on this with some potential work-arounds that may help: https://github.com/FastLED/FastLED/wiki/Interrupt-problems
And yes, one solution could be to turn off WiFi, probably the largest source of interrupts for you
Howdy, I'm more familiar with CP but wanted to give arduino a shot so I have that running on a QT PY ESP32 Pico. I'm using a STEMMA QT cable to interface the board with the rotary encoder breakout(https://www.adafruit.com/product/4991).
I've installed the seesaw library and its dependents to both arduino 2.3.2 IDE as well as 1.8.19 IDE on different computers, and have tried both the most recent library and the one in the picture on the tutorial.
Still have an issue getting the example code to run ss.begin() or sspixel.begin(), one of the two throws the wrong address. Additionally, if I comment out the while loop for that portion, the button reads fine but it throws a guru panic'ed error after registering the first increment of rotation of the encoder, which honestly I've never encountered before haha.
My guess is that part of the issue may be related to the code mistaking the neopixel on the roatary encoder for the one on the QT PY but I could be wrong, fairly lost on this one.
Code Attached. Output Attached.
Update: I separated the if statement check to see if the board is connected with the encoder and neopixel on the encoder board, and it's definitely not finding the neopixel at the provided address, and it seems like the guru error is related to the when the code tries to change the neopixel color when the rotary wheel changes position and starts writing that information in memory that is not allotted for it because the code is not recognizing the neopixel.
Hey, sorry for the late reply! Yes i did everything like in the guide. The thing is i had an issue before where i had to reset the portal and some nice people over in #help-with-circuitpython helped me with. I had the arduino ide before and was a little confused because the arduino samd and adarfruit samd packages were already installed and it registerd the portal instantly as available device. Since then i have completly reinstalled the arduino ide and redid the steps to reset the matrix portal.
I think it's probably because the QTPY Pico (ESP32) has two available I2C ports, and unusually the StemmaQT port is the second i2c bus, with pins referred to as SDA1 and SCL1.
You'll want to try with Wire1 instead of Wire, and you need to pass a pointer to that wire object (a TwoWire object is an I2C bus) to the SeeSaw constructor like it lists in the header file here: https://github.com/adafruit/Adafruit_Seesaw/blob/master/Adafruit_seesaw.h#L254C2-L254C38
similar code should be available on the qtpy board learn guide - https://learn.adafruit.com/adafruit-qt-py-esp32-pico/i2c-scan-test), but here's an untested modified encoder example for you (notice the ssPixel is setup later and just the object defined earler, also the Wire1 stuff in setup() )
attached:
@humble torrent this pinout from the QT PY ESP32 Pico learn guide shows the two different I2C sets of pins
mentions here that STEMMA QT is Wire1:
https://learn.adafruit.com/adafruit-qt-py-esp32-pico/pinouts#stemma-qt-connector-3119042
unfortunately i don't think there's any consistent split between the header pins and the STEMMA QT pins across the various boards. on a lot of them, they are the same pins. so be sure to checkout pinout info.
Thank you both! I'll look into this. I wasn't sure if the neopixel on the rotary encoder needed its own dedicated I2C pins given they're mounted to the same board. I think the ESP32 has 2 dedicated I2C buses but I'll double check the pinout info to make sure those sets of pins are really different sets of pins.
everything on the stemma qt rotary encoder happens over I2C. also - I2C allows for more than one device to be attached to the same I2C pins as long as each device has its own unique I2C address. for example, the product page shows three stemma qt rotary encoders chained together. the address pads would have been used to set unique addresses for each to allow that.
Does anyone know the GPIO pins for the stemma qt connector on the matrixportal s3? Trying to use the pins in esphome and the help article doesn't give me actual pins:
Thank you! Super helpful
no prob. that info's on the schematic if you need it for other pins:
https://learn.adafruit.com/adafruit-matrixportal-s3/downloads#schematic-3150683
Hey folks!
I have a really odd issue.
I have an Arduino Leonardo board and a Adafruit LED Arcade Button 1x4 STEMMA QT connected to it, with 4 arcade buttons w/ LEDs connected to it.
I have 5 of these Stemmas chained together, each with the same setup.
I have some code to blink the leds on and off.
The first 2 buttons, the led turns on, but does not turn off.
The last 2 buttons, it works as expected.
This happens across all the boards.
Im not sure what the issue could be.
I tested the buttons directly against the arduino, and they work as expected, so it's not a hardware problem with the buttons.
Any ideas?
This is the Stemma board Im using
https://learn.adafruit.com/adafruit-led-arcade-button-qt/pinouts
LED PIN 12 and 13 don't work as expected
LED PIN 0 and 1 do
Could be a power supply problem, or a signal integrity problem, or (of course) a software problem.
im connected to 5v on from the QT to the Arduino, and then the Arduino is powered via USB.
what would represent a signal integrity problem (sry, im a bit new to the Arduino world.)
For the code, i've reduced it down to this so I can test each LED pin individually by changing the PWM_PIN variable
#include <Adafruit_seesaw.h>
#define PWM_PIN 1 // Change this to the specific PWM pin you want to test (12, 13, 0, 1)
Adafruit_seesaw ss;
void setup() {
Serial.begin(115200);
if (!ss.begin(0x3A)) {
Serial.println("Seesaw not found!");
while (1);
}
Serial.println("Seesaw started!");
ss.pinMode(PWM_PIN, OUTPUT);
}
void loop() {
Serial.println("Turning LED ON");
ss.analogWrite(PWM_PIN, 127); // Turn the LED on
delay(2000); // Wait for 2 seconds
Serial.println("Turning LED OFF");
ss.analogWrite(PWM_PIN, 0); // Turn the LED off
delay(2000); // Wait for 2 seconds
}
you say you have 5 of them chained together? that's 5 of the Arcade Button boards?
Yup.
In my actual code, i have it setup like this
int addresses[NUM_BOARDS] = { 0x3A, 0x3B, 0x3C, 0x3D, 0x3E };
are they showing up as expected with an i2c scan?
yup
the switch presses work as expected on all the buttons across all the boards
the only strange thing is the LED does not turn off
it turns on, but does not turn off for the first 2 buttons on each board
i log the buttons presses, and the logs show the switch works as expected
Received from Adaptive Controller: Board 0, Button 1: LED is now OFF
Received from Adaptive Controller: Board 0, Button 1: LED is now ON
hmm....not sure. example code looks simple enough.
let me try same thing here
ok. i'm seeing the same behavior. 🤔
thank goodness. I was driving myself crazy
digitalWrite works as expected
void loop() {
Serial.println("Turning LED ON");
//ss.analogWrite(PWM_PIN, 127); // Turn the LED on
ss.digitalWrite(PWM_PIN, HIGH);
delay(2000); // Wait for 2 seconds
Serial.println("Turning LED OFF");
//ss.analogWrite(PWM_PIN, 0); // Turn the LED off
ss.digitalWrite(PWM_PIN, LOW);
delay(2000); // Wait for 2 seconds
}
let me try that
success!!
I would've never thought to try that. I was going off the code in the examples
thank you!
I will now try it in my actual code and see if it works as expected
the pwm issue seems to be in the megatinycore
i'm seeing the same behavior directly programming an attiny817
#define PWM_PIN 13
void setup() {
pinMode(PWM_PIN, OUTPUT);
}
void loop() {
analogWrite(PWM_PIN, 127);
delay(2000);
analogWrite(PWM_PIN, 0);
delay(2000);
}
works beautifully. Thank you so much for your help. Greatly appreciated!
I was stuck on this for days. I should've joined this discord sooner 😅
no prob
there's still an issue
but if using digitalWrite works for your application, then can just switch to that
only need analogWrite if you wanted to control brightness
@sinful dragon hey, curious what version of firmware you have running on the arcade button board. could you run this sketch and paste the output here:
#include <Adafruit_seesaw.h>
Adafruit_seesaw ss;
void setup() {
Serial.begin(115200);
while(!Serial);
if (!ss.begin(0x3A)) {
Serial.println("Seesaw not found!");
while (1);
}
Serial.println("Seesaw started!");
uint32_t ver = ss.getVersion();
uint16_t pc = (ver >> 16) & 0xFFFF;
uint16_t dc = ver & 0xFFFF;
uint8_t y = dc & 0x7F;
uint8_t m = (dc >> 7) & 0x0F;
uint8_t d = (dc >> 11) & 0x1F;
Serial.print("Product Code: "); Serial.println(pc);
Serial.print("Date Code: "); Serial.println(dc);
Serial.print(y); Serial.print("/");
Serial.print(m); Serial.print("/");
Serial.println(d);
}
void loop() {
}
thanks!
Can anyone help me with the spaceship earth project. I can no get the LEDs to light up. I have triple checked the wiring, I could confirmed the LED strips work with a RF controller. Still nothing when I connect them arduino board.
Some of those connections look dodgy. Do you have a level shifter? What are you using as a power supply?
Where are the wires from the USB C breakout going? Your ESP32 board doesn't seem to be plugged in / properly powered.
What kind of LEDs are those? You say you "triple checked the wiring", but you need stable, preferably soldered, connections to control Neopixels.
And you definitely need to isolate those wires, to keep them from shorting each other.
The USB breakout 5v and ground go to both the LEDs and the ESP32, the board powers up and seems fine. The control from GPI 15 then goes to the control on the LEDs.
The cables are just connected for now. I will solder and isolate them. They are not touching.
I was finally able to get the LEDs to work, but now the first 2 in the chain will not light. The rest of the chain works fine.
The cables are just connected for now.
Yea, but they are not connected now. Which is most likely your problem.
And dodgy connections is how you destroy neopixel leds. Starting with the first ones in the chain.
The USB C plug that’s coming off the breakout board doesn’t go anywhere because that was for the QT Pi board, but that board didn’t work with the LEDs I got from Amazon to work with the ESP board.
I clipped the usb C plug off the breakout board now.
I guess maybe the first 2 LEDs got fried somehow.
I have it working now, but the wiring diagram for the neopixel LEDs listen the listed the wire with the green dot as the ground, it is in fact the 5v, data is in the middle, then ground. I had followed this wiring and that is why they were not lighting. Probably how the first 2 got fried too.
These are the LEDs I bought https://a.co/d/7v1yFEO
Where I’m powering the LEDs directly from the USB cable should I still have WLED limit the power? My understanding was that was only to protect the board from having too much power run through it.
Hey! Pls I need help i bought an LED- Module. Here is a Doku https://joy-it.net/files/files/Produkte/RB-RGBLED01/Manual RB-RGBLED01 08102020.pdf. And now I'am trying to get the energy consomption in voltage. For that i went to https://docs.circuitpython.org/projects/mcp3xxx/en/latest/examples.html and tried the exampels. But i get just every time 0.0V. I even tried diffrend MCPs and checkt all channels with a loop. But still i did not found a channel where the energy is provided. Can someone help me out. THX. But maybe the LED module is not suiteable for that code?
Ihr Partner in Industrie, Elektronik und Education
Hey guys~
I'm trying to auto watering my plants with several moisture sensors + 1 pump with only 1 master link like the screenshot attached. Curious if anyone know how can I do this with Arduino? (with I2C ?)
btw, I've also seen this solution can be extended to more than 2 moisture sensors (as attached 2)
How do you hook the MCP3008 inputs to the LED? Since it's an addressable LED, the voltage doesn't change particularly, but 0.0 doesn't seem likely.
Do you have link to those sensors and their documentation? I can't even tell if they're I2C from the screenshot.
Do you have link to those sensors and
that's the problem for me either. This is the product I saw on the CN Taobao platform (https://item.taobao.com/item.htm?app=chrome&bxsign=scdK4GcmAQeyC7GN-ywulprg-DJFl6j71HKtMIaN42yZkQB8ZQ0Ok2_NUc1R1Mx-gCwEXlKsFmrgJRzvF5wbOiMc7Ws5jq-cXcCnqcyG6h1URC5ivdLnciKFDz4a1Ieh8oj&cpp=1&id=656627073368&price=7-1039&shareUniqueId=27068137632&share_crt_v=1&shareurl=true&short_name=h.gfmdcroGIRtnpFo&skuId=4914327911681&sourceType=item,item&sp_tk=RTBrYldDOGxIdXY=&spm=a2159r.13376460.0.0&suid=9ea5f85e-ffd3-435c-857c-1d942bc5ea85&tbSocialPopKey=shareItem&tk=E0kbWC8lHuv&un=b7eb10abea06dbade8f55b3b63c56d8b&un_site=0&ut_sk=1.YPgvbazL6EsDAOM63uyWekx6_21646297_1717925623520.Copy.1) and I can only find the spec below.
Seems like they are using rs485.
Wondering how can I implement on Arduino? maybe using TTL485 ??
Image
Presumably you'd us an RS485 transceiver chip such as a MAX490, LTC1690, or the ancient SN751177
Trying to work with an ItsyBitsy 5v and getting this error on IDE:
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.
Programmer supports the following devices:
Device code: 0x44
What do you have the programmer set to?
Ive been trying each one...all the same
Also not seeing the board in Finder its that related
Probably not, the board shows up in Finder if it has Python installed, or you're in bootloader mode, otherwise it appears as a serial point. According to this thread, those messages are misleading and the code should be getting uploaded: https://forum.arduino.cc/t/connecting-to-programmer-message/854491/15
Ok, looks like I can get the blink code uploaded. Still cant get it in Finder even when in bootloader mode (pulsing led)
the usual bootloaders for that chip don’t show up as mass storage devices, only as serial
thanks. Is it possible to use micropython or would that only work on the rp2040 itsybitsy? I have the 32u4
32U4 is way too constrained for Micropython
the best you’re likely to get for an interactive language on 32U4 is Forth
Right, thanks. Im obviously new to this...so it uses C++ and not circuitpython?
for the most part. you can also use assembly or C fairly easily (for non-beginner value of "easily")
Thanks. Only need this to control two neopixel rings and a mosfet switch so will stick with what’s default.
i think it should be fine for simple static patterns and slower animations
Ok. I did want fairly fast random flickering colors in the rings. Not possible?
probably best to just try it out and see what works
Right. And I can’t use an rp2040 itsybitsy since I need to control two 5v devices and that only has one Vhigh pin for 5v? Or can you combine them since they would activate at the same time anyway?
what two 5V devices are you needing to control?
2x 24 NeoPixel rings and a mosfet switch controlling a smoke machine.
the MOSFET controlling the smoke machine might be OK if you use a logic threshold FET (or load switch) that’s designed to be driven by 3.3V logic. two NeoPixel rings can be run as a single chain off the Vhi of a 3.3V ItsyBitsy board
You can also switch the smoke machine with a bipolar transistor (3.3V logic is plenty even for a Darlington)
yeah, unfortunately a lot of integrated 3.3V gated load switches are only available in SMD packages
Thanks everyone. It’s a sparkfun mosfet power controller. There isn’t much documentation on it so I’ve asked them if it can be run on 3v logic
They link to the datasheet on the MOSFET on the product page. Looks like it can switch a few amps with only 3.3V on the gate
Looks like the on resistance would be <80mΩ
The smoke machine is 2amps
Well, that transitor will be a smoke machine if it gets too hot...
You can figure it out: 2 amps times 0.08Ω is 0.16V and 0.16V times 2A is 0.32 watts. That package has a 50°C/W thermal resistance, so 0.32W times 50°C/W is a temperature rise of 16°C. That seems survivable.
Yep
its only going to run in short durations, if that matters
As, I see note 1a specifies 50°C/W when mounted on a 1in² pad of 2oz copper.
Although you may need to take the tempco into account as well, because the on resistance does vary with temperature.
For a 0.04in² pad, it's 105°C/W, which would yield a 34°C rise.
As temperature increases, RDSon also increases.
I did take the tempco into account: that 80mΩ figure is for a junction temperature of 125°C
ah
It's closer to 60mΩ at 25°C
It does look like SparkFun provided some copper area for heatsinking. Of course, if you stuff your module in a styrofoam box, it'll cook itself.
Hi all, I am trying to run the feather_player example from the VS1053 library for the mp3 featherwing. For some reason, every time I upload the code, the board will execute up to printing "Adafruit VS1053 Feather Test" and then restart in an infinite loop. This has happened on both my ESP32-S3 No PSRAM and my ESP32-S3 TFT Reverse. It also happend both with the shield plugged in and unplugged. Does anyone know what might be causing this?
It could be that example doesn't have a setup for the ESP32-S3
Resistors needed for the Adafruit LED bar Graphs? if so what value
I presume that depends on the voltage you use with them, and the standard LED resistor formula applies.
The rings can be chained with the data lines in series if you want. i.e. it would be one 48-pixel string.
Silly question, but is there a limit to how many devices I can have sort of chained to qwiic/qt? I currently have 4 thermocouple amplifiers communicating through SPI, but am curious if I could make 6 work though I2C.
theoretically, up to 127 devices on same I2C bus (assuming all have different I2C addresses).
Realistically, 127 is not going to happen, but 6 should work.
Just make sure cables are not too long and all devices are configured to use different I2C addresses
thanks for your help!
I found that in the case of the device I am trying to use (MCP9601 I2C Thermocouple Amplifier) supports up to 8 I2C addresses changeable through tying a resistor of a certain value between ADDR and GND
Note that if all the devices include pull-up resistors, it can increase bus loading, so you may want to disable the pull-up resistors on some of the boards (if they all have them)
yeah, you’re likely to run into signal integrity issues before you run out of addresses (assuming configurable addresses)
I don't think I've ever actually encountered an I2C bus that utilizes the full address space.
there's a decent number of reserved addresses, too, so not all 127 are available
Yeah, it's still above 100 IIRC.
And a couple of them are reserved as prefixes for 10-bit addressing.
Although why anyone decided I2C needed an address space that large is beyond me. And everyone else, it would seem. I've never actually encountered a device that requires 10-bit addressing.
what is the max number of devices you actually saw connected on the same bus?
i don’t have an exact count, but servers using SMBUS can probably have over 10, maybe more because expansion cards can add devices. technically a subset of I2C, and it has some extra features that make high device counts easier
The main limit seems to be bus capacitance more than number of devices. It's not designed for long distances, and you can run into issues with too many pull-up resistors.
also noise pickup if you’re using wires between boards (STEMMA, etc) instead of a single board or plug-in cards that can maintain a good ground plane
I have a trinket M0 that I am trying to upload an arduino program to but I'm getting an error Sketch uses 18566 bytes (64%) of program storage space. Maximum is 28672 bytes. Global variables use 862 bytes of dynamic memory. A programmer is required to upload And I'm not sure what this means. Anyone have any ideas?
Upon some further digging, it may be relating to the UF2 file I have on board that I had set up for circuitpy previously but the code was too much so I decided to switch to arduino, is there a UF2 program that I need to install for arduino to work on this trinket?
Nope, it is supported in the Arduino IDE. You need to install the Adafruit board package. It's all in the Trinket M0 guide in the Ardino section.
That's strange because I thought I did all of that and I see the correct board listed in the arduino IDE that autopopulates when I plug in the board. I have it in bootloader mode with the pulsing red and solid green leds but arduino won't let me upload and gives me that same error. Is the response telling the program is too big or something?
I tried it with the blink program that says it takes up practically no memory on the board and I'm still getting the same error so I suppose it's not that
I've made some progress? I went back through all the packages listed in the guide and discovered I didn't install the correct packages and so I did that and now I have a listed connection that seems to actually resemble the correct port, now I'm just trying to upload a program that works lol
[==============================] 100% (161/161 pages)
Verify successful
Done in 0.135 seconds
I've never felt more accomplished lol
Hi. Are there arduino hookup instructions for: https://www.adafruit.com/product/2656 ?
This eTape Liquid Level Sensor is a solid-state sensor with a resistive output that varies with the level of the fluid. It does away with clunky mechanical floats, and easily interfaces ...
Not much to it, basically connect the red wire to +5V, the black wire to ground, and the white wire to one of the analog inputs.
thank you very much 😉
Hey. im trying to create a Windows service, that opens a serial port to my RP2040. Everything looks like the service is successfully opening the serial port, but the RP2040 doesn't recognise it.
Im just using if (Serial) in the loop, to see if the port is open. It works with the Arduino IDE serial monitor but not with the windows service or in windows terminal. Is there anything that the Serial monitor does diferent compared to opening a port in a Termina or C# windows app?
how does the windows service know which COM port to open? Also, there might be some permission restrictions on the Windows service accessing COM ports
the com port is hard coded for now. The permissions should be fine too, as im executing the service with my usual windows account (but im no expert and i honestly have no idea). also when the service is running i cant acces the port anywhere else anymore so it looks like its correctly opening it.
so using the same port from a terminal program works fine?
when the service isn't running?
if by terminal program you mean the arduino ide or platformio serial monitor yes
what code is the service running to access the port?
I mean like Tera Term, putty, etc.
but arduino or platformio is the same idea
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.
yes putty, platformio, etc works when the service is not running
there is a thing you have to do with C#. Let me look it up
you have to set flow control to true in C#. It does not default to that. looking more for the details...
the_serial_port.DtrEnable = true in the C# code
That works. Thanks a lot
Hey Folks - I'm having a problem trying to program a tiny1616 (seesaw board) with an HV UPDI friend. Here is the output from Arduino: "Sketch uses 770 bytes (4%) of program storage space. Maximum is 16384 bytes.
Global variables use 10 bytes (0%) of dynamic memory, leaving 2038 bytes for local variables. Maximum is 2048 bytes.
A programmer is required to upload"
My settings:
I'm running Arduino from an appimage on Kubuntu 22.04. I can use the serial monitor tool in Arduino and see text I type get echoed back as expected so It is able to communicate with the UPDI Friend.
Also, the light on the HV UPDI Friend blinks when I send simple serial data to it like ascii "Hello" but when I tell arduino to program the board there is no blinking.
Is the port right?
Yes, I can get the light on the HV UPDI friend to blink by writing text to it.
^^^ That message is what I get when running Arduino from the command line and trying to program
Update: It gets even stranger - if I click sketch > export compiled binary, then sketch > Upload using programmer it WORKS!
I don't think you need to export a compiled binary before uploading using programmer 🤔
But since you are using a programmer, it makes sense that you have to use upload with programmer instead of just upload
im trying out a clone of the freenove ESP32S3 cam board and it aint werking
this is the camera webserver example sketch
I think the OV2640 camera module is toast
Ill buy a new one
Womp womp
Hi everyone,
I'm having trouble with HID communication between my PC and a microcontroller (RP2040). I've successfully set up a C++ program utilizing HIDAPI to search for my microcontroller using its VID/PID and to send data using the WriteFile function. The data I'm trying to send is encapsulated in a struct that includes fields for buttons, xAxis, yAxis, and wheel.
However, it seems like my microcontroller isn't receiving the struct/bytes I'm sending. Here’s a brief overview of my setup:
PC Side:
Using HIDAPI to detect the microcontroller.
Using WriteFile to send data, with a struct containing (buttons, xAxis, yAxis, wheel).
Microcontroller Side:
Feather RP2040 with USB Type A Host
Need help setting up to receive HID data.
What is the proper way to set up the RP2040 to receive HID data? Are there specific libraries, configurations, or code examples that you can recommend? Any advice on ensuring proper communication between my PC and the microcontroller via HID would be greatly appreciated!
Thanks in advance!
Are you using Arduino or CircuitPython?
Oops, this is the Arduino channel...
There are references to a mouse library in this learn guide: https://learn.adafruit.com/pro-trinket-usb-hid-mouse
I'm currently using https://github.com/touchgadget/pt_mouse
Works flawlessly, plug my mouse into the microcontroller and it just passes the input to the pc...
My idea / problem is that i want the host to be able to also send the microcontroller commands.
The link u posted doesn't seem to have any more information about host -> device communcation
Ah, you want to run so it has both a serial and HID endpoint?
Only HID for communcation.
Serial is just there atm for debugging purposes, removing that makes it a bit harder to compile during development
I don't know if HID has any provision for sending out of band information like that
I know there was a library for the arduino leonardo https://github.com/NicoHood/HID/blob/master/examples/RawHID/RawHID/RawHID.ino
It seemed very basic, just checked if any bytes where available
you can send arbitrary data to or from host and HID device (sometimes called "raw HID"), but there is no standard way of doing so. some hosts are particularly picky about the report descriptors for this capability, or require separate HID interfaces from any other standard HID interfaces on the device
Am i on the right track?
Found this example https://github.com/adafruit/Adafruit_TinyUSB_Arduino/tree/master/examples/HID/hid_generic_inout
seems plausible, but i haven’t tested it personally
Thanks for confirming it to me
Sadly it doesn't seem to work together with the pt_mouse library 😦
Similar to this one: https://learn.adafruit.com/2-0-inch-320-x-240-color-ips-tft-display/arduino-wiring-test
CLK to D13 (SCLK), SDI to D11 (MOSI), you can connect RS, RST, and CS to any digital pins, just specify the layout in your code. LED is presumably the backlight, it would need to be connected to appropriate LED power. Vcc to 5V and GND to GND. NC is "no connection", you don't connect anything to those pins.
I found a match https://www.arduiner.com/en/prodotto/22-inch-spi-tft-lcd-color-screen-module-ili9225-drive-ic-176220/
2.2 inch SPI TFT LCD Color Screen Module ILI9225 Drive IC 176*220 Features:1. Support all kinds of Arduino microcontroller line, without any wiring2. The integrated voltage regulator IC, supports 5V or 3.3V power supply3. On-board level translation programs truly perfectly compatible 5V / 3.3V IO level,Support a variety of single-chip…
Im trying to make a doom emulator
I'm unsure if an Arduino has the horsepower to run that, but it would be an interesting experiment.
#Play #Doom #on_Arduino _Uno in 3D with only three components ( Arduino Uno, Oled I2C Display and 4 Buttons ) in 5-Minute Game Console DIY
If you enjoyed those videos, then please subscribe to my channel which I update every week
👉 Subscribers : https://bit.ly/2EpEwrU
👍...
Yeah...
That's not Doom he's running. Not by a long shot.
Closer to Wolfenstein 3D...
If you stripped out a lot of things.
If you follow his github link for the source, he freely admits that it's not Doom, just some sprites.
its still a really cool demo imo
Oh absolutely. I'm just saying that to point at it as an example that you can run Doom on an Uno is disingenuous.
A 176x220 display is over 30k pixels and a Uno only has 2k of RAM. You could probably do some Atari style programming where you render the display a piece at a time (which would be a great learning experience), but you'd still have a bunch of other limitations.
I'm a little curious how the various projects of running Doom on random embedded CPUs work. It could be the CPUs are STM32 class, I suppose.
One classic example of Doom on an inexpensive throwaway device turns out to just use the display, the CPU was replaced entirely.
I'm just reading the writeup, and it points out an AdaFruit Trinket was used as the replacement CPU
Yo, I have a code which is supposed to run a ATM. It has a LCD2C Screen, and I don´t have/want/need any pay mechanism or similar, I just want it to run via the Display for output, the Keypad for the input and the RFID Cardscanner for the procedure. I will post my code in the following, and I´m sorry to say it but I need quick help. I worked with ChatGPT and we now have it that there is a "." in the bottom left corner, which shows that the code is still running. ChatGPT said to do this as I was asking it for help with it´s own code. So, here we go:
My problem is that I don´t know how to solve the problem and I need it for school tommorow.
Official Arduino no one answers.
I don't see the problem in the code that's present, but it's truncated ... (86 Zeilen verbleibend)
Asking for people to analyze code is a big favor, it takes time and effort to do
especially code generated by chatgpt... 😑
What exactly is the problem you can't solve? Do you get any errors? Any specific thing that isn't working?
Yeah
RFID Cardreader doesnt read the card
Did you test your card reader separately? Run a basic example to see it working?
Any messages in serial console ?
If you don't know how to read Arduino serial console, you probably need to go back and start from this: https://learn.adafruit.com/groups/learn-arduino
Don't think anyone around here is keen to do your homework for you. Or debug chatgpt code.
Ok. Good luck with that.
So rn everything worked. I did not have the keypad attached for clarifying what the mistake is. I attached the keypad and suddenly the card and scanner don't work anymore, even when I remove the keypad rn. What to do?
Nothing wrong with the cables
@eternal cloud uhm maybe you could help?
- Tagging random users for help is highly discouraged. The guys who answer the bulk of the questions on this discord are volunteers who offer their own knowledge on their own time, and the questions they don't answer are usually outside their scope of expertise. If you tag someone who was previously working with you because you're looking to continue working on something, that's fine, but please don't tag unrelated people in hopes of getting a response sooner.
- As good as the guys are at what they do, they're not an emergency hotline for homework due in 24 hours. They will offer what they are comfortable with, but they're not out here doing people's assignments for them, so please leave enough time to collaboratively debug issues and work through the final project yourself in the future.
Glad you were able to figure it out, though!
I´m sorry, it´s just I´ve been trying the whole day and I needed quick help as I have to go to bed soon as I´m tired ash. What even is adafruit?
Thx
Adafruit is an electronics company that sells a variety of products for DIY electronics projects. https://www.adafruit.com/
Adafruit Industries, Unique & fun DIY electronics and kits : - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPixels Kits & Projects Robotics & CNC Accessories Cosplay/Costuming Hallow...
Hi,
Is it possible to control and change the color of a bitmap file black and white color ?
Thanks
You can convert the colorspace in a photo editor such as gimp. After that, it's up to you to determine the most appropriate way to colorize it, since the color data doesn't exist.
How do i wire this up? Its so i cant play doom.
The switches go from ground to whatever GPIO pins you like. For the display, GND-GND, VCC to 5V, CLK to D13, MOSI to D11, RES, DC, and CS to whatever GPIO pins you like.
Dumb question: on the PCA9685 16-channel servo driver board, there is a VCC and V+ pin. Is there any reason I couldn't power the board externally through the built in terminals (with adequate amperage for the servos I'm running), and run the V+ to the VIN on my nano, and then run the 5v pin on the nano back to the VCC on the PCA9685? Would that work? I'm trying to simplify my wiring, so my externall power supply can just run one set of cables.
Not sure it would work, V+ seems to be a separate input line for the servos https://learn.adafruit.com/16-channel-pwm-servo-driver/pinouts
Ooooo... Yea that makes sense. I wonder if I could use one of the 16 5v outputs on the board to power the arduino. I'm not using all 16 channels.
Theoretically you could, but in practice the traces through the board could add additional resistance compared to just splitting your 5v input to both boards.
Another good point, thanks!
Your original suggestion would work for an arduino uno/mega powered by the barrel connector, but I’m not sure what’s powering your nano.
You probably could double-ferrule a wire to connect the terminals to the nano VIN as well. Assuming your supply is sufficient I don’t see a problem with that.
Hi all, I have an issue with the Arduino motor shield and my Arduino Due. Simply put it can't seem to find it. I've checked over my soldering joints and they seem to be good, even checked continuity. Tried an i2c scanner, which didn't find anything, but I think that's because I missed using "wire1" so I'll have to go back. My question is, the big red disclaimer about the Due not working with "multiple motor shields," am I miss reading that and I should have understood that to mean that this all won't work at all?
May have found my answer, in this "wire1" gotcha. Any answer is appreciated until I get back to my work desk
The library uses wire1 by default on the Due.
You might have missed this part:
good to know it uses it by default, and i fortunitly didn't miss that part so I'm good there. My i2c scanner is finding a device at 0x60 and 0x70 which should be the motor shield according to the documentation.
just not sure why the steppertest example ain't finding the motor shield
got it!
I had to change line 27:
if (!AFMS.begin())
to
if (!AFMS.begin(1600, &Wire1))
so that must mean it evidently doesn't use wire1 by default, i need to specify that
huh... it says "A pointer to an optional I2C interface. If not provided, we use Wire or Wire1 (on Due)" in the library 🤔
so it works now ?
yeah it's not complaing about not finding the board
after i made that change
makes me suspect there's an issue with how the library determines which one to use
Hi, I've got a RP2040 CAN bus Feather board, which I ordered after watching the following video:
https://www.youtube.com/watch?v=MEkKPNr-KBk
At 4:43 its mentioned there is some sort of firmware that can be used to turn the CAN Feather into a USB to CAN bridge device. For the life of me I can't figure out what is the name of the firmware. I've tried to slow down the video.
Adafruit Feather M4 Express - Featuring ATSAMD51 - ATSAMD51 Cortex M4
(0:06) https://www.adafruit.com/product/3857?utm_source=youtube&utm_medium=videodescrip&utm_campaign=newproducts
Adafruit Wide-Range Triple-axis Magnetometer - MLX90393 - STEMMA QT
(0:54) https://www.adafruit.com/product/4022?utm_source=youtube&utm_medium=videodescrip&utm_cam...
I have a HUZZAH32 Feather with 16MB. I am able to get it to work with the Arduino IDE when I set the board type to "Adafruit EPS32 Feather" with a small application. The memory size shows in the Arduino IDE shows as 4MB. My application needs more the 4MB how can I increase the memory size or what board should I use in the Arduino IDE??
If you get no luck, try asking in the support Forum:
https://forums.adafruit.com/
I don't think we do a 16mb version. Where did you get that from then?
Try using one of the espressif esp32 devkit board definitions instead, you'll then see an option in the menu for flash size if the board supports multiple, also don't forget to set desired partition layout and size in menu.
Hoi, what's the thinnest gauge wire i can use for a arduino nano for these buttons and this rotary encoder? As i have a super tiny project i wanna make, but need to find out what the thinnest cable i can use so i can make the case as compact as i can.
https://www.aliexpress.com/item/33056472632.html?
https://www.aliexpress.com/item/1005006111225091.html?
I ordered 28, 30, 32 and 34 gauge wire for super tiny micro solders
Any of those will work, but they're delicate and hard to work with. When building tiny projects, wire diameter is rarely the limiting factor. The Nano and encoder will be the largest pieces.
There are smaller Arduino boards than the Nano, such as the Arduino Every and Motino. The UNO Mini is amazingly small, but was a limited edition.
Easier to find is a Trinket
Thanks, will do.
I'm not sure if the cable is not working ( to low power output / only charging )
But when i plug into the RP2040 USB Host it powers on and I can upload sketches to it.
Although... When i plug for example a mouse into the device, it doesnt even light up or get recognized.
Would you say the USB A Host is defect, or is it the cable that needs and upgrade? 🙂
Do you have a https://www.adafruit.com/product/5400 or a https://www.adafruit.com/product/3405
One of our star Feathers is the Adafruit HUZZAH32 ESP32 Feather - with the fabulous ESP32 WROOM module on there, it makes quick work of WiFi and Bluetooth projects that take advantage of ...
The V2 has 2MB PSRAM. Note that the PSRAM chip capacity is often listed in megaBITS by the chip mfr, so 2MB = 16Mbits
Has anyone had any issues with the MatrixPortal S3 connecting to wifi? I'm connecting to a WPA2 network. Debugging the connection with Serial.print messages via Serial Monitor and I'm trying to connect to my network but getting an error. The related code below. I'm coding this in Arduino IDE.
// WiFi credentials
const char* ssid = "network_name";
const char* password = "my_PASSWORD";
// WiFi client
WiFiClient client;
void connectToWiFi() {
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
int attempt = 0;
while (WiFi.status() != WL_CONNECTED && attempt < 20) {
delay(500);
Serial.print(".");
attempt++;
}
if (WiFi.status() == WL_CONNECTED) {
Serial.println();
Serial.println("Connected to WiFi");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
Serial.print("MAC Address: ");
Serial.println(WiFi.macAddress());
} else {
Serial.println();
Serial.println("Failed to connect to WiFi");
}
}```
Output message: Wi-Fi not connected
And I've confirmed via my network that the device is not connect.
Im not sure why, but on my UM ProS3 board, reading a 41KB file from an SD card runs out of stack memory and causes the board to reset, anyone know why? It happens right at the SD.open() line.
SPI.begin(5, 4, 3, 2);
if (!SD.begin(2))
{
Serial.println("SD failed");
} else
{
Serial.println("Initialized filesystem");
}
File nsfFile = SD.open("/areazero.nsf");
Serial.println("Opened file");
char* buffer = (char*)malloc(sizeof(char) * nsfFile.size());
nsfFile.readBytes(buffer, nsfFile.size());
Serial.println("Read file of size: ");
Serial.println(nsfFile.size());
nsfFile.close();
Output:
Guru Meditation Error: Core 1 panic'ed (Unhandled debug exception).
Debug exception reason: Stack canary watchpoint triggered (loopTask)
I figured out the issue, my library had an include that included literally everything at once lol
not sure if this is the right place for this but, has anyone using Neopixel library had the issue that if a strip color is set, changing brightness wipes out lower value colors? i'm trying to fade in rgb (25,255,80), but when using a for loop to bring brightness from 0 to 255, only the green leds in the strip come on.
Please post your code, there is no way to tell why that happens otherwise.
@eternal cloud https://pastebin.com/UcUXGGzP
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.
in both these instances ramping the brightness up in a for loop (line 66,68) makes any color under 128 (rgb defined in line 15-22) not render at all
The colors you define in lines 15-22 are basically red and green, there is minimal observable difference from setting the other values to 0.
When you dim those colors, the values on all 3 channels go down, until the only channel left active is the main one, the other two are 0. So the behavior you are observing is correct.
You can read more about Neopixel usage here: https://learn.adafruit.com/adafruit-neopixel-uberguide/arduino-library-use
especially this part:
setBrightness() was intended to be called once, in setup(), to limit the current/brightness of the LEDs throughout the life of the sketch. It is not intended as an animation effect itself!
hi, i wanted to convert a digital sin signal into an analog voltage signal. I've tried using some code, but I've always gotten a flat line, but not the analog signal itself
i think it's an issue with the wave itself, but i dont know how i could fix it
Many boards do not have any true analog output pins (the M0 and M4 boards do have built-in analog outputs, however). You can use an external DAC (digital to analog converter) to generate analog signals. For the boards without true analog outputs, analogWrite() generates a PWM output on the pins with PWM support, or just high or low for pins that don't have PWM support. PWM in turn stands for Pulse Width Modulation, basically a digital waveform that spends a varying amount of time in a high or low state.
someone just sent me a code which involve analogwrite using pwm, but after a few seconds, it stops generating values
i tried adding a delay of around 50 ms and it turns out that longer delays mean that the program runs for longer without crashing
also, if i were to use a dac, is it possible to do it without an external dac
my teacher said that arduino ides have a built in dac inside them which should technically allow u to convert the digital signal to an analog voltage
Yes, with an M0 or M4 board (my board of choice for this is the ItsyBitsy M4 Express, which has two analog outputs)
The IDE is just the software you use to program an Arduino. An Arduino Uno does not have any DAC, sorry.
You can use a simple RC filter to smooth out the PWM waveform into a somewhat lumpy analog one. For some uses (like for controlling brightness of lamps or speed of motors) it doesn't matter that it isn't actually an analog waveform.
well i wanted an analog signal because my teacher asked me to use a rectifier
and a rectifier doesn't work unless the signal is analog, or atleast that's what i assume
i'll have to add noise through an external sensor to the basic sin signal and then pass it through a filter from a research paper
A rectifier is basically a one-way valve. It works fine with a digital signal, but since the signal is either positive or zero volts (it doesn't go negative), a rectifier isn't particularly useful. However, you can use a capacitor to decouple the waveform, so it goes both negative and positive, at which point a rectifier could do something (however, it greatly depends on what you're trying to accomplish).
im not completely sure, but i think a rectifier was required to make sure that the average (something i forgot) isn't 0
it has to be positive so it can pass through a filter i think
Most filters are built using reactive passive components such as capacitors and inductors, not active components like rectifiers.
but i'll have to double check with my teacher
i'll let you know when im a bit more experienced with why we need a rectifier if that's fine
A PWM signal does have a positive average (it doesn't go negative) to start with. Most filters don't care, but some filter designs block the DC component of a composite signal, so after going through them a signal could transform from unipolar (positive only) to bipolar (positive and negative)
i think that's why my teacher asked me to avoid pwm signals
I come and go throughout the day, as I have to work, but most of the time there's someone around.
i dont know the downsides, but maybe he didn't want a positive average
therefore the rectifier
ah that's fine, you can take as much time as u want with your replies
A rectifier converts a signal from bipolar to unipolar, which is the opposite
That's where the name "rectifier" comes from: "recti" meaning "right" (same root as "rectangle", which contains right angles) and "facio" meaning "to make".
No, PWM signals spend part of their time at zero volts and part of their time at the supply voltage (as I stated above)
Greetings everyone, question about the MIDI library. I need to reference the MIDI instance in a different file, using an extern
I declare (per the book) with
MIDI_CREATE_INSTANCE(Adafruit_USBD_MIDI, usb_midi, MIDI);
(SAMD51 board, metro M4)
but in the code im using, the pwm signal generated has negative amplitudes too
As long as MIDI isn't static, you should be able to refer to it with an extern declaration in another module
That doesn't seem right. How are you measuring it? Is there other circuitry present?
oh yeah im using a digital output pin
The analogWrite() routine expects values from 0 to 1023
ill send the code because im not good with arduinos either
ive mostly been borrowing code until now so im inexperienced
I tried, but I can't figure the type of it
also there's some interface in the code as well, don't mind that
#define MIDI_CREATE_INSTANCE(Type, SerialPort, Name) \ MIDI_NAMESPACE::SerialMIDI<Type> serial##Name(SerialPort);\ MIDI_NAMESPACE::MidiInterface<MIDI_NAMESPACE::SerialMIDI<Type>> Name((MIDI_NAMESPACE::SerialMIDI<Type>&)serial##Name);
create instance should refer to a MidiInterface or a SerialMIDI, AFAIU
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.
That library is somewhat confusing. I think the created object ends up being something like midi::Name where Name is the argument to the create instance call
hence, midi::MIDI ?
likely
trying
As for the analogWrite code, it's getting a value from 300 times a sine function, so it'll give values from -300 to 300. However, the analogWrite function only accepts values from 0 to 1023, so all the values below zero will be just treated as zero.
If you were to offset the values so they're all positive (like 300 * (1 + sin())), you'd get the PWM of a sine wave, offset so it's all positive. If you then decouple it with a capacitor, you'd change the offset so it could go positive and negative, but you still wouldn't have a sine wave, it would still be PWM.
it's not working. I understand the naming, but if I reference an instance as "extern", I need to define the type and nothing works there
midi seems to be recognized as the name space
but I can't have the type of MIDI
the lib is indeed pretty confusing for creating the instance
The class seems to be MidiInterface but I'm unsure on what the instance is named
that's what I thought too. Compilation returns : MidiInterface is not a type
There's some useful looking discussion on this here: https://github.com/FortySevenEffects/arduino_midi_library/issues/165
awesome thank you I'll read this
thank you so much @north stream that worked perfectly, I'm not using namespaces enough
cheers
I'm trying to use an ESP32-S3 QT Py (2MB PSRAM) with the Arduino IDE, but the board isn't listed there 🙁 It only has the 8MB Flash (No PSRAM) version. I tried flashing a Hello World program with that board, but the device crashes and prints and error about the program size:
E (281) spi_flash: Detected size(4096k) smaller than the size in the binary image header(8192k). Probe failed.
This makes sense as the memory sizes are different between the two boards... How would I use the PSRAM version?
Update: seems I damaged the bootloader in the previous try, I repaired it and I'm back to the factory code
Do you have the correct board manager package?
Both boards are there.
I installed esp32 by espressif
It needed an update which I'm doing right now
Oh, great now I have it
Thanks!
Now after putting the hello world, two things happen: Every other reset, the NeoPixel either flashes purple or goes into bootloader mode
Here is the program btw
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.println("Hello World");
delay(1000);
}
Is the code running? can you see the message on the serial ?
oh, yea, someone else in here had this problem with esp32-s3 a little while ago
it's a bug in the latest espressif package version, i think ... that person reverted to using an earlier version (2.0.17 if i remember right)
let me try that
Yay, tysm
it works!
Awesome! 🥳
It all works great, but I just tried the TFT_eSPI library and this is happening again
If i flash any other program, like Adafruit GFX, it works again
can you guys help
it is an emergency
tommorow our high school has a quiz competion and i was making a buzzer ofr it
i am just stuck on how to place a AC bulb
in it
do you have a microcenter near you? Or just hw stores? Controlling line voltage from the Arduino requires a relay or similar and maybe a transistor to drive the relay.
i have a relay
Do you have NeoPixels or other similar bright LEDs? Consider just winding a NeoPixel string around a tube or similar, and controlling that. It will be plenty bright.
no
what relay do you have?
10a 250vac 10a 125 vac
10a 30vdc 10a 28vDC
what coil voltage and current
SRD-05VDC-SL-C
Do you have a way to connect to the bulb? A socket?
yes\
that relay takes something like 100mA to engage. An Arduino pin will only supply max 40mA. So you need to use a transistor to drive the relay. Do you have an assortment of transistors?
i have 2n2222a transistor
alternatively ask an electrical supply store locally if they have a solid state relay (usually will do 3-32v input). But it would be about $40
can it be done with my transistor?
yes it can control 1/2A or so
how to do it?
hold on
ok.
Hi @taskitas If you have a multimeter, set the arduino pin to HIGH, and measure the voltage between the 2 pins of relay coil. And say how much you measured.
Note the diode across the relay coil. You need that otherwise you can cause a spike that will damage the transistor
i have a IN4007 diode
1IC
etc. do some more websearching if you want more examples. I can't find the "perfect" example.
Be really careful with the line voltage and the relay. Make it inaccessible. Quite dangerous otherwise
should i use relay or triac?
relay, triac doesn't provide isolation
i have bt136 triac
but i have only one relay
you only need one
oh ok
control it from a separate pin on the Arduino
i don't understand what i need to do?
See those links: they have schematics
if you don't understand them ask someone locally with more experience
I am worried about your safety here
ideally you'd use a solid state relay or something like this https://www.adafruit.com/product/2935
i will first secure the connection and power it
and shouldn't the MCB of home help us?
test WITHOUT ac connected to the relay. check with a multimeter that you are controlling the relay properly.
what is "MCB of home"
what country are you in
Nepal
you can get killed before they trigger
I REALLY suggest you don't try to control an AC bulb if you don't have experience with that
oh
I would highly suggest you get some bright LED's and control those or some other low-voltage bulbs
i coundn't find that
especially, you are in a hurry, etc. Mistakes might happen. Don't do it if you don't have experience
you don't HAVE to do this; you just want to
oh
you can control a 12V automobile bulb or similar, if you have a 12V supply, for instance
it will be plenty bright
Why can't we just simple connect triac's gate into pin of arduino and a1 into ac supply nad a2 pin into load ?
because if the triac goes bad or is miswired you might get line voltage into the arduino. You could kill the people pressing the buttons
can't it be prevented with a diode?
connecting diretcly to some device that controls AC can be dangerous if anything fails. The relay provides good isolation, but it could be miswired. You are in a hurry and have no experience. Don't do it
ok then
i will just use a 12v bulb with a 12v power supply aand a 2n2222a transistor to switch it?
if the bulb draws more than 500mA or so, it is too much for the transistor. So you can use the relay to control the bulb. It'll just be a 12v bulb instead of an 220V bulb
circuitry in the links above is the same
and you still need the diode
across the relay coil, as indicated (put it in the correct orientation0
when i tried to make that simple circiut before the bulb just turn on wihtout pressing the button why?
i don't know, many possible reasons
and if i connect the gate to vcc instead of gnd it just automattically truns on the buzzer
what do you mean, the schematic way above?
yes
the buzzer is controlled by pin A0. If that is not set to low explicitly, the buzzer might go on. Are you running the program as shown?
yes
do you mean you connected a triac to A0, or is the buzzer connected directly?
no conneted to the palce of bulb
d8
connected to d8
i don't know; it shouldn't come on, any more than the LED there should come on without pressing the button
the bulb also turn on with buzeer if i connet the ac supply to cathode of traic
could be leakage, but I repeat, don't use a triac, and don't let mains voltage anywhere near the arduino, even through the triac
ok
good luck!
thanks
Hey, just starting my first project with microcontrollers and have a noob question about my metro - how do I actually switch it to 3.3v logic? I see the place I'm supposed to interact with, but I... solder it somehow? poke it? ask politely?
Some of the Metro boards are 3.3V. However, if you have a 5V one, you'd have to "poke" it in the sense of replacing some components.
which metro do you have? Metro 328? that's going to 5v and is not readily changeable. If you want to use 3.3V logic, most of our other boards are 3.3V
uhh yes, 328
what does "cutting a soldering closed a jumper" mean
Basically you need to interrupt the connection from the 5V regulator (cut the trace between the middle and upper pads), and make a new connection to the 3.3V one (solder to connect the middle pad to the lower one)
I forgot we could do this, thanks!
soldering's about what I expected, the cutting doesn't seem as obvious since I can't get under it... I guess just go at it with an exacto knife until the connection is broken?
Yea, exacto knife will do! You don't need to get under it, just cut (and scrape a bit) that visible trace between the pads so they are not connected anymore
gotcha. Thanks!
With the trinket M0 is there ANY way to store a bit of long term/changeable data on there? Like writing to eeprom or suchlike?
I spent a long time looking for a way to do that on the ATSAMD21 that the trinket M0 uses, and the answer was, not really? best option is to use a different mcu that has that capability out of the box.
or add like a small storage chip on the i2c bus, maybe
you could experiment with this lib, but my impression was that it could wear out the storage for my application. YMMV?
https://www.arduino.cc/reference/en/libraries/flashstorage_samd/
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.
basically the warning here about ~10k writes to each flash block as a rule of thumb
You can always add an FRAM chip, which is fast, non-volatile, and doesn't wear out.