#help-with-arduino

1 messages · Page 3 of 1

livid osprey
#

It should be possible, though it may affect your sensitivity.

#

Given your desired area, it might even help with unwanted shadow effects, so definitely experiment with a bunch of different configurations!

spiral carbon
#

hi guys. my esp32 idf library takes up 3.73 GB of my 5 GB Icloud drive. what to do? get rid of something? store elsewhere, change path (brr)

cedar mountain
unique flame
#

It's probably stored in their ~/Documents, which they are likely syncing through iCloud

spiral carbon
#

That's right @unique flame

broken salmon
#

New to Discord, so I'm not sure how this all works. I'm trying to determine whether some flavor of an Adafruit ItsyBitsy would work as a replacement for a Teensy 3.2 I'm using in this PKE Meter prop I built: https://youtu.be/gct2NALXWS4 I had barely enough knowledge to design the circuit and PCBs. A friend designed almost all of the Arduino coding. We (he) had to make some modifications to the Servo Library so the servos would use a different timer than the normal one due to a conflict with the DAC that was outputting audio to the Teensy Prop Shield LC. Would we have the same issues with an ItsyBitsy? I have no clue where to glean such info. I put a post up on the ItsyBitsy forum on Adafruit two weeks ago, but no one has replied. Page 15 of this PDF indicates some sort of conflict between the servos and sound playback: http://hades.mech.northwestern.edu/images/9/90/CircuitBuildingAndProgrammingWithItsyBitsyExpressMu2018.pdf Thanks!

This is a Mk 1 version of a PKE Meter I've been working on for many years. The shell is a resin casting I made of an Iona shoe polisher I modified to match the prop. The wings (3D printed) are driven by two servos. The electronics are controlled by a Teensy 3.2 Arduino. Touchswitches activate the functions and also change modes.

In the default...

▶ Play video
fallow valve
#

how I can do a fade when I have Two LEDS going back and forth? - I was gonna build a cool Mini LEGO RailRoad Crossing Gate that just lights up just for fun

#

https://www.youtube.com/watch?v=l-VpP-bcwzo like from these Safetran lights

Here's my part 1 video of Safetran Fading LEDs Light railroad crossings compilation. These LEDs were heavily used on different Light rail and commuter rail transit line companies and by CN Railway. UP and BNSF also have used these LEDs lightly with UP using them in the early 2000s on there 1990s to early 2000s Safetran EM Install signals. BNSF u...

▶ Play video
pine bramble
#

Ok. Only because I’m trying to be helpful. I’m not a wonderful programmer. But wouldn’t you use a brightness value and decrease by 1 over a volume of time?

livid osprey
fallow valve
#

I'm aming to use the Pins then fad them out like the Safetrain LEDs

steel oak
#

If anyone fancied helping me with this that would be lovely: https://github.com/samuk/ESP32-robot-car-controller/blob/main/src/main.cpp Compile errors: rc/main.cpp:50:2: error: expected unqualified-id before 'while'
while (!Wire.begin(I2C_SDA, I2C_SCL, 100000ul)) { // standard wire pins
^~~~~
src/main.cpp:55:5: error: 'commander' does not name a type

GitHub

ESP32-based wifi robot controller. Contribute to samuk/ESP32-robot-car-controller development by creating an account on GitHub.

livid osprey
spring sand
#

Hello, I recently attended the Adafruit Ask an Engineer and asked the following,"Are there any upgrades to the RA8875 board". The responded WITH,"There are no upgrades and the chip is about to be discontinued in the future. I have a project that uses a 5" or 7" display and need touch support and color. I have already checked to see if there was just a plain touch layer with there is but the controller is discontinued too. This is so frustrating and I need some help. Because of the driver board being discontinued, I would like to improve the screen. Maybe an OLED with touch or even just an OLED and a 5" touch resistive layer with a controller. I am using an Arduino and it needs to be compatible. Thanks for all the help!

RA8875:https://www.adafruit.com/product/1590

Resistive touch layer:https://www.adafruit.com/product/333

Resistive touch layer controller (Discontinued):https://www.adafruit.com/product/1571

eternal cloud
wind drift
#

Question:

I have some LED filament (3.3v). Do I need to use a 220 ohm resistor with it?

They use max. around 80mA

I would like to use an arduino to control the intensity - do I need a LED driver for this (which one)? Or something else?

leaden walrus
#

is 3.3V the forward voltage of the LEDs? or what you want to use for power?

#

for brightness, can PWM, don't really need a driver, other than dealing with powering

spring sand
sage anvil
#

@gilded swift thanks for all the help, finally got it working 🙏

eternal cloud
native kelp
#

how can i do an async post request with an application/json body type on an esp32, i've found multiple libraries that can do async post requests supposedly but i havent found an example of how to actually do a post request with the application/json body type

pine bramble
#

DigiKey sold me an STM32F407 Discovery board, which their stock reporting system said there was only one of. Usual price (USD $19.xx).

The stock amount did not drop to zero. I suspect that means they have a pile of them but wanted to discourage multiple unit sales, to have a small supply on-hand, ready for the next buyers in line. ;)
/just-a-guess

pine bramble
pine bramble
#

I didn’t care for python. But I like messing about

spring sand
spring sand
#

How do you use the adafruiut library for oled and print text then erase it and then write new text?

wet crystal
#

Hello people, I feel like im to stupid to find a solution on the internet, so I ask here 😄

I recently bought a VESC (open source speed controller)
You can attach a bluetooth dongle to it so you can simply use bluetooth to setup or change settings, but I dont have one here. But i have an ESP32.

So I wanted to know if someone can point me to what kind of sketch I need to put onto the ESP to make it act like a bluetooth dongle over UART.

thx in advance

cedar mountain
wet crystal
#

Lol I thought it would be easy 😄

cedar mountain
#

Perhaps I misunderstood. By "dongle" I'm assuming you mean a USB device that would need to be emulated. Or do you actually mean a Bluetooth serial "module" that just gives you TX/RX wires to connect?

rough nova
#

For my signal model, the program used Micromotors to lower and raise the gates... turning them on in one polarity to lower for a period of time, and then waiting until the train was done... then change the polarity, and run them again to raise the gates. Mechanical stops for the raised and lowered positions did the work, and the micromotors have a bit of slip.

The train was detected using a small reed-switch, in between the studs of a 2x4 plate, and laid across the center stud on a couple adjacent ties. When the magnet couplers on the train come across, the Mindtorms see a series of pulses... which start the leds flashing and wait a few secs, then lower the gate...if the pulses are still there, rest a small loop... when the pauses stop, raise the gates, then stop the flashing.

steel lynx
#

hey, is it possible to use the microSD slot on the back of some of adafruit's displays for, say, logging functionality? just wondering if that's strictly for loading images or if you can re-purpose it for other stuff

wet crystal
#

The VESC has UART pins with rx and tx, which you usually put a bt module onto. I just wanted to use the ESP32 I got plenty off

rough torrent
livid osprey
wet crystal
wind drift
#

Probably a dumb question but I am using a LiPo battery and have a TP4056 breakout board connected for charging.
I have already replaced the resitor with an appropriate one.

How do I know it is charging 'safely'?
Do I just measure the voltage on Vin?

slim shell
#

Are there interrupt pins on the Grand Central m4 Express?

chilly plover
#

I know on a Mega you assign an interrupt to a pin. Only some pins support it. I'm guessing the M4 is going to work the same.

livid osprey
chilly plover
#

I may be thinking of timer outputs.

livid osprey
#

Maybe, maybe not? I don't think the Mega shares that characteristic with the SAMD51...

brazen falcon
#

There's always some inherent risk with LiPos though

brazen falcon
#

Note that the cheap chinese tp4056 boards typically don't give you maximum benefit out of the protection, they generally give you overcurrent/short protection only. No protection from over/undercharging or plugging in the battery backwards.

plain shoal
#

hi how can i change the sda and slc pins, im using a stm32 blue pill. im trying to with softwire library but it doest compilled fine. has anyone done this or have an idea to solve it. also SOFT FAST doesnt work

strange cradle
#

Hi Everyone. I have a patch for an old Adafruit product: The WaveHC library for the WaveShield. I am the manager of a makerspace at a k-12 school. We have a few of these lying around so I wanted to makers who are familiar with 8 bit Arduinos to try them out. Unfortunately, I ran into https://github.com/adafruit/WaveHC/issues/3. I put up a PR for this and was wondering if anyone cares anymore about patching a product that I first used in 2009, and if so, if this was the right place to talk about it.

GitHub

The WaveHC Library was developed for the Adafruit Arduino Wave Shield. - Issues · adafruit/WaveHC

#

For the record, I have been moving the school to use something like a Feather or a Pico, but everyone who has taken engineering classes for the past 9 years or so cut their teeth on these Arduino Unos and Nanos.

#

The pull request is up at https://github.com/adafruit/WaveHC/pull/5. I'm happy to work further to help make a release of the library. It would be great if our makers and engineering students could just use the Arduino library manager to pull in a working version of the code by default.\

GitHub

GitHub is where people build software. More than 83 million people use GitHub to discover, fork, and contribute to over 200 million projects.

eternal cloud
light yacht
#

hi i recently purchased an adafruit as7341 spectrometer and am trying to get the demo code working but it keeps coming up on my serial monitor that it cant find it . im pretty sure i have it all wired up correctly and have my arduino setup correctly too . any ideas as why this might be ?

shut prism
light yacht
#

#include <Adafruit_AS7341.h>

/* This example will read all channels from the AS7341 and print out reported values */

#include <Adafruit_AS7341.h>

Adafruit_AS7341 as7341;

void setup() {
Serial.begin(115200);

// Wait for communication with the host computer serial monitor
while (!Serial) {
delay(1);
}

if (!as7341.begin()){
Serial.println("Could not find AS7341");
while (1) { delay(10); }
}

as7341.setATIME(100);
as7341.setASTEP(999);
as7341.setGain(AS7341_GAIN_256X);
}

void loop() {
// Read all channels at the same time and store in as7341 object
if (!as7341.readAllChannels()){
Serial.println("Error reading all channels!");
return;
}

// Print out the stored values for each channel
Serial.print("F1 415nm : ");
Serial.println(as7341.getChannel(AS7341_CHANNEL_415nm_F1));
Serial.print("F2 445nm : ");
Serial.println(as7341.getChannel(AS7341_CHANNEL_445nm_F2));
Serial.print("F3 480nm : ");
Serial.println(as7341.getChannel(AS7341_CHANNEL_480nm_F3));
Serial.print("F4 515nm : ");
Serial.println(as7341.getChannel(AS7341_CHANNEL_515nm_F4));
Serial.print("F5 555nm : ");
Serial.println(as7341.getChannel(AS7341_CHANNEL_555nm_F5));
Serial.print("F6 590nm : ");
Serial.println(as7341.getChannel(AS7341_CHANNEL_590nm_F6));
Serial.print("F7 630nm : ");
Serial.println(as7341.getChannel(AS7341_CHANNEL_630nm_F7));
Serial.print("F8 680nm : ");
Serial.println(as7341.getChannel(AS7341_CHANNEL_680nm_F8));

Serial.print("Clear : ");
Serial.println(as7341.getChannel(AS7341_CHANNEL_CLEAR));

Serial.print("Near IR : ");
Serial.println(as7341.getChannel(AS7341_CHANNEL_NIR));

Serial.println("");
}

shut prism
#

So it's failing to find your device. It's not really running much code from the library there. So it most likely is your connections. Verify everything is connected correctly.

#

Looks like a genuine module, so I don't think the address is incorrect. Though you can run an i2c scanner example to verify

livid osprey
shut prism
light yacht
#

okay thank you

quartz river
#

Is there a device that I can give it (DC) voltage, and if the voltage is below a certain amount, it will output nothing, but otherwise it will let the voltage through? I have a 9v battery, but if it is below a certain threshold, I'd like my circuit to just turn off

cedar mountain
quartz river
cedar mountain
quartz river
fair sorrel
#

I'm making a multi sensor unit with an Arduino that needs to be able to communicate the sensor totals to various types of data loggers and have been trying to figure out how I want to pass the data across the UART. I've seen Simple Serial Interface and HDLC but I can't find complete information on either of those protocols to implement. Does anyone have a good resource or an alternative serial communication protocol they'd recommend?

cedar mountain
quartz river
cedar mountain
fair sorrel
north stream
#

There are things like Firmata that can package and send data for you, or older formats like XDR, but I often end up using simple human-readable ASCII ones like Ed mentioned, as I can just interact with them as transmitter or receiver with a simple terminal program, which can be very handy for debugging.

wet crystal
#

Hello again.

Im currently working on Ninebot Turn Light board.

It has a STM8 Proccessor on it, which wait for a CAN Bus command to be activated. Since that would require too much work I was thinking about to just overwrite the Output pins.

I just found two IC´s which seems to have TIM TM1911 written on it, but google just shows me just the 1911 gun when googling for it.

Than I made some drawing and saw the 1911 is connected to the TIM pins on the STM8.

Little bit of googling told me that it could be timers PWM based.

Does someone have more informations about that?

cedar mountain
wet crystal
#

Does those kind of chips exist?

cedar mountain
#

I'm not sure. The PWM output might also be used as a smart-LED data protocol like Neopixels use.

wet crystal
#

Lets hope it not 😄

wet crystal
#

But well lets wait

#

I ask my friend to return his scooter, I plug in the board and just put an pwm onto that chip with a separat arduino, is there a risk of frying anything or na?

cedar mountain
#

Yeah, injecting signals into an unknown circuit can sometimes fry things. Ideally you'd measure the existing functionality first with an oscilloscope.

wet crystal
#

The STM8 waits for activation signal from can bus, which I have absolute no chance of grabbing

hushed frigate
#

I have an Arduino micro and an Ultimate GPS breakout v3. What program should i be running and how should i be wiring it?
I saw the earlier response, I have seen https://learn.adafruit.com/adafruit-ultimate-gps but I am still unsure about how exactly to do it

Adafruit Learning System

One GPS to rule them all and in the darkness find them!

north stream
#

It's a fairly simple serial device. There's an Arduino library that makes it fairly easy to talk to.

crimson lark
#

Is anyone willing to help with arduino servos right now

#

We can vc

#

It'd be really helpful and will only take 5 minutes of your time

north stream
#

It might help if you described the problem you're trying to solve.

eternal cloud
# hushed frigate I have an Arduino micro and an Ultimate GPS breakout v3. What program should i b...

The guide gives a detailed description of the pins on the GPS breakout: https://learn.adafruit.com/adafruit-ultimate-gps/pinouts,
and the pinouts for the arduino micro are in their documentation:
https://docs.arduino.cc/hardware/micro
+
https://docs.arduino.cc/static/777a1c066b7b2060eba932b9cc3eed5a/A000053-pinout.png

The guide also shows the wiring for Arduino: https://learn.adafruit.com/adafruit-ultimate-gps/arduino-wiring (Hardware Serial Boards). You need to connect the coin battery on the back of the GPS, between 3 to 5V to the VIN pin, ground, Rx from one board to Tx on the other, and Tx to Rx

eternal cloud
# crimson lark We can vc

This is a space for public help: you state your problem, people who know about it contribute, everyone wins (and learns).
People rarely volunteer to pm / vc, and problems rarely "only take 5 minutes" to solve 😛

pine bramble
wind drift
#

I am having trouble with using a capacitive touch sensor + wireless charger.

Basically I want to activate something with the capacitive touch sensor - which works fine on its own

#

But once I have a wireless charger for my battery connected it's not working properly

#

Do I need to separate the ground from the wireless charger and the capacitive touch sensor? Or keep the same ground?

north stream
#

I had what might be a similar issue a while back, where a capacitive touch sensor had a different sensitivity when powered by a plug-in supply versus a battery supply (presumably because the plug-in supply gave a higher capacity feedback path). If it's something like that, you can either write some adaptive code to try to set the threshold depending on current conditions, have a configuration adjustment of some sort, or just stick with one kind of power supply.

#

Your idea of isolating the supply somehow is a good one, I didn't try that, but it might simplify the problem.

wind drift
#

ah the isolation part does not seem to work with my setup

#

So basically I have an LED that turns on with capacitive touch.

It is powered by a LiPo battery. Which is charged by a TP4056 breakout board. Which is powered by the wireless charger.

#

The TP4056 breakout board V-in and V-out share the same ground

wind drift
#

@north stream ttp223 breakout board

#

this is what I am using at the moment

wind drift
#

Would I maybe have to use a diode? Just not sure where to place it

sacred ivy
#

Is there a way to convert ASCII characters back into binary? So want to control PWM from a serial port and Ive gotten the numbers, but, they are all in ASCII form. So the decimal number "1024" has the associated ASCII characters for each number. I need to take those numbers and put it into something readable so I can shove it into a register.

gilded swift
#

You would need to loop over the incoming string (char array) and convert each char to an int

#

You can subtract “0” to convert to straight int:

int num = static_cast<int>(str_char-“0”);

#

It’s probably slightly more nuanced but that’s the general idea

#

Syntax is slightly wrong though

cedar mountain
#

The library functions atoi() or sscanf() may be useful.

gilded swift
#

That was my other thought. Looks like you could also do it implicitly by doing
int num = str_char - ‘0’

sacred ivy
#

I'l have to look into those

#

Thanks 🙂

terse lava
#

With the Feather RP2040 using &WIRE1, do you essentially need to modify every library and their dependencies to change &WIRE to &WIRE1? even if wire.h isn't used in the example sketch? Just trying to understand how to work with it. For things like the OLED featherwing, I can change it in the device declaration before setup, but sensors like the LTR329 don't include &WIRE in the sketch

cedar mountain
#

It'll just depend on the library. Often you can pass in a Wire reference to the constructor, but if the library has the I2C bus hard-coded, there's not much you can do but edit it in the library.

terse lava
tacit jewel
#

how do I fix this error in platform io I'm trying to use the debugger avr_stub on a arduino mega 2560

north stream
north stream
tacit jewel
#

the usb port on the arduino when I plug it in to the computer it comes in as COM10

#

is the debug serial port different than the usb

cedar mountain
terse lava
leaden walrus
tender sinew
#

Hi, I'm thinking of doing the blob detection of my ants.

#

I just found out about arduino portenta and OpenMV that allows me to do blob detection stuff.

#

But I see that there are several different models of this

#

H7, H7 Lite, X8, and what is Vision Shield?

#

I don't know what to get.

#

I am thinking of sending the live data into another microcontroller called Daisy Seed

#

so that it can get live data from Arduino Portenta and use it for synthesizing sounds

tribal cipher
#

Dear members. How can I switch from one dc power source to another? As of now I'm using Oring diode Configuration. I want to power the Arduino in case of power failure. Please guide.

pine bramble
tribal cipher
tribal cipher
#

This is my current configuration

pine bramble
#

Isn’t that essentially what you have?

tribal cipher
pine bramble
pine bramble
#
blazing crane
#

I'm encountering the same exact issue mentioned here (Nano 33 IoT rather than Nano 33 BLE, but same thing)

#
#

There really didn't seem to be an answer on this forum post, so I was wondering if y'all had any ideas

#

I pretty much tried all the steps as discussed in the post as well and got the exact results they described (works maybe 1% of the time, works perfect on an Uno, etc.)

leaden walrus
#

some kind of hardware conflict? maybe i2c address conflict?

#

with the items on the nano. like the ublox module or the crypto auth chip.

blazing crane
#

any idea how I'd check that?

#

(Also I'm pretty sure the guy in the post mentioned he narrowed it down to the transmission with the PC over Serial but I haven't tested that so I can't say for sure)

leaden walrus
#

can you connect to the serial monitor output while running the sketch?

edgy bolt
#

Hi, is there any documentation for Adafruit_TinyUSB_Arduino library, so I can understand it easierly

pine bramble
edgy bolt
#

ye, but that doesnt explain anything

blazing crane
#

(lemme grab from Nano 33)

blazing crane
#

@leaden walrus Ok, so the 33 is not sending periodic Serial messages like the Uno is

#

Occasionally I'll get a couple but it's inconsistant

#

The only stable message I get is when I unplug the camera it spams the Serial Monitor with "SPI Interface Error" or something like that

leaden walrus
#

those might help narrow down where in the code things are stalling?

blazing crane
#

Well, since that was just the example program, I only just needed it as a starting point/useful for debugging. I just used the Uno when I still needed their example tools. My new custom program works on the IoT fine so idk what's up with their code lol

#

Now I just gotta do some Googling on how to parse a jpeg file

tacit jewel
#

with a arduino zero can you use the native usb for serial output and debug at the same time because when I debug it disconnects from windows

leaden walrus
celest basalt
leaden walrus
#

if you want to program the pico with arduino, yes

celest basalt
leaden walrus
#

you're working with an LCD that has an arduino library, but not a circuitpython library?

stable forge
#

@celest basalt you were using my CircuitPython library to try to get that PCF8574 LCD display to work. I suggested that you try it with an Arduino library to see if it worked under other circumstances. I also said that it might need a level shifter to work properly, even if it was sort of working by responding to the i2c.scan().

celest basalt
stable forge
celest basalt
#

Oh

#

but then would my files get deleted

leaden walrus
#

if you're using a board with spi flash, then arduino generally won't erase those unless you run a sketch that does so.

#

but easy enough to just save local copies of everything

#

libraries can always be redownloaded

#

once the hardware has been sanity checked with arduino, can easily go back to circuitpython

celest basalt
#

then once the display has been checked with arduino I drag everything back into

#

ykw i'll just do that as my last step

north stream
#

I like to save my files locally anyway, for review/re-use as well as a backup.

celest basalt
#

okay

cedar mountain
#

This line looks a little weird: lastCount != count;Normally I'd expect that to just have a normal =.

#

Also you might want to play around with the "50" parameter in the debounce configuration... possibly it's not a perfect match for your button when it's being pressed rapidly.

fresh pendant
#

Hi! I could use a hint for what to try. I've got an esp32-s2 tft feather that I've previously programmed with Arduino. I wanted to update the program, but after I "successfully" upload the sketch it only shows me the tinyuf2 bootloader screen, and my program doesn't start. I'm still on Arduino 1.8.16 but I made sure the esp32 package was up to date in the boards manager.

I've tried fully erasing the board and "flash bootloader" but neither has changed what I'm seeing.

The upload says it ended with an error but it's just that I am supposed to press reset manually:

WARNING: ESP32-S2FNR2 chip was placed into download mode using GPIO0.
esptool.py can not exit the download mode over USB. To run the app, reset the chip manually.
To suppress this note, set --after option to 'no_reset'.
An error occurred while uploading the sketch```
fresh pendant
#

I can install CircuitPython fine as a uf2 🤣 but I was going to use arduino today

gilded swift
#

I experience the same thing

livid osprey
gilded swift
#

For whatever reason if you try to do after=soft_reset uploads fail on esptool. It’s likely not a huge issue

fresh pendant
#

No, the "GPIO 0" thing is totally expected -- It happens anytime you have to use the reset button + boot button to enter the bootloader

#

it is in a feather quad with 3 other boards that are I2C displays, I'll pull it out and repeat the bootloading process to see what happens.

#

same without the other featherwings connected --- after uploading sketch from arduino, it shows the uf2 bootloader screen

#

@gilded swift did you test and see the same problem?

#

or did you mean the thing about GPIO 0 you also experience?

gilded swift
#

It’s been an issue I’ve seen for a while

#

The GPIO 0 message

fresh pendant
#

OK

#

yeah that's an esp32s2 limitation for sure

gilded swift
#

Usually I just reset it manually

#

But your issue might be different

fresh pendant
#

but when you DO reset it you get your sketch and not uf2

gilded swift
#

Yeah

fresh pendant
#

I should try a different sketch I guess, but my sketch worked last time I uploaded it .. which was months ago

#

OK a different sketch is not affected. so that says something.

#
Global variables use 54356 bytes (16%) of dynamic memory, leaving 273324 bytes for local variables. Maximum is 327680 bytes.
``` plenty of space left over
gilded swift
#

Hmm

#

Do you have any other esp32s2 to try?

fresh pendant
#

probably

#

well I hate these kinds of things but I updated all my libraries and removed a damaged one (FreeRTOS-Arduino) and now I can enter my sketch again

#

but it's still having network problems

fresh pendant
#

OK, well, most of the problems seem to have been operator error. I'm up and running again. Thanks!

trim zodiac
#

Hello
I am uploading this code to my Circuit Playground using avrdude on a raspberry pi 4: https://github.com/pokir/arduino-bare-metal-blinking-led

this program resets the board using 1200 bps touch reset method in src/reset.py (like https://github.com/arduino/arduino-cli/blob/7415e269061ff4d90e6356f6c1156941122d58c3/arduino/serialutils/serialutils.go#L30-L56) and then uploads the code in src/led.c using avrdude (everything is in the Makefile)

it works fine the first time i upload it, but then once it is uploaded the circuit playground is no longer listed on lsusb

and there are weird error messages in dmesg after it showing the circuit playground disconnecting

i also noticed the idProduct and bcdDevice values change in dmesg after uploading the code using avrdude (idk if that is relevant)

the only way to then upload code again using the script is to use the reset button to put the board into bootloader mode and to disable the line that disables dtr in src/reset.py, and then to run make

when i upload any code to it through the Arduino IDE, it fixes all problems and then shows up normally on my raspberry pi while running

Is there something that must be done while uploading to the Adafruit Circuit Playground (Original Developer Edition) to make it not disconnect from USB port?

daring crypt
#

Question: I was playing with different examples on my ItsyBitsy nRF52840 Express and it was working with different examples. But then it stopped working after i tried a sketch that probably wasnt right for it (not in the examples folder for the express). I hit reset and got a "No data received on serial port" error after trying to re-upload another sketch. I went into usb bootloader mode and it opened up the usb drive and I can see "CURRENT.UF2" bootloader file.. do i just copy over and rename the "update-bootloader-itsybitsy_m0-v3.7.0.uf2" to "CURRENT.UF2"?

solemn cliff
#

it's not a real drive, there's no real file, it just flashes the data from the file you drop

daring crypt
#

oh thanks. Does it have to be named CURRENT.UF2? (i mean, should i rename the update-bootloader.uf2 to CURRENT.UF2) and then drag and drop?

rough torrent
#

no

daring crypt
#

i've since dragged and dropped the new bootloader and tried uploading another previously known working sketch, and im still seeing in the logger daemon : "No upload port found, using address /dev/ttyS0" (which was working before.)

daring crypt
#

i found that I was grounding the wrong pin, and afterwards, it worked to my delight

silk token
#

is it a good idea to power a single MG995 servo, and rdm6300 rfid module, and three buttons from the arduino 5v power pin? The servo datasheet says it only uses 350mA, and the rfid only uses 50mA. I have the buttons using the internal pullup resistors.
I get the stk upload error when everything is connected to the power/ground pins but it seems to work if I upload while disconnected, then connecting them.

I was also hoping someone would look at my code and tell me why its actuating the servo on initial startup?
https://github.com/flyingfishfuse/rawr_auto_cat_feederz_uWu/blob/main/main_cat_feeder.ino

livid osprey
# silk token is it a good idea to power a single `MG995` servo, and `rdm6300` rfid module, an...

Should be fine. It may be a bit on the edge of your current limits if you’re powering with usb, but it should be totally fine if you power it with the barrel jack.

Can’t look at your code right now, but what kind of startup movement are you seeing? Is it random movement before your code starts executing, or simply a desire to leave the servo in its current position until otherwise commanded?

silk token
#

it moves from closed to open, the full 90 degree arc. I am double checking the code after refactoring/cleaning so I am about to test it again but with it in the open position , see if it does the opposite or pushes another 90 degrees in the same direction. The expected behavior is for it to remain in its position pre power up

#

is it a problem that I have the stk500_getsync() error with the servo and rfid and button board connected? it seems to upload fine if I detach those and plug them in after upload

I think part of the problem is the pin headers on the uno, this board doesnt seem to be too high quality, jiggling the wires seems make it stutter

livid osprey
livid osprey
silk token
#

I will try a second power source, I need to wait for some single cell battery clips to arrive for that. I bought some doubles but they were mis advertised as parallel and they were configured as series.... orrr... I think I am gonna cut them apart and reconfigure them, heres to hoping I can solder the stainless before the plastic melts!

edit: i forgot to thank you for your input, my brain isnt right today, sorry lmao

hoary canopy
#

If I output an audio signal from an arduino that is wired to the mic in of a radio, do I need to amplify the audio signal?

#

I'm thinking no, because a normal mic I would plug into there wouldn't be powered... or would it?

north stream
#

The arduino signal is more or less what's known as "line level", which is more than mic level, so you may need to attenuate (the opposite of amplify) it.

hoary canopy
#

Is there a way to check if there is continuity on the load side of a relay with the Arduino, without the danger of the high voltage on the load side damaging the arduino? The check would be done before the relay is activated, and would test that the load is conductive at low voltage. Only after will the relay be activated

I saw this image here, but I don't understand how that "continuity test" wire could work https://forum.arduino.cc/t/how-to-input-a-high-voltage-switch/851469

#

I'm doing a similar circuit where a ~12v battery would be connected to a high power load

cedar mountain
#

If you want to detect a 12V voltage, the simplest thing to do would be to use a simple resistor divider to bring it down to the Arduino logic-level range (3.3V or 5V depending).

hoary canopy
#

Both options sound good to me. I understand now how that wire works. Checking for ground sure is smarter than checking for positive. I'm leaning towards this option rather than voltage dividers to make sure both system are completely electrically isolated

#

Thank you very much!

north stream
#

Another option is an opto-isolator, which can safely detect the presence of voltage without any electrical connection (I'm fond of that particular trick)

hoary canopy
#

That's a great option as well, thank you!

foggy anchor
#

hello, I would like to know if a shift register can duplicate an analog port

cedar mountain
foggy anchor
#

I see but is there a way to duplicate some analog ports?

cedar mountain
#

The standard way would be via an external ADC or DAC chip, connected by SPI or I2C.

foggy anchor
#

Okay, I will check that, thank you for your help!

safe shell
#

@foggy anchor there's also the option of an analog mux/demux perhaps ...SparkFun has 8- and 16-channel breakouts, if you don't need to access them all simultaneously

blazing crane
#

I decided to refactor a lot of my code earlier today, and once I got it back up to a point that's useable, I went to upload it (Nano 33 IoT). After uploading, the board disappeared from the port selections (running ls /dev showed no device so it's not an IDE issue). It sometimes reappears, although it seems to be random (spamming the reset button appears to help). Uploading any other piece of code works without issue. I've also tried with multiple boards and multiple cables. The only thing consistent is that the code I've linked below seems to break things.

I have no idea why, and it's hard to test since even I can't even really upload. Any help is much appreciated!
-Zman

https://github.com/Zman350x/CamTest1

#

Update: It appears quickly double tapping the rest button make the Arduino wait for a new sketch to be uploaded. That explains why spamming reset helped and only further goes to show that my code is the culprit.
In addition, the line in the main .ino file BeaconCamera camera = BeaconCamera(); seems to be the source. I'm going to follow it deeper and see what exactly causes it

#

Got it!

humble pecan
leaden walrus
#

can you link to specific IR sensor being used. they can vary in terms of output and general functionality.

humble pecan
leaden walrus
#

where/how did you edit the sensitivity etc? that doesn't look like a software thing

humble pecan
#

The PIR sensor has two potentiometers on the back that adjust sensitivity and time.

leaden walrus
#

ok. right. and adjusting those is what you mean by "edit"?

humble pecan
#

By changing the potentiometer position.

#

So yes

leaden walrus
#

what retriggering mode are you using? (set with the jumper)

humble pecan
#

I've tried both but currently it is at the H position.

leaden walrus
#

what's your indication it keeps cycling high/low?

humble pecan
#

The serial output goes like this:
Motion detected!
5 seconds pass then:
Motion ended!
and then repeats.
I also just made a simple pin reader program and it appears to be saying the same type of information.

leaden walrus
#

That is happening with constant continuous motion occurring in front of the sensor?

humble pecan
#

That's with no motion

#

And with motion nothing changes

leaden walrus
#

got the sensor covered up?

humble pecan
#

No although it is in somewhat small space (about five feet)

leaden walrus
#

try covering it to make sure nothing is false triggering it

humble pecan
#

Motion ended! Motion detected! Motion ended! Motion detected! Motion ended! Motion detected! Motion ended!
I covered it up and it's still doing the same thing

leaden walrus
#

what arduino board are you using?

humble pecan
oak dragon
#

Has anyone had success using the internal jtag debugger in the Adafruit ESP32-S3 TFT Feather? I can't seem to get it working properly in vscode/platform.io. It gives me random variable data and doesn't pause at breakpoints.

atomic lava
#

i have entirely forgotten how to write in Arduino

north stream
# atomic lava i have entirely forgotten how to write in Arduino

I hadn't in a while and was rusty too, but got going again by looking at some of the examples supplied with libraries I wanted to use and was able to pick up what I needed in an afternoon. You can also go over one or two of the tutorials again to refresh your memory.

glad thunder
#

I have a 10k potentiometer wired up to an analog pin that is just reading 0,1,2 no matter where on the dial it is. I checked the continuity and everything is fine (middle to A4, left to 5v+, right to gnd). when I short it out to 5v, the analog reads 1024. what are the next steps in debugging? should I assume a bad pot?

gilded swift
glad thunder
#

Not easily, my board is a bit of a rats nest

#

I could draw it in fritzing

#

I found another pot so I'm going to test to see if the pot is bad

gilded swift
#

Okay

#

What you’re doing seems like you’re following a guide like this?

glad thunder
#

basically

gilded swift
#

I’d try taking the analog read out of your print statement and assign it to an int variable and then print that int variable

#

I don’t know how much that changes it. But Arduino can be fickle sometimes

glad thunder
#

got it!

gilded swift
#

Nice!

untold fractal
ivory ice
#

Hello! I have experienced some unexpected errors with this bit of code for an esp8266. I keep getting ```C:\Users\bookl\Documents\sketch_oct05a\sketch_oct05a.ino: In function 'void loop()':
sketch_oct05a:15:16: error: expected unqualified-id before '.' token
15 | while (Client.connected() == true) {
| ^
sketch_oct05a:16:17: error: expected unqualified-id before '.' token
16 | if (Client.available() == true) {
| ^
sketch_oct05a:19:19: error: expected unqualified-id before '.' token
19 | Client.println(1);
| ^
sketch_oct05a:30:18: error: expected unqualified-id before '.' token
30 | while (Client.available()== true) {
| ^
sketch_oct05a:31:13: error: expected unqualified-id before '.' token
31 | Client.read();
| ^
exit status 1
expected unqualified-id before '.' token

for the code

`#include <ESP8266WiFi.h>
IPAddress local_IP(192,168,0,1);
IPAddress gateway(192,168,4,9);
IPAddress subnet(255,255,255,0);
WiFiServer server(80);
int laststate = 0;
void setup() {
WiFi.softAPConfig(local_IP, gateway, subnet);
WiFi.softAP("Button");
server.begin();

}

void loop() {
while (Client.connected() == true) {
if (Client.available() == true) {
while (digitalRead(1) == HIGH) {
if (laststate == 0) {
Client.println(1);
laststate == 1;
}
else {
if (digitalRead(1) == LOW) {
laststate == 0;
}
}
}
}

while (Client.available()== true) {
  Client.read();
}

}
}```
Also, i am not sure if it is pertinent, but here is the (networky part) of the code it is meant to interface with

#include <ESP8266WiFi.h>
void setup() {
  WiFi.begin("button");
  client.connect(192.168.0.1, 80)

}

void loop() {
  while (client.read() == 1) {
    digitalWrite(D1, HIGH);
  }
  digitalWrite(D1,LOW);
}

thank you

solemn cliff
#

looks like tou need something like

WiFiClient client = server.accept();
ivory ice
ivory ice
solemn cliff
#

that would be in the loop, it's where the server reacts to a client connecting

ivory ice
#

ok

#

ill try it

ivory ice
solemn cliff
#

oh I don't know then

ivory ice
#

ok onto stack overflow then. thanks for trying

ivory ice
#

alright so I needed to change server.accept() to server.available() thanks for your help

solemn cliff
#

interestingly googling ESP8266WiFi leads to the "latest" version version that uses accept() but the "stable" (3.0.2) version uses available()

ivory ice
wind drift
#

I am using the MPR121 capacitive touch sensor.
https://learn.adafruit.com/adafruit-mpr121-12-key-capacitive-touch-sensor-breakout-tutorial/electrodes

I want to power it with a battery and also via USB.

It seems the sensor calibrates when booting. If I have it booted while connected to USB it works fine. But once I remove the USB cable and is powered via the battery it doesn't work anymore.

Is there a way to avoid this?
I guess I would have to detect when the USB is connected/disconnected and recalibrate the sensor each time? Or is there a better approach?

Adafruit Learning System

Get a little closer...closer...now touch it!

#

And is there a command I can use to recalibrate it?

leaden walrus
#

what is your indication that it is not working?

red monolith
#

Can I have one Arduino nano digital write out to the digital in pin of another nano. This only needs to be a one way message. I can’t seem find a clear answer. Any help is appreciated.

leaden walrus
#

yes

strange cradle
ivory ice
#

alright sorry to keep pestering y'all, but i got my code to upload, but its not working. Where am I going wrong. The wifi network shows up. server: ```#include <ESP8266WiFi.h>
IPAddress local_IP(192,168,0,1);
IPAddress gateway(192,168,4,9);
IPAddress subnet(255,255,255,0);
WiFiServer server(80);
int laststate = 0;
void setup() {
WiFi.softAPConfig(local_IP, gateway, subnet);
WiFi.softAP("Button");
server.begin();

}

void loop() {
WiFiClient client = server.available();
while (client.connected() == true) {
if (client) {
while (digitalRead(1) == HIGH) {
if (laststate == 0) {
client.println(1);
laststate == 1;
}
else {
if (digitalRead(1) == LOW) {
laststate == 0;
}
}
}
}

while (client.available()== true) {
  client.read();
}

}
}and the client#include <ESP8266WiFi.h>
WiFiClient client;
void setup() {
WiFi.begin("button");
client.connect("192.168.0.1", 80);

}

void loop() {
while (client.read() == 1) {
digitalWrite(1, HIGH);
}
digitalWrite(1,LOW);
}``` thanks for your help

wind drift
#

@strange cradle 'begin' was not declared in this scope

#

is what I get

fallow valve
strange cradle
north stream
fallow valve
#

Servos are a bit fast and unrealstic

north stream
#

A servo goes to the position you tell it to, so to operate one at a programmed rate, you basically slowly change the commanded position.

red monolith
#

Anyone see any issue repurposing old usb a cords to pass a ground and three data lines between two Arduino nanos. Would the twisted natural of the data line in the cord have any impact? I was hopping to to easy plug and unplug capability. Thanks in advanced.

north stream
#

For a low-speed connection, the wire twists won't have much of an effect.

pine bramble
#

Usually repurposing well-known connectors exposes you to plugging them into the 'original purpose' port by mistake.

#

I had a very nice Kenwood shortwave; I used an AC 120V type plug with it to power it on 12 VDC. Forgot. Gave it away. Got a phone call. Yup. Plugged it into 120. ;)

north stream
#

Like the "householder" photographic flash connector...

pallid grail
#

@leaden walrus Can I have you take a look at an Arduino example PR? I'm kind of blocked on it, and Limor is understandably busy. Basically, when she added PCF8575 support to the PCF8574 library, she forgot to add the examples. So I duplicated everything at her suggestion, and updated it to be 8575 compatible.

leaden walrus
#

@pallid grail sure. how urgent?

pallid grail
#

It's the last part of this guide, and I've done everything else in the guide.

#

The changes aren't big. Basically update the names, and update 8 to 16 where applicable.

#

@leaden walrus Limor got to it 🙂

#

@leaden walrus Do I need to release the library for the examples to show up in the Arduino IDE in the menu?

leaden walrus
#

yep. i can do that real quick.

pallid grail
#

Oh perfect, thank you so much.

leaden walrus
#

i'll wait for merge ci just to be sure

pallid grail
#

Makes sense. I support that.

#

Any idea how long it takes to show up as an update in the IDE? I think I've gone through this once, but I don't remember how it went.

pallid grail
#

Thank you!!

leaden walrus
#

i think less than an hour for it to work its way thru

pallid grail
#

Ok. Am I right in thinking that when the .ino is in a directory on GitHub, it doesn't show up as in a directory in the IDE examples list? e.g. the examples list shows File > Examples > Adafruit PCF8574 > pcf8575_buttonledirq , and not * > * > Adafruit PCF8574 > pcf8575_buttonledirq > pcf8575_buttonledirq ?

leaden walrus
#

yep

pallid grail
#

That's the last thing to edit on the guide page, and if I can extrapolate it without seeing it, then I don't necessarily need to wait for the release

#

Ok rad

leaden walrus
#

arduino requires the folder/sketch name to be the same

#

my_example/foo.ino would not work

#

it'd complain about "sketch not found" or some such

pallid grail
#

Right.

leaden walrus
#

can have other files. but must at least have folder_name/folder_name.ino

pallid grail
#

Ok

#

Thank so much for your help!

foggy anchor
#

Hello, can someone explain to me how to set up the miso,mosi, cs, and sck in a Rasberry pico? the goal is to use an sd card but with the Arduino ide I already search for an explanation but they don't say how to code the pins.

leaden walrus
foggy anchor
#

yep

leaden walrus
foggy anchor
#

already done

#

the problem is not this.

#

one moment please

#

// Variables utilisées pour la carte SD
const int sdCardPinChipSelect = 17; // Le lecteur de carte SD sera branché sur la pin 10 pour le CS (chip select), 11/12/13 pour le MOSI/MISO/SCK du bus SPI
const char* nomDuFichier = "Ivypots.csv"; // Format 8.3 (c'est à dire 8 lettres maximum pour le nom, et optionnellement 3 pour l'extension)
File monFichier;

#

it is write in french but

#

you see the

#

sdcardpinchipselect

#

there is only one pin

#

for the CS

#

the problem is that i want to choose the pin for the mosi miso ect...

leaden walrus
#

in general, those pin choices have already been made

foggy anchor
#

yes

leaden walrus
#

those are the pins you'd use for SPI and SPI1

foggy anchor
#

yes but how the program know that i am using those pin's?

leaden walrus
#

from that file

#

and it knows to use that file from what board you select in the arduino IDE

foggy anchor
#

okay now i see

#

thanks you

leaden walrus
#

some libraries are written where they use SPI directly internally

#

there's no way to say "use SPI1 instead"

#

with others, SPI may be default, by they also allow passing in another reference, like SPI1

#

just depends on how the library is written

foggy anchor
#

so to find out I would have to look inside the library

leaden walrus
#

yep

foggy anchor
#

okay

#

thanks

leaden walrus
#

as a counter example, here are the SPI pins defined for the adafruit feather rp2040:

#

different pins used are simply a design decision, for any given board

foggy anchor
#

yes

#

i see the difference between the two library

#

also is it possible to duplicate an analog port

#

?

cedar mountain
foggy anchor
#

there is only 3 analog pin in the rasberry pico

#

i would like to know if it is possible to add another one

cedar mountain
#

Ah, gotcha. Unfortunately not. You'd need to use an external ADC (connected on I2C or SPI) or an analog multiplexer to switch multiple signals onto the same pin at different times.

hazy roost
#

hello, im having a problem w/ my arduino nano and sd card reader....when I try to initialize it, it keeps saying it failed. I looked at the schematic (arduino is attached to a separate pcb w/ the sd card reader attached) and it looks like it's hooked up correctly, but it's not working. I made sure to format my sd card as well. any ideas?

#

here is the accompanying schematic

hazy roost
eternal cloud
hazy roost
#

tried the code on there an I keep getting "initialization failed" @eternal cloud

stuck trout
#

I have a Elegoo Uno R3 and I can't get more than 1 Neopixel to light up, it's not even the right color it's like a pale white. Code: Neopixel library RGBW example. Neopixels - 144 led/m cut down to 30 leds. Powered by 5v 10a psu.

prime glen
#

Hello. I’m trying to connect Arduino Uno R3 to Arduino Ide, and can’t find it in the boards area. How can i get it to appear?

north stream
north stream
north stream
prime glen
#

Awesome, thanks!

stuck trout
#

Hello I tried switching up the board I’m using to see if that mattered and it doesn’t seem to. I am using the neopixel circuit Python example code and a string of cut 144led/m rgbw neopixels. And I can only get the first pixel to light and it doesn’t seem to properly light, it’s like a washed out color and not correct.

#

I’m completely at a loss on why they wouldn’t be working

north stream
#

It could be that your board is 3.3V logic and the strip is 5V logic and you need a level shifter between them.

#

It could also be that the connectors aren't soldered so they aren't making a good-enough connection to work.

stuck trout
north stream
#

Try holding the wires in place to see if a better connection helps. Another option for more-reliable temporary connections to through-hole pads like that is "mini-grabbers" which have a little spring-loaded hook.

stuck trout
#

Hmm tried cutting off that jst connection and going straight to the board and nothing. It’s like this thing just doesn’t get data. If I short the data lines it produces the same result as if they are connected to the board.

north stream
#

My guess then is that first LED has been damaged 😦

stuck trout
#

How does that happen? Is that why you should a capacitor in parallel with the psu ?

north stream
#

Could be static charge, a wire brushed the wrong thing for an instant, the strip bent somehow and put force on the LED, or some other thing I haven't thought of.

#

A capacitor on the PSU side will tend to smooth out the current variation and reduce voltage variation in the LED supply voltage, but won't really do anything to protect the digital input. Some builders like to include a series resistor in the digital input lead to limit current and dampen reflections, that might have some protective effect, I don't really know.

prime glen
#

I was able to get the right Arduino board, but now how do i add a new port? both of the ports i have aren’t the right ones. Note: i’m on mac

north stream
#

What do you mean by add a new port?

#

Are you not finding a serial port matching your Arduino? If so, you may need to install the right serial driver

prime glen
#

I’ll try installing a serial driver, thanks!

cedar mountain
prime glen
#

I used the USB that came with the shipping

cerulean knoll
#

(which is more embarrassing because usually they're a bit thinner and you can tell the difference if you think about it, but it still got me a few too many times)

prime glen
#

It connects into my Docking Station, and then the docking station goes into my mac

north stream
# prime glen How do I do this?

First you need to find out which serial chip your board is using. There are five likely possibilities: ATmega16U2, FTDI, CH340, Prolific, and Silicon labs. The first one is already supported by MacOS, so it's probably not what you have. To find out which it is, plug the board in, then go to the System Information utility (Apple menu -> About This Mac -> System Report), then click on "USB" under "Hardware" in the left hand column. You may have to poke around some to find which bus and device it is (you can unplug/replug the board and use ⌘-R to rescan the USB subsystem to see which device comes and goes). Once you find out which kind it is, you can go download the appropriate drivers from the chip manufacturer.

prime glen
#

Awesome, thanks!

fresh linden
wind drift
#

dumb question but I want to detect when a battery is connected.

I assume I can just connect the V+ of the battery to a digital pin on the arduino and read it as an INPUT HIGH?

edgy ibex
# fresh linden Is anyone able to help me add a debounce code to my project? it's all pretty muc...
// place at top of sketch
static unsigned int lastMillis = 0;

// place in setup()
lastMillis = millis();

void buttonPressed()
{
    if ((unsigned) (millis() - lastMillis) < 5u)
    {
        return;
    }
    lastMillis = millis();
    currentCount++;
}

That's actually three separate snippets. You need the new variable lastMillis which holds the value of millis() whenever a new button press is detected. That's initialised in startup() in an effort to avoid a false alert.
Then replace buttonPressed() with what's shown. The idea is that on the leading edge of a press, you note the time, and then ignore presses for the next five milliseconds. That should be long enough to debounce the switch.
No guarantees, but that should get you steered in the correct direction.

cedar mountain
wind drift
#

4-5V roughly

cedar mountain
# wind drift 4-5V roughly

Sorry, I wasn't clear. You'd want to make sure that the battery voltage wasn't higher than the operating voltage of the Arduino.

edgy ibex
wind drift
#

I am using the arduino pro micro 5V

fresh linden
#

thanks @cedar mountain i think i have been staring at this too long i can't quite work out where things go lol

wind drift
#

so battery => 100k resistor => analog pin?

fresh linden
#

i guess the mills 0 would be the variable i can use so if i get interfeerance i can increase the value?

cedar mountain
wind drift
#

like this?

fresh linden
#

akll good thanks you i got it woreking 🙂

cedar mountain
fallow valve
#

my own "Amiga 1200" styled Keyboard with two pro micros - if there's a way to use one promicro then let's design this PCB to be better and more cleaner - an idea I had to make my own USB Amiga 1200 layout keyboard

wind drift
#

Thanks got it to work

wind drift
#

Now I have another a bit more complex problem:

I have a capacitive touch sensor which I use to turn a LED on and off.

I also want to be able to hold the sensor for a period of time and the light should stay on for that duration. I am doing this with a duration timer. millis()

So far it's working fine.

But if I disconnect/connect a battery the capacitive touch sensor goes wonky - I 'manuall' recalibrate the sensor now whenever the battery disconnect/connect is detected.

Problem however comes up when I disconnect/connect the battery WHILE holding the touch sensor.
It basically makes the sensor think I stopped holding.

Is there a way I can avoid this?

I guess I would have to save the timestamp when the battery is connected/disconnected?

quaint nebula
#

Question

#

What battery do you pals use to power ur arduino nano for led strips?

north stream
cedar mountain
#

A USB power pack can be an easy off-the-shelf approach.

wind drift
livid osprey
wind drift
#

thanks - I will give it a try.

My current problem is this:

The sensor 'recalibrates' when it is started.

Now when I am touching the pin and then add power it thinks that it is NOT sensing a touch - even though I am touching it.
I guess I have to somehow "save" the value for touching and not touching and use those values everytime it boots up?

Or is there a better approach?

north stream
livid osprey
wind drift
#

Hm tricky situation

untold fractal
#

in my captouch stuff I try to incorporate a UI feature to remind people, like "don't touch until the red light goes off" while it initializes the sensor

inland gorge
spark drum
#

How do I remove these crimps so I can have access to the triangle pads?

#

Do I just bend the dupont crimps off?

north stream
#

I'm unsure why you would prefer the little triangular junction pieces to the nice sockets, but you could probably nip them off with diagonal cutters.

cold lagoon
#

I'm currently making a shortcut keyboard with volume control etc.
The problem is that the Keyboard.h library doesn't have media keys and the HID-Project.h library has no KEY_RIGHT_ARROW/KEY_LEFT_ARROW and when i try to use both library's at once i cant upload the code.
So how can i use both features?

north stream
#

The .h files are header files, which are part of libraries. You may have to edit the files to include the features you want.

solemn cliff
#

I see them in ImprovedKeylayouts.h but I don't know the structure of how to include that

cold lagoon
#

ive figured it out. i had to write Consumer.write for the media keys and Keyboard.writefor the other keys

#

weird i couldn't use both at the same time tho

stable forge
autumn karma
#

What's the difference between the adafruit/Adafruit_TinyUSB_Arduino and hathach/TinyUSB libraries? Does the adafruit library act as a wrapper to the other and add support to the arduino IDE?

stable forge
prime glen
north stream
#

I haven't seen that one before but I'm guessing that the serial link was disconnected when the board reset (and possibly the port reappeared under another name when it reconnected). However, if your sketch works, you can probably overlook that message.

prime glen
#

What do you mean by if my sketch works?

north stream
#

If you power it up and hook up a servo, does it move like the program tells it? If so, your sketch is working (in the sense that the board is running your code).

prime glen
#

Ok, so the sketch isn't working then.

north stream
#

So it's possible that when you thought you uploaded your code, you may not have.

prime glen
#

Could it possibly be because my port disconnected? I went to check my port and it wasn't there even though it's plugged in.

north stream
#

Did it re-appear under another name?

prime glen
#

No, it disappeared from my ports. I have two other ports there, but those aren't the correct ones.

north stream
#

Re-run the USB scan to see if the device is being seen

prime glen
#

It's not being seen.

#

Sorry for putting you through this btw, I'm a total newbie.

north stream
#

No worries, we all start as beginners. If it's not appearing on USB, that's usually a hardware problem (and the problem is often something basic like a loose cable)

prime glen
#

All my cable are plugged in, and my Arduino is turning on.

prime glen
#

I noticed it also disappeared from my USB thing in System Information.

#

Before I got the error, I was able to see the USB device, and the manufacturer said "Arduino"

livid osprey
#

If you unplug the USB, disconnect the servo, and reconnect the USB, do you see anything different?

prime glen
#

Actually, yeah. The Arudino is now being detected.

#

And it's detecting my port.

#

Let me try running the code.

#

My servo is moving!

livid osprey
#

Most likely what’s happening is the max current on that particular USB port is being exceeded by the servo’s instantaneous draw, combined with the Arduino’s own power requirements

#

In the short term, connecting the servo after the Arduino powers up will avoid major inrush issues.

prime glen
#

ohh

#

i now feel very bad because after all of that heck i put madbodger through, it was just the way i was connecting everything-

livid osprey
#

In the long term, a medium sized capacitor across the servo 5v and GND terminals will save you a lot of headache.

#

Typically USB ports on your pc are limited to delivering 500mA max, but some ports may share that limit depending on how your PC is configured.

prime glen
#

ohh

livid osprey
#

Powered hubs are frustrating, but they help a lot specifically in this case haha

prime glen
#

yeah

native dagger
tardy iron
prime glen
#

yeah, my docking station is a bit annoying at times

glacial narwhal
#

i'm using the 32x32 panel with the metro m0, no power supply, only running off the board usb power. I'm only trying to light up a single pixel, but seems like 8 rows on the top and bottom don't light up with those coordinates specified. Also, the color is only red no matter what color code I set. Any ideas? THank you!

#

is it because of no external power?

cedar mountain
#

Sounds like it might be a mismatch in pixel type when the panel is configured in the software, like RGB versus RGBW or something like that.

glacial narwhal
#

This is what the example program red X looks like

#

This is what a white x looks like

glacial narwhal
glacial narwhal
# glacial narwhal

matrix.drawLine(0, 0, 31, 31, matrix.Color333(7, 0, 0));
matrix.drawLine(31, 0, 0, 31, matrix.Color333(7, 0, 0));

#

I'm not really sure whats going on

cedar mountain
#

I'm unfamiliar with this library, but I'm mildly suspicious that Color333 is actually giving you an 8-bit color value or something like that, whereas drawLine is expecting a 24-bit one.

#

(So all the bits are just crammed down into the red field.)

glacial narwhal
#

Ah gotcha

#

I'm more concerned about some pixels not lighting up

#

I ordered a buck converter to split my 9v dc adapter to 9v and 5v to power the m0 and the board together

#

HOpefully that helps and it is indeed a power issue

final yacht
#

In my experience with Neopixels, 80% of the problems are power, 15% are intermittent connections

glacial narwhal
brazen falcon
final yacht
#

very true!

zealous egret
#

Hi everyone I'm new to arduino and I'm having some issues. I have a adafruit 2.9 inch flexible display connected to E-ink friend and using the Feather M0 Adalogger. I can't seem to display Bitmaps images onto the display. Instead I get a noisy image. I converted png files to an array using Image2Lcd.

What am I doing wrong?

livid osprey
zealous egret
zealous egret
zealous egret
dry quiver
#

Assuming the bitmap display code works as intended, maybe try a different image-to-bytes converter. I've seen that staggered distortion pattern before and it's normally something not aligned right. Like the wrong height or width setting, which can occur in code but it could also be in the source.

#

Like it's displaying it correctly but it's off by one count so you see steps that should be 8 pixels (1 byte) long, as if each row got shifted by that amount

foggy anchor
#

Hello, I have just finished my program for the Wizfi360-EVB-Pico that uses Blynk for a better User experience, but I have this problem when I want to connect the board to the website(or app) :
It says “Invalid Auth Token”

But the Auth Token is the right one.
Can anyone could give me some advice for this?

slender steeple
#

I need help configuring a library for my attiny85

#

Im so confused on what I need to do

north stream
slender steeple
#

I want to remove the delay

#

and use a set of shorted pins to trigger write mode

#

this has the file I need to config

north stream
#

Ah, that's not a library, that's the bootloader.

thorny cedar
#

Hello. How could I write a vector of integers to the SD card as quickly as possible? I'm using the code below (my vector has about 2000 numbers) but it's taking about 500 ms.

#include <SD.h>
File txtFile;
int count = 0;
int arr[3000];
int t[3000];

...

txtFile = SD.open("file.txt", FILE_WRITE);
  if (!txtFile) {
    Serial.print("error opening file.txt");
    while (1);
  }
for(int n = 0; n < count; n++)
    {
      txtFile.print(t[n]);     
      txtFile.print("\t");
      txtFile.println(arr[n]);    
    }
slender steeple
#

this is what I want

#

but I wouldnt know how to compile that

north stream
north stream
slender steeple
#

do I have config everything manually or can I just uncomment what I want

north stream
#

At a minimum, you'd change the ENTRYMODE #define statement to ENTRY_JUMPER. You can also change the JUMPER_PIN and related defines if you want to use a different pin than the default.

slender steeple
north stream
#

So you'd modify line 161 (you don't have to uncomment stuff, it does most of the configuration for you via conditional compilation)

#

You can optionally modify lines 146-149 if you want to change the pin

slender steeple
#

Ok does this file just stay where it is or do I have to move it

#

And how do Ik what pin is what

cerulean knoll
north stream
#

What I usually do is copy the file (to something like bootloaderconfig.orig) and then modify it, so there's an easy way back but I assume the file would just stay where it is.

slender steeple
#

on my attiny I have gnd 5v vin and p0 p1 p2 p3 p4 p5

cedar mountain
#

I'd generally expect the SD library is already buffering up a block inside the File object instead of going immediately to the card for each print statement.

slender steeple
north stream
slender steeple
#

Which yes is p0

north stream
#

As it says in the file you linked, "Activate the bootloader when a specific pin is pulled low", which means jumpering it to ground

slender steeple
#

ok

#

lets hope I dont kill this attiny 85

#

gotta hate compiling

#

```/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: address 0x2006 of main.bin section .text' is not within region text'
/usr/lib/gcc/avr/5.4.0/../../../avr/bin/ld: address 0x2006 of main.bin section .text' is not within region text'
collect2: error: ld returned 1 exit status
make: *** [Makefile:97: main.bin] Error 1

north stream
#

Hrm, looks like something doesn't fit

slender steeple
#

all I did was change ALWAYS to JUMPER

#

on line 161

north stream
#

It does say under ENTRY_JUMPER that it adds 34 bytes. Maybe you have to remove something else to make room for that functionality?

slender steeple
#

I dont see why

#

its not being put on the attiny yet

#

Im just trying to compile it from terminal

#

should I be doing something else?

north stream
#

The compiler is given a memory map of the target hardware, and the loader is complaining that one of the pieces doesn't fit in the size allowed.

slender steeple
#

Im just using make in terminal

#

cause the attiny has 8k

#

and there is a lot of space lefts for the actual sketch

north stream
#

Which seems a little odd, the default ATtiny85 build should fit in 1432 bytes, so with ENTRY_JUMPER enabled, it should be 1466 bytes.

#

Normally a portion of the flash is reserved for the use of the bootloader, and the rest is available for sketches.

slender steeple
#

ok so I switched it back to the og file

#

got this

#

Building Micronucleus configuration: t85_default
text data bss dec hex filename
0 1512 0 1512 5e8 main.hex
/bin/sh: 1: python: not found
make: *** [Makefile:106: main.hex] Error 127

north stream
#

Looks like the build chain depends on Python as well?

#

Note, I haven't used that particular bootloader, so I don't know much about it aside from the bits of files I scanned.

slender steeple
#

ok so I switched it back again and it compiled with out error

north stream
#

It's bedtime for me

slender steeple
#

oki bye

#

I will continue to try to figure this out I geuss

#

so there is a bug

#

they fixed it

#

but I gotta see how I can fix it

autumn karma
thorny cedar
# north stream There are likely a few things slowing it down. It may be doing an erase/write f...

How can I encode the buffer using vectors of integers? The example below shows using a String variable.

https://github.com/arduino-libraries/SD/blob/master/examples/NonBlockingWrite/NonBlockingWrite.ino

When I code like this example, the sample rate drops considerably (from 35 ksps to 4 ksps), compared to:

...
arr[count] = analogRead(VBATPIN);
t[count] = micros()-lastMicros;
...

As for recording to SD, your tip was useful for my problem, the recording time reduced from 500ms to less than 10ms. On the other hand, as I said, the sample rate is no longer useful for my application.

In short:

Before - sampling at 35 ksps/recording 500 ms
After - sampling at 4 ksps/recording at 10 ms

GitHub

SD Library for Arduino. Contribute to arduino-libraries/SD development by creating an account on GitHub.

cerulean knoll
#

uh, that example is interesting because it doesn't look to me like it's doing what I'd call a "non blocking write"

#

it looks like it's doing a non blocking check of whether to write, and then doing a blocking write if the buffer is full

#

maybe I'm misreading it

#

If RAM constraints allow it, maybe do the write to the SD card after the full recording has been captured?

#

then you'd avoid slowing down the capture loop

#

Could be worth making sure there aren't any surprise dynamic resizes of that String buffer. Writing some kind of stack based circular buffer to use instead could be pretty straightforward

#

the "remove" call seems like that can't possibly be performant, but maybe it's internally implemented as a ringbuffer or something idk

#

(seems unlikely because I think Strings are dynamically resizable)

#

What's the total size of the recording?

#

What about

txtFile = SD.open("file.txt", FILE_WRITE);
  if (!txtFile) {
    Serial.print("error opening file.txt");
    while (1);
  }
txtFile.write(arr.data(), arr.size() * sizeof(arr[0]));
#

That should do a buffered, synchronous write I think? The first argument is the address of the vector's underlying storage, and the second its size

cedar mountain
#

Does size() return the byte size or the array length in number of elements?

cerulean knoll
#

number of elements I think. I was assuming a char/uint8_t buffer but that's a good thing to note

#

also it looks like OP wanted to interleave two buffers

#

But this relies on the write being in contiguous memory. Maybe instead of having a separate t and arr just store both values in alternating cells of the same array

#

or be ok with having two chunks of non-interleaved output?

#

also consider if you want the output to be binary or text based

#

added a mult by sizeof(arr[0]), which I assume would work

rough torrent
#

if your microcontroller allows it, what you can do is set up an interrupt to read it to a buffer, and in the main loop just constantly pull from the buffer and write

tribal cipher
#

I need help. Please guide. The gsm module is not sending sms. Im using GSM 800A module.

#

`#include <SoftwareSerial.h>

SoftwareSerial SIM900(7, 8);

void setup() {
SIM900.begin(19200);
// Give time to GSM shield to log on to network
delay(100000);
// AT command to set SIM900 to SMS mode
SIM900.print("AT+CMGF=1\r");
delay(1000);
systemReady();
}

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

}

void systemReady()
{
// Set recipient's mobile number in international format
SIM900.println("AT + CMGS = "+91xxxxxxxxxx"");
delay(100);
// Set SMS message
SIM900.println("System is running as expected.");
delay(100);
// End AT command with a ^Z, ASCII code 26
SIM900.println((char)26);
delay(100);
SIM900.println();
// Give module time to send SMS
delay(5000);
}`

#

This is my code

little token
#
const float voltage = 5.00; // CHANGE THIS FOR 3.3v Arduinos
const float res = voltage / 1024; 
const float resistorValue = 10000.0;
int threshold = 3;
int iP = A0;
int oP = A5;

void setup()
{
 Serial.begin(9600); // starts serial monitor
 pinMode(oP, OUTPUT); // sets output pin to OUTPUT mode
 pinMode(iP, INPUT); // sets input pin to INPUT mode
}

void loop()
{
 int analogValue = 0;
 int oldAnalogValue = 1000;
 float returnVoltage = 0.0;
 float resistance = 0.0;


 while(((oldAnalogValue-analogValue)>threshold) || (oldAnalogValue<50))
 {
 oldAnalogValue = analogValue;
 digitalWrite(oP, HIGH );
 delay(10); // allow ringing to stop
 analogValue = analogRead( iP );
 digitalWrite(oP, LOW );
 }

 Serial.print("Return voltage : " + analogValue * res + " v.");
 Serial.print("That works out to a resistance of : " + ((5.00 * resistorValue) / returnVoltage) - resistorValue + " Ω.");

 delay(5000);
}
#

This is the code someone sent me

#

and im having trouble understanding what oldanalogvalue is used for

#

and why the while loop condition is there, for what reason etc

#

this is for an arduino project to measure conductivity of a liquid

#

if anyone can help me

cedar mountain
#

The loop is basically running until the analog value settles down enough to be almost equal in two successive readings. I'm not sure why the sensor would have some initial instability, but that's what the code expects to happen.

little token
#

this is the page my friend got it from if there is any explantion you can see that i cant?

cedar mountain
#

No, I'm afraid not. I'm not sure why the code is pulsing the output pin either.

#

Possibly there's some subtlety about how ions in the water react to the voltage.

little token
#

can i ask what you mean by pulsing the output pin?

#

sorry not that informed on arduino

#

just enough to get it to work

cedar mountain
#

These lines:```digitalWrite(oP, HIGH );

digitalWrite(oP, LOW );```turn on and off the output pin each time though the loop. So I'm not quite sure why it's doing that, instead of just turning it on and leaving it on at the beginning.

final yacht
west leaf
#

I'm struggling to figure out how to write values that persist when power is off on a Circuit Playground Express using the Arduino IDE

#

I would expect to use something like EEPROM, but #include "EEPROM.h" fails with no such file or directory

#

CircuitPython seems to have a nvm module, which I assume is available on the CPX, though I haven't tested it

#

and my searching hasn't found any examples or code mentioning how to access an EEPROM from Arduino code on the CPX (or other Circuit Playground boards)

#

does anyone have any suggestions for avenues I can explore? Thanks!

west leaf
thorny cedar
# cerulean knoll added a mult by sizeof(arr[0]), which I assume would work

Thanks. I'll try as you suggested with the 'write' function and with a vector with alternating cells with 't' and 'arr'. In fact, these variables need to associate with each other.

About the write size and the suggestion of writing to SD only at the end is unfeasible as I run out of RAM quickly (in 60ms - reading and buffering in the vector is happening at the maximum speed possible, ~25us) and I need to do the acquisition for a few minutes. The solution I'm looking for is basically the following:

0 - 60 ms: reading + buffering
60 - 70 ms: writing to SD (~15% data loss on each buffer flush cycle)
70 - 130....
...

I've been using the SD library. Do you think the performance would be better with SDFat?

My board is the Feather m0 adalogger. Would the microcontroller support interrupts? If yes, would you indicate any example to start understanding this? Why using interrupts would be better?

I have no experience with embedded systems or c/c++. At least I have some experience in other languages. Sorry for so many questions.

north stream
wet crystal
#

Hey people. I am stuck at something maybe someone else can help me out

#

I´m still working on the Ninebot turn indicator bord and someone send me the code to replace with, but I have no clue how to compile it 😄

thorny cedar
#

I keep having problems in the 'write' function of the 'File' from "SD" library. Could someone give me a very simple example of initializing a vector with alternating cells ('micros' and 'analog pin value'), and how to assign and use it in the write function? My C level is pretty low. With a variable of type String, the recording works well as in the example I mentioned, but the lines 'buffer += ....' are very slow (fast writing, but slow reading). My application is quite simple: I need to read an analog input at the highest possible rate from the void loop() and write these integers along with the time (t, v) to a file.

west leaf
cerulean knoll
# thorny cedar Thanks. I'll try as you suggested with the 'write' function and with a vector wi...

I don't have an Arduino handy to test this out, but:

#include <SD.h>

#define NUM_ENTRIES 3000
#define BUFFER_SIZE (NUM_ENTRIES * 2)
int t_and_v[BUFFER_SIZE];

...

File f = SD.open("file.txt", FILE_WRITE);
if (!txtFile) {
  Serial.print("error opening file.txt");
  while (1);
}
for(int n = 0; n < BUFFER_SIZE; n+=2) {
  t_and_v[n] = millis();
  t_and_v[n + 1] = analogRead(ANALOG_PIN);
}
txtFile.write((char *) t_and_v, BUFFER_SIZE * sizeof(int));

Seems like it might work? The buffer here should probably be a byte buffer, but you can probably get away with this.

I am curious though, how are you reading this data? Because this is going to print binary (and be the endianness of your CPU, etc). You might actually want to use a string. If so we can find a smart and fast way to do it.

Also, just to try and understand this better, is there a reason you're trying to sample so quickly?

safe halo
#

How do I get each element from an array when I don't know what the key numbers are? Such as when the 1,2 3,4,5 are 7,4,8,3,22?

    File file = SPIFFS.open("/sensors.json", FILE_READ);
    if (!file)
    {
      Serial.printf("Failed to load settings.\n");
      return;
    }
    char json[512] = "\0";
    int i = 0;
    while (file.available())
    {
      json[i] = file.read();
      i++;
    }
    StaticJsonDocument<i + 16> doc;
    DeserializationError error = deserializeJson(doc, json);
    if (error)
    {
      Serial.print("deserializeJson() failed: ");
      Serial.println(error.c_str());
      return;
    }
    for (size_t i = 0; i < 128; i++)
    {
      String sens = doc[i];
      Serial.printf("%s\n", sens);
      if (sens != "")
      {
        String t = sens.substring(0, sens.indexOf(","));

        snsr[i].selected = true;
        snsr[i].sensorType = t.toInt();
      }

This is the JSON it is loading:

{
    "1": "2,P/R",
    "2": "2,B",
    "3": "2,A",
    "4": "2,T",
    "5": "7,S"
}
cerulean knoll
#

Does that code you posted not work?

odd scarab
#

Dose anyone have any idea why a Adafruit 2.8" TFT Touch Shield v2 will work using the examples in the Adafruit_ILI9341 library, but not on a Arduino Mega? (tried with 2 and just get a white screen with serial port saying the sketch is running).

native sundial
#

Hi everyone, I am trying to find out if the Adafruit QT Py SAMD21 board has a MACRO similar to the Seeed Xiao SAMD21 board?
For example, in a library that I am using there is a define for the Xiao as follows:
// Seedstudio XIAO M0 port #if defined(SEEED_XIAO_M0)

Any help or pointers to documentation would be greatly appreciated 🙌

solemn cliff
#

I think it's QTPY_M0 or ADAFRUIT_QTPY_M0

outer yarrow
#

I am trying to run a simple example on Pi Pico using Arduino IDE for a usb midi device using Adafruit_TinyUSB. I am able to see a USB device is detected on the PC. However, Serial.print just doesn't work. It seems there is some issue related to tinyusb library and USB serial output.

solemn cliff
native sundial
# solemn cliff or both, the first one is the board build name, the second one is part of added ...

Ok, thank you! That's super helpful. By searching board definitions, do you mean in the boards.txt file?
In that file I see:

# Build adafruit_qtpy_m0.build.mcu=cortex-m0plus adafruit_qtpy_m0.build.f_cpu=48000000L adafruit_qtpy_m0.build.usb_product="QT Py M0" adafruit_qtpy_m0.build.usb_manufacturer="Adafruit" adafruit_qtpy_m0.build.board=QTPY_M0 adafruit_qtpy_m0.build.core=arduino adafruit_qtpy_m0.build.extra_flags=-D__SAMD21E18A__ -DCRYSTALLESS -DADAFRUIT_QTPY_M0 -DARM_MATH_CM0PLUS {build.usb_flags} adafruit_qtpy_m0.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld adafruit_qtpy_m0.build.openocdscript=openocd_scripts/qtpy_m0.cfg adafruit_qtpy_m0.build.variant=qtpy_m0 adafruit_qtpy_m0.build.variant_system_lib= adafruit_qtpy_m0.build.vid=0x239A adafruit_qtpy_m0.build.pid=0x80CB adafruit_qtpy_m0.bootloader.tool=openocd adafruit_qtpy_m0.bootloader.file=qtpyM0/bootloader-qtpy_m0.bin

solemn cliff
#

yeah that would be those:

adafruit_qtpy_m0.build.board=QTPY_M0
adafruit_qtpy_m0.build.extra_flags=-D`_SAMD21E18A_ -DCRYSTALLESS -DADAFRUIT_QTPY_M0 -DARM_MATH_CM0PLUS {build.usb_flags}

north stream
north stream
worldly dome
#

Can you do serial to serial between to arduino uno r3s? To expand ports without the problems that come with a mega?

outer yarrow
#

@north stream on the github repo, i read "Use SerialTinyUSB name instead of Serial for serial monitor" and then it worked. Surprisingly none of the examples use this. On the example they simply use Serial.

#

I am a bit confused between circuitpython vs arduino for pi pico. The developer experience is so great with circuitpython, the changes become live in a few seconds. On arduino it does take more time to compile and upload. I believe arduino sketches should theoretically be faster. Any suggestions on this? How do the library ecosystem compare in these two approaches ?

cerulean knoll
north stream
# outer yarrow I am a bit confused between circuitpython vs arduino for pi pico. The developer ...

The Arduino sketches can be faster and you can run them on less capable hardware. If you're doing something that requires fast or precise timing, responding to interrupts, or low-level bit manipulation, the Arduino environment can be the better choice. For getting off the ground quickly without getting bogged down in details, CircuitPython can be the way to go. I find them both useful, but in different ways.

tardy iron
#

compile times for Arduino sketches on a modern 32-bit microcontroller can get rather long, so that's one reason to stick with CircuitPython for prototyping, if possible

north kelp
odd scarab
#

Any one able to help me edit a sketch to work with a different screen then intended, really out of my depth here.

pine bramble
#

How do u read if a specific neopixel is on or off

north stream
#

You can use the getPixels() method to get access to the library's internal pixel storage

outer yarrow
#

Is teensy 4.1 the fastest microcontroller for baremetal programming with arduino at present ? Do faster alternatives exist ?

outer yarrow
cedar mountain
narrow wasp
#

Is VS Code still a viable way to do Arduino projects? I am trying to get it set up because I use VS Code for a ton of stuff and it would probably be easier for me to learn in that environment. However, some of these tutorials make it seems like the workarounds are not worth it and I cannot get through them without an issue.

pine bramble
narrow wasp
#

Oh wow, installed PlatformIO extension in VS Code, this seems robust and a bit overwhelming lol

pine bramble
#

I use the command line (only) but there's a platformio gui as well (have seen user screenshots askinq questions, but it was unclear what I was seeing. ;) @narrow wasp

#

RP2040 basically seems to devolve to pico-sdk (most dev environs leverage it to some degree) so it's worth it to at least 'try' the pico-sdk natively; earle philhower's port is usual though.

quaint nebula
#

I need help

#

New to arduino LEDs and I downloaded IDE and and I have fast led and the adafruit neopixel library in there

#

But it’s just not working

#

When I hit upload I get an error

#

Here’s the strips im using

north stream
#

An upload error generally means the host can't communicate with the device you're programming

quaint nebula
#

Hmm

#

Is there anyway to fix that problem?

north stream
#

First, you have to find out what the problem really is. Does it see the device?

wide shadow
#

I've tried both https://www.adafruit.com/product/1651 and https://www.adafruit.com/product/1947 on an Arduino Mega doing the Adafruit_ILI9341 -> graphicstest and both screens are totally white through the whole process. These devices are essentially New old stock. I bought them in 2015, put them on a shelf and never used them.

north stream
wide shadow
#

What jumpers?

north stream
#

Just a minute, gotta jump through some hoops for no reason

wide shadow
#

I guess I found the jumpers. Now to get my USB ports working again on my PC

#

Eventually, I want to get this working on a Feather M0, but the mega will do for now.

north stream
#

It should be doable on a Feather if the 3.3V signalling works with it (I'm guessing it will)

wide shadow
#

Planning on making my own thermostat with the BME688 and control it with Home Assistant.

north stream
wide shadow
#

Nice find. Saves me from finding some buttons with triangles stenciled on them.

livid osprey
quaint nebula
#

Hang on I’m currently at work

#

This was from when I tried to run neopixel strand test

livid osprey
#

Ah, that’s a compile error. I don’t think the ZeroDMA library is compatible with a regular arduino nano. Try the non-DMA library instead.

quaint nebula
#

Where can I find that?

#

I also downloaded the arduino fast led library and that didn’t work as well

livid osprey
#

Ignore the 1.8.7 and install the latest, mine is pretty out of date.

quaint nebula
#

Okeh

quaint nebula
#

Already have it installed

#

Maybe is the nano???

livid osprey
quaint nebula
#

Ah okeh

blazing crane
#

Spent a couple weeks on a project using a Nano 33 IoT. Now that I have it working, I need to make 6 more of them by Saturday (uggh).
Unfortunately, the Nano 33 IoT is out of stock everywhere...

#

To what extent is the Nano RP2040 Connect a drop-in replacement?

#

Because I don't have time to significantly alter the code or order more PCBs

west quarry
#

Is there a repo of colour effect functions somewhere? Ideally documented to explain how it works

plz tag me in response 🙂

livid osprey
blazing crane
quaint nebula
livid osprey
livid osprey
quaint nebula
#

still not working

quaint nebula
#

C:\Users\senec\AppData\Local\Temp.arduinoIDE-unsaved20221012-24300-6s9du7.a7i2s\strandtest\strandtest.ino:8:10: fatal error: Adafruit_NeoPixel: No such file or directory
#include <Adafruit_NeoPixel>
^~~~~~~~~~~~~~~~~~~
compilation terminated.

exit status 1

Compilation error: Adafruit_NeoPixel: No such file or directory

#

and tried it with the _ZeroDMA

#

In file included from C:\Users\senec\AppData\Local\Temp.arduinoIDE-unsaved20221012-24300-1ge8vnc.hmjt\strandtest\strandtest.ino:8:0:
C:\Users\senec\OneDrive\Documents\Arduino\libraries\Adafruit_DMA_neopixel_library/Adafruit_NeoPixel_ZeroDMA.h:4:10: fatal error: Adafruit_NeoPixel.h: No such file or directory
#include <Adafruit_NeoPixel.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

exit status 1

Compilation error: exit status 1

livid osprey
#

Wait which example are you referencing

livid osprey
quaint nebula
#

okay

sacred ivy
#

not really arduino related but I have a question on this function:

void SPI1_ReadBlock(void *block, size_t blockSize) { uint8_t *data = block; while(blockSize--) { *data++ = SPI1_ExchangeByte(0); } }

If my analysis is correct, when I call this function, it reads multiple bytes on the SPI bus but I have to specify how many bytes, and then I think I have to point to an array.

Is that right?

#

SPI1_ExchangeByte is the preceding function that basically exchanges data

cedar mountain
#

Yes, that's right. The array has to have a size large enough to store the number of bytes you ask for.

quaint nebula
#

sigh still not working. arduino being real annoying rn

sacred ivy
cedar mountain
#

If it makes your life easier, you can also pass in a pointer to another variable and read directly into a 2- or 4-byte integer, for example.

sacred ivy
#

Id have to figure out how to do that 😅

quaint nebula
#

Can you control 12v led strips with an arduino?

#

With a mosfets

cedar mountain
#

Yep, if the gate voltage range of the FET is compatible with the Arduino, you can.

quaint nebula
#

As well as adress the LEDs?

cedar mountain
#

Is it an addressable strip? If so you probably don't even need a MOSFET, since they will usually want 12V power but regular logic levels for the data. I thought you meant a non-addressable strip where you wanted to PWM-control the 12V power to it.

quaint nebula
#

Wait you can also control analog rgb led strips on arduino?

cedar mountain
#

Yes, with a FET you can fade the colors via a PWM signal. You won't get individual pixel addressing, but you can select a general color and brightness for the whole strip.

wide shadow
#

I'm having trouble getting https://www.adafruit.com/product/5046 going. I'm following the learn article too. Using all defaults for I2C on an Arduino MEGA. Doing the example Adafruit BME680 Library sketch of bme680test and it can't find the sensor. I've verified the wiring. Connected up the yellow wire to pin A5 and the blue wire up to pin A4. What am I doing wrong? I was messing with the touch screen on a capacitive touch 2.8" display earlier via this same setup and it worked just fine.

north stream
#

Maybe try an I2C scanner to see if anything is answering up?

wide shadow
#

Removed all wires from the LCD panel and no I2C devices detected with just the BME688 connected.

cerulean knoll
#

Any chance you have SDA and SCL swapped?

wide shadow
#

I even swapped which end the sensor is plugged into and no change.

leaden walrus
#

try these pins instead of A4/A5

wide shadow
#

YAY! I'm getting a response now from the I2C Scanner. Strange it wouldn't work on A4 and A5 when the touch screen does.

quartz furnace
#

Anyone know of an Arduino library that would get the Bluetooth data from a Nintendo Switch controller? Saw these at 5 below .. they are BT 5.0 so maybe with an ESP32-S3 ?

#

Didn’t see much on a google search…., only saw how to make your ESP32 with connected buttons *Acting as a controller

#

I however want to use these slim somewhat expensive controllers

livid osprey
trail swallow
#

I have a Feather M4 Express, and I stopped being able to upload my code to it despite trying to press reset as the upload starts. When I press reset, it'll turn on and blink the built-in LED for just a moment, but never seems to show up for programming. I uploaded it to another Feather M4 Express to try to rule out hardware problems and it started doing the same thing. :( Any suggestions what else to try to recover it?

trail swallow
#

Aha, updating the bootloader did the trick.

wide shadow
#

I have a BME688 sensor (https://www.adafruit.com/product/5046) hooked up to an Arduino MEGA. The Example sketch bme680test from Adafruit BME680 Library works fine, but when I try to get the basic sketch from BSEC Software Library to work, even with following the Learn guide (https://learn.adafruit.com/adafruit-bme680-humidity-temperature-barometic-pressure-voc-gas?view=all), get errors:

Arduino: 1.8.19 (Linux), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
Build options changed, rebuilding all
/tmp/ccSAI8GV.ltrans0.ltrans.o: In function `main':
/home/ayourk/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:155: undefined reference to `bsec_init'
/home/ayourk/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:317: undefined reference to `bsec_get_version'
/home/ayourk/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:173: undefined reference to `bsec_update_subscription'
/home/ayourk/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:200: undefined reference to `bsec_init'
/home/ayourk/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:200: undefined reference to `bsec_update_subscription'
/home/ayourk/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:214: undefined reference to `bsec_sensor_control'
/home/ayourk/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:374: undefined reference to `bsec_do_steps'
/home/ayourk/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:446: undefined reference to `bsec_get_state'
/tmp/ccSAI8GV.ltrans2.ltrans.o: In function `Bsec::setState(unsigned char*) [clone .constprop.17]':
/home/ayourk/Arduino/libraries/BSEC_Software_Library/src/bsec.cpp:282: undefined reference to `bsec_set_state'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Mega or Mega 2560.

I know that the Learn page says that the learn page says that Arduino Mega isn't suggested, but I'm just doing testing to move to a different board later. What am I doing wrong?

trail swallow
#

I see a big “Not every chipset is supported by the closed-source BSEC library!” which seems like it would explain it.

wide shadow
#

But the learn article does state that Mega could be used.

livid osprey
# wide shadow I have a BME688 sensor (https://www.adafruit.com/product/5046) hooked up to an A...

It does look like there are a lot of broken references, and almost entirely within the BSEC library source. Seems like some modifications to a certain “platform.txt” file is needed.

https://community.bosch-sensortec.com/t5/MEMS-sensors-forum/BSEC-Library-for-BME680-on-Mega-2560/td-p/13018/page/2

wide shadow
#

I've made the modifications to platform.txt for avr, samd, and esp32

livid osprey
#

Oh, nvm.

#

You added “compiler.libraries.ldflags=“ and you still get the same compile error?

wide shadow
#

Correct.

livid osprey
#

Is it possible you have a “platform.local.txt” somewhere that might be overriding it?

wide shadow
#

I checked. Nothing relevant in the appropriate paths.

#

I did find a few platform.local.txt files, but nothing in the ~/.arduino15 dirs or used library dirs.

#

When I switch to my target board (https://www.adafruit.com/product/3857), I get the following errors: https://pastebin.com/srgL38YD
And errors in verbose mode: https://pastebin.com/nB4ti8Re

hazy roost
#

Hello, I have a cosmic watch sensor: http://www.cosmicwatch.lns.mit.edu/ which has an arduino nano on it and id like to use UART to write sensor data to to my computer. I have a UART to USB adapter, and was wondering how I could go about connecting this so that I can record sensor data in a plain text file?

north stream
#

Basically, you'd connect the TX and 0V reference leads from the Nano to the asynchronous serial adapter. Then on the host computer, open the device for the serial adapter, set up any communication parameters required to match the Nano's serial configuration, then read from the adaptor and write to the file.

hexed sphinx
#

Hi, has anyone succeeded to make a tilt-compensated compass with the HMC5883L or something?

north stream
#

You seem to have crossposted this question. Perhaps no one has done that exact thing. Do you have a specific problem you're trying to solve?

cold lagoon
#

Hi im trying to get a clean RGB Fade animation. I've come up with this:
https://pastebin.com/tfnQYDMN
but it seems to skip a for loop every now and then (could be that my circuit is trash but i don't hope so since those are PCB's i've ordered).
Is there a cleaner way of writing this out?

#

btw. the hardware works fine with an RGB Blink code.

north stream
cold lagoon
#

thats smart it would get some of those for loops out. ill try that tomorrow.

umbral zinc
#

can someone help with PID speed controller? I am using potentiometer to put the target speed. But when brakes are on motor is not going back to target speed( like 600rpm difference). I am confused in finding right parameters.... I looked to Latzel method but cant get the parameters from it . https://pastebin.com/dF0AdmAY

cerulean knoll
#

it sounds like perhaps some integral gain would assist that?

#

not sure what the optimal tuning parameters would be, but an integral component will usually help eliminate average steady state error

#

it also might help to print some diagnostic information over the serial connection

#

not sure if that would slow down your loop too much though...

umbral zinc
#

We have the software to plot the rpm with sensor

#

during the brake it doesnt gain speed , it should give more output power

cerulean knoll
#

I guess what I'm curious to know is, does your controller think there's error under those conditions?

#

one possible cause would just be that something is a bit off in calculations, and the controller thinks that's the right speed

umbral zinc
#

yeah I am confused with the ratio of parameters , cant find right method to calculate

cerulean knoll
#

uh I remember doing zeigler nichols tuning in the past. It's been a long time. Sometimes it's just a matter of experimentation

umbral zinc
#

I wanted to try it , setting Kp at max to oscillate

cerulean knoll
#

basically start by setting Ki and Kd to zero

#

yeah, did that work?

umbral zinc
#

I am not sure , I didnt see any continuos oscillations

cerulean knoll
#

even at maximum gain?

umbral zinc
#

yeah , maybe the plotting software isnt right

cerulean knoll
#

and just to be sure this is with Ki and Kd at 0?

umbral zinc
#

I will try to connect 2 potentiometer for Kp and Ki to tune

cerulean knoll
#

are you able to share pics of the RPM plot?

cerulean knoll
umbral zinc
#

I will repeat tomorrow

cerulean knoll
#

maybe you might want to add a reset button for the integral gain or something too

#

since tuning the integral gain won't (automatically) reset the integral sum to 0

#

I'd be interested to see plots without the brakes applied

#

oh hey, I would also recommend just setting Kd to zero for now

umbral zinc
#

yeah I am doing PI controller first

cerulean knoll
#

I am not a PID expert, but I think it might make sense to just do PI first

#

ah yeah

#

I just noticed there's Kd = 2 in your code, but maybe it's an old copy 🙂

umbral zinc
#

yeah my previous tries , was playing around with parameters

cerulean knoll
#

I've been working on the temperature control for my espresso machine

umbral zinc
#

about the integral, so i am summing the errors for that. Never thought about reseting it. Should I ?

cerulean knoll
#

well, it might be helpful if you want to see how the changes to parameters affect steady state behavior

#

let you get rid of any accumulated overshoot

#

When I was tuning this espresso machine, I started by adjusting for steady state error and not considering disturbance/startup transient

#

as you can see, the integral component causes substantial overshoot. But it does come back down fairly quickly

#

I thought this video was helpful: https://www.youtube.com/watch?v=uXnDwojRb1g

For more information, see http://nu32.org. This video is a supplement to the book "Embedded Computing and Mechatronics with the PIC32 Microcontroller," Lynch, Marchuk, and Elwin. It is part of Northwestern University's ME 333 Introduction to Mechatronics.

L-comp: Explain why you have to be careful not to make the integral gain Ki too large.

▶ Play video
tranquil ledge
#

Hi! I am using a Grand Central M4 for my college actuators class and I need to control a dc motor using pin 11 for speed.
The problem is that said pin always outputs 0V when analogWrite is used but when digitalWrite is used it outputs the reference voltage even tho it says that pin 11 can be used for pwm in the documentation. Does anyone by any chance know why is this? Please

north stream
tranquil ledge
north stream
#

Are you using analog pin 11 or digital pin 11?

tranquil ledge
#

digital pin 11, but that should be a problem since in the documentation says that this pin can handle PWM, and as far as I know that is needed for using analogWrite

north stream
#

150 is going to be pretty low, I think the PWM range on the M4 is something like 0-19999

tranquil ledge
#

hmm I dont know because I have also tested the same in other digital pins that support PWM and with 255 they reach the maximum, which is 3.3V :/

#

oh

#

nevermind, I tested it with 19999 and it works

#

so if my code is based in a maximum of 255 to get the same results with the range of 19999 I should map it, right?

north stream
#

You can do that, or change the range register (I'll admit I don't know the details of how to do so, but I seem to recall that it's doable)

umbral zinc
#

I put Ki to 1000 and Kp to 15 today . Also , Ki / Integral sum for the PI. Set the motor speed to max at the start because it didnt want to start itself. Also added 200 to the power , I think it might be negative sometimes . @cerulean knoll

tough pewter
#

helloo

#

im using the arduino ide to upload ros serial to an adafruit esp32 s2 feather board

#

everytime i upload the board performs a factory reset and deletes everything including circuit python

#

im starting to think its not ready to accept ros serial ?

north stream
tough pewter
#

no its a library that allows the MCU to become a standalone ROS node that can publish and subscribe

#

the thing is, everything works well until i add the ROS serial components, then the board factory resets

tough pewter
#

the function nh.initNode() specifically causes the reset

north stream
#

I'm not familiar with that particular code base, but this page seems to say that you need to add a #define to match the hardware you're running it on, and I don't see an entry for ESP32. http://wiki.ros.org/rosserial_arduino

tough pewter
#

i tried it with another esp and it worked

#

esp 32 wroon dev kit 1

north stream
#

Ah, that's a useful data point. I wonder if the S2 is different enough that it would need a code modification to work.

tough pewter
#

i think i should ask the ros community too

north stream
#

Good idea

astral sail
#

hi, i'm trying to write arduino to control a flora rgb neopixel attached to a flora board, but all of the code snippets I am finding are for different boards or written to control a different kind of led. this is my first try and I'm learning arduino from scratch coming from a python background, so I'm struggling without anything I can use to clearly imitate and then interpret.

Can anyone point me at a solid git or some more specific tutorial than the ones I found in the uberguide?

leaden walrus
wind drift
#

I am trying to use this code https://github.com/labatrockwell/arduino_capactive_sensor_MPR121 for the MPR121 sensor.

It does seem to work fine - when I touch the pins it shows P:1 - when not touching P:0

In the description though it says it can work as a proximity sensor. But for me it only triggers when I am really touching the pins

GitHub

Arduino sketch that activates all touch sensors, and the proximity sensor on the MPR121 breakout board from Sparkfun. - GitHub - labatrockwell/arduino_capactive_sensor_MPR121: Arduino sketch that a...

north stream
wind drift
#

meaning all of them are connected to the same surface, correct?

north stream
#

I don't think so, I think they just need to be connected to something, I'm guessing proximity is a group effect. Connecting them all to the same surface would probably both confuse them as well as keeping them from detecting touches from different surfaces.

wind drift
#

I have it connected like here at the moment

#

so I would have to connect each pad to a separate surface and when I hover my hand over them it should trigger?

north stream
#

If I understand it correctly, that should do it.

livid osprey
#

There is probably a bit of playing with the sensitivity thresholds for it to work properly, though.

wind drift
#

By the way - where in the code does it define the A4 and A5 pins?

#

I only see the irqpin = 2

#

I am trying to wire it up to an arduino pro micro

north stream
#

I'll admit I haven't even looked at the code but A4 and A5 are the I2C interface pins, and since I see them hooked to the SCL and SDA pins in the picture, I'm guessing they're used that way.

wind drift
#

Somehow didn't get it to work with the SCL SDA pins on the pro micro. Used the Arduino Uno instead for now

#

I wired up some wires to each pad now but still no proximity sensing for some reason

#

only when I touch the cable directly it triggers

north stream
#

Both of those are frustrating. Is there a way to adjust sensitivity like Hem suggested?

wind drift
#

hm I set these to 2 and 1 now

#

seems to trigger now a bit better

#

but only 1 mm or so

hallow needle
#

I'm attempting to use my Trinket M0 to control an Adfruit 128x32 I2C OLED display. I'm following the instructions here: https://learn.adafruit.com/monochrome-oled-breakouts/wiring-128x32-i2c-display

When I try to up load the example sketch (after installing the Adafruit_SSD1306 and Adafruit_GFX libraries) I get some errors while compiling.

I've pared down the sketch as far as possible to determine where the error is happening, and eventually have determined it is happening in the initial #include statements.

My current sketch is:

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>

void setup() {
}

void loop() {
}

When I attempt to compile this I get the following error:

In file included from /Users/rhammell/Documents/Arduino/libraries/Adafruit_GFX_Library/Adafruit_GFX.h:12,
                 from /private/var/folders/c3/64d1jpps1plfg4gh6p9j9ys00000gn/T/.arduinoIDE-unsaved20221017-13738-1812fiw.ss6e/sketch_nov17b/sketch_nov17b.ino:3:
/Users/rhammell/Documents/Arduino/libraries/Adafruit_BusIO/Adafruit_I2CDevice.h:10:56: error: 'Wire' was not declared in this scope; did you mean 'TwoWire'?
   10 |   Adafruit_I2CDevice(uint8_t addr, TwoWire *theWire = &Wire);
      |                                                        ^~~~
      |                                                        TwoWire

Adafruit Learning System

Using our small mono-OLED displays

leaden walrus
#

what board are you selecting in the Arduino IDE?

hallow needle
#

Adafruit Trink M0. Hmmm... seems to be workign now without the verification errors. I attempted reinstalling the Adafruit_GFX library and restarting the IDE. That may have been the fix? I'll keep dabbling...

blazing crane
#

I've tried a number of different ways to send this post request... here's what I've currently gotten:

#
    client.print("POST /");
    client.print(WRITE_PAGE);
    client.println(" HTTP/1.1");
    client.print("Id: ");
    client.println(id);
    client.print("state: ");
    client.println((char) color);
    client.print("Host: ");
    client.println(server);
    client.println();```
#

I've also tried:
without the "Host" lines
with "Connection: keep-alive"
Adding the fields to the end of the URI w/ "?Id=...&state=..."
Various combinations of print and println

#

Using GET instead of POST but still sending the fields with it

#

(This is WiFiNINA btw, and I have access to the server and have been monitoring the requests with Wireshark)

blazing crane
#

fixed it

cold lagoon
#

Can i connect something the pins 0 and 1 on an arduino leonardo, without worrying that i cant upload code anymore (cause its the RX and TX pins). I think i had some trouble view years ago when i connected something to an arduino uno's RX/TX pins.
I just need to connect an button with an 10k pullup resistor so nothing that would interfear wit data transfer (i think)

north stream
cold lagoon
#

worked fine

wide shadow
#

I've tried pin D6 and D13; neither of them want to work there.

north stream
wide shadow
#

I've adjusted the source code to handle it, and moved it to D13 physically, but not sure what else I'm missing.

north stream
#

Did you cut the CS jumper?

wide shadow
#

not sure where that is. For the LCD, right?

north stream
wide shadow
#

Oh. So move the ethernet CS vs the TFT CS 😦

north stream
#

Either should work. The TFT is a breakout board so you have to wire up the CS pin anyway, so that might be the easier one to change (the board supports a few different functions, so there are multiple CS pins to deal with)

wide shadow
#

Yeah, moving the TFT CS is what I would prefer.

wide shadow
#

What's the easiest way to show all of the #defines?

pine bramble
#

@wide shadow what operating system?

wide shadow
#

Ubuntu Linux 22.04

pine bramble
#
 $ egrep -R \#define

that's recursive though

wide shadow
#

Ok, maybe I should have specified compile time #defines.

pine bramble
#

All that's doing is showing only the lines that have #define in them.

#
 $ egrep -R \#define | cat -n | less
#

I use 'ag' now so I don't use that syntax - can't remember the easy way to show a more limited case.

wide shadow
#

I'm planning on making this project capable of being used by 3 different boards: Arduino Mega 2560, Adafruit Feather M0 WiFi, and Adafruit Feather M4 Express.

#

Trying to get the #defines related to this and it is being difficult.

#

Something like ```
#if defined(AVR_ATmega2560)
const String] curBoard = "Arduino MEGA 2560";
#elseif defined(ADAFRUIT_FEATHER_M0) || defined(ARDUINO_SAMD_ZERO)
const String curBoard = "Adafruit Feather M0";
#elseif defined(ADAFRUIT_FEATHER_M4_EXPRESS)
const String curBoard = "Adafruit Feather M4";
#else
const String curBoard = "Unknown board";
#endif

#

When I select the Feather M0, it comes up as Unknown Board.

pine bramble
#
 $  egrep -R "\#define|\#ifdef|\#endif|\#ifndef|\#undef" * | cat -n | less
#

There's I think an -a <number> and a -b <number> switch for egrep

wide shadow
#

If I can find out what the "proper" #defined tags are for the appropriate boards, then I'd be set. I did examine the different boards.txt files, but haven't found what I need yet.

pine bramble
#

so those defines are not in your source code they are in the board support package iirc.

#

boards.txt is one place to look, sure.

wide shadow
#

Right, which is why I'd like to have a list of the #defines that happen at compile time so I can pick and choose from that.

pine bramble
#

I tried to use it to compile differently for different SAMD21 and SAMD51 targets.

pine bramble
#

you can use a '#warning my warning text' in your own source to tell you exactly when that code got parsed. I use that to make sure I don't see the same warning twice. ;)

wide shadow
#

I've been trying. So far all of my google searches have been coming up dry with nonfunctional suggestions

#

YAY! That can help too, #warning.

pine bramble
#

You can even put them in 'factory' distributed libraries to tell you when they are included. ;)
I use the '#warning mywarning' construct because I don't want to look things up or ask questions. ;) haha

#

Pretty much an empirical approach, using the compiler itself as the feedback.

wide shadow
#

I was wondering about that. Didn't think there was something like #printf.

pine bramble
#

There may be another mechanism but my memory is weak on it. I know too many languages too thinly so they all get mixed up in what I remember. ;)

wide shadow
#

I've learned a lot of langs too, so I kind of know what you mean.

pine bramble
#

You can also deliberately misspell a word to get the compiler to halt and throw an error, to differentiate the code you thought you were compiling .. from the code that you are .. compiling.
That's a very quick way to check if you are on the copy of the copy of the copy or what. ;)

wide shadow
#

I've done that earlier today.

pine bramble
#

fwiw I'm finding wokwi.com helpful for rapid iteration of testing code changes, when it's working for me (when wokwi supports what I'm testing).
My hardware is super slow and outdated, so tests can take a while to compile.

wide shadow
#

I remember having to edit Makefiles to dump out the build environment to look through all of the different #defines in the past. Looks like with Arduino. that is tougher.

pine bramble
#

Well there's platformio which gives more of a familiar experience to users of Makefiles.

#

The Arduino IDE is more for beginners, in some regards. I mostly use it to follow along in the very same context, when helping someone else.

wide shadow
#

I do have code installed. Just haven't used it instead of the Arduino IDE

pine bramble
#

That might be a pro dev environment (I stick to stuff Debian will distribute for the most part. ;)
Should probably help you if this is going to be a career.

wide shadow
#

hobbyist

pine bramble
#

The other strong appeal of the Arduino IDE based system is all the libraries. Most vendors like Adafruit write a decent Arduino IDE compatible library for their hardware boards (breakouts).

wide shadow
#

Yeah, I'm going to give code a go and see if it can get all of the libs.

#

and I use a TON of Adafruit libs.

pine bramble
#

;)

#

I buy adafruit parts a lot because I understand how to find where they are documented. You get a lib and example code and a schematic. ;) And relevant datasheets are linked too.

wide shadow
#

And I'm almost all of the way done with building my own Thermostat that can be controlled over the LAN

pine bramble
#

I use a TMP36 based project to keep an eye on the window air conditioner's cycle state (compressor on or off). And I keep a 24 minute history (3 minutes per RGB x 8 RGB's).

#

red hot .. blue cold .. green transitioning

wide shadow
#

I also want to integrate this thermostat into home Assistant. I've been told MQTT is the way to go.

pine bramble
#

You sound like you can learn this. ;)

wide shadow
#

And I'm using similar colors in my Thermostat for the temp value. Thermostat is stuck at 2 digits for the temps, so >99 degrees = red, < -99 = blue, etc.

pine bramble
#

all I'm trying to do is answer one question: how many minutes is each half cycle active for? I walk into the room, and if I see all blue, I reset it and go away for 45 minutes. ;) If I see red and blue alternating (usually in groups of 2 or 3) I know it's almost time to shut it down for a few hours, or for the rest of the evening.

#

If I see too many greens I check the lousy wiring job I did for intermittents. ;)

wide shadow
#

Sounds like if you set up something like MQTT with home assistant, you'd be able to get alerts without being physically present.

pine bramble
#

I had it talking to If this then that but it kept failing me. this air conditioner has built in wifi whatchamacallit. I had it working great, then on its own it stopped. I don't like doing the same job twice because someone's vended tech failed.

wide shadow
#

This is partly why I want to make my own thermostat: I control the code behind it.

#

Have you set up PlatformIO before?

pine bramble
#

Yeah I use platformio a lot. The install may be non-trivial but reuse of existing code is easy.
Never once touched their GUI .. I use the command line (it's python driven iirc).

wide shadow
#

Ok, so I have Code opened up and have the .Ino file opened in it. How do I activate it?

pine bramble
#

I haven't worked in that environment.

#

Control R recompiles in the Arduino IDE.
Control U uploads the firmware you compiled to the target. In the Arduino IDE.

#

The usual linux/unix term is probably 'keybindings' for a quick search of what you can do with the keyboard (rather than the mouse).

wide shadow
#

Then in what environ have you used PlatformIO?

pine bramble
#

I just cd in a regular xterm and run platformio commands.

 $ source .profile__platformio
 $ cd there
 $ pio run -t upload
#
 $ cat ~/.profile__platformio 
PATH="$HOME/.platformio/penv/bin:$PATH"
#
 $ cd .platformio/penv/bin/
 $ file pio
pio: Python script, ASCII text executable
quartz furnace
#

Have an interesting question about a FeatherWing for Ethernet

#

I had gotten this board years ago

#

It asks for a MAC address…. No idea what I did with that information if it was documented for me

#

I got it working with a MAC address from another board I knew the address on…. Will it matter a great deal if I just make up one ? Like change the last number -/+ a few digits ?

#

Of note : I pigged it in my router to see if it would show the Max address in the details …. But it will just show up with what ever number I put in my Arduino code …… thoughts on any other way to get the details of the actual MAC address?

safe shell
#

@quartz furnace I don't believe these boards have an embedded MAC address, you can make one up

quartz furnace
#

I’ll keep it all the same except for the very last part .. I know the beginning has like the vendor ID .. etc … I’d guess that would help avoid a problem down the road… but I know it’s many trillions in possibilities for a matching address

safe shell
#

Yeah odds are you'd never collide. If you want to guarantee you don't overlap the vendor space, you could set the lower nibble of the highest byte to 2, 6, A, or E to make it a local MAC.

north stream
# quartz furnace I’ll keep it all the same except for the very last part .. I know the beginning...

For most cases that's true, and since you can change it if you need to, it's not something to worry about. However, in big data centers, MAC address collisions are more common than it might seem. For one thing they have thousands of units from the same manufacturer (Juniper, Cisco, whatever) on the same network, and it's an instance of the "birthday paradox" where having any MAC match any other increases the probability dramatically.