#help-with-arduino

1 messages · Page 15 of 1

north stream
#

However, if you're asking a different question, like you want them to fade independently, you could have some LEDs connected to voltage and some to ground, so some would dim while the others brighten.

flat relic
north stream
flat relic
#

if (!dsp.begin_I2C(&Wire1) and need to include the #include Wire.h
Wire.begin(); // Initial I2C-Bus (Wire)
Wire1.begin(); // Initial I2C-Bus (Wire1)
correct ?

north stream
#

I'm not clear on the details. I think it would be dsp.begin_I2C(0x77, &Wire1) (since the I2C object is the second argument, you would have to also supply the address)

#

I don't think you'd need to call the Wire .begin() methods explicitly, but I really don't know

leaden walrus
#

yep. need to supply the address, since there's no overload of begin with just the wire bus. also no need to call Wire.begin() - the driver does that.

tender wasp
#

bah, I think my generic ADS1115 16-bit ADC is a fake. with the Adafruit sample code (modified to init as 1115, not 1015), supplying a constant 3.3V signal on a 4V scale, the jitter bounces up/down by 16, which would match 12-bit resolution (2^12 = 4096, 65536/4096 = 16). another channel gives me nearly full-scale oscillations feeding 3.3V thru a force sensing resistor with no force applied. wild.

north stream
#

Ouch. That's pretty rough.

tender wasp
#

I bought it because it was purple and had a nice board shape with good mounting holes, and not because I had a shovel-ready project that needed good components. welp

north stream
#

Makes sense to me, I've bought stuff for similar reasons

flat relic
#

It works now ... many thanks for help

magic idol
#

hey there

#

was just wondering

#

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
E (271) esp_core_dump_f��͡� Core dump data check failed:
Calculated checksum='ab018db8'
Image checksum='ffffffff'

got this error on my ESP32-CAM, i fixed this error on my esp32 wroom, the problem was i picked a different board setting on the arduino IDE, but now with this board, i tried setting it to AI Thinking ESP32-CAM but it still has the core dump error

#

sorry if its long or anything

#

oh and heres the code for the reciever ( ESP32-CAM )

#
// REPLACE WITH YOUR RECEIVER MAC Address
uint8_t receiverMacAddress[] = {0x08, 0xF9, 0xE0, 0xD3, 0xD6, 0xE4};  //AC:67:B2:36:7F:28

struct PacketData
{
  byte potValue;
};
PacketData data;

// Map and adjust the potentiometer deadband value
byte mapAndAdjustPotentiometerValue(int value)
{
  const int deadbandMin = 1800; // Minimum deadband threshold
  const int deadbandMax = 2200; // Maximum deadband threshold
  const byte minValue = 0; // Minimum value
  const byte maxValue = 255; // Maximum value
  
  if (value >= deadbandMax)
  {
    return map(value, deadbandMax, 4095, maxValue, minValue);
  }
  else if (value <= deadbandMin)
  {
    return map(value, 0, deadbandMin, minValue, maxValue);  
  }
  else
  {
    return maxValue / 2; // Center value
  }
}

// Callback function when data is sent
void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status)
{
  Serial.print("\r\nLast Packet Send Status:\t ");
  Serial.println(status);
  Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Message sent" : "Message failed");
}

void setup() 
{
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);

  // Initialize ESP-NOW
  if (esp_now_init() != ESP_OK) 
  {
    Serial.println("Error initializing ESP-NOW");
    return;
  }
  else
  {
    Serial.println("Success: Initialized ESP-NOW");
  }

  esp_now_register_send_cb(OnDataSent);
  
  // Register peer
  esp_now_peer_info_t peerInfo;
  memcpy(peerInfo.peer_addr, receiverMacAddress, 6);
  peerInfo.channel = 0;  
  peerInfo.encrypt = false;
  
  // Add peer        
  if (esp_now_add_peer(&peerInfo) != ESP_OK)
  {
    Serial.println("Failed to add peer");
    return;
  }
  else
  {
    Serial.println("Success: Added peer");
  } 

  pinMode(32, INPUT); // Potentiometer pin  
}
#

oh and i took void loop() off here cause the message is too long lmo

tardy hull
#

Hey I have a metro mini and a LCD with a GC9A01 driver.
I tried following a tutorial but it was a bit chaotic to say the least. Is there a recommended tutorial for setting it up? Or even a suggested library to use with some documentation I could check out?

If not I'll circle back after I create a little schematic of what I've tried with a more specific question

native dagger
#

https://github.com/laurb9/StepperDriver/blob/master/src/BasicStepperDriver.h

I am looking at this library, and I'm wondering about line 40:


   static inline void delayMicros(unsigned long delay_us, unsigned long start_us = 0){
        if (delay_us){
            if (!start_us){
                start_us = micros();
            }
            if (delay_us > MIN_YIELD_MICROS){
                yield();
            }
            // See https://www.gammon.com.au/millis
            while (micros() - start_us < delay_us);
        }
    }

What is the point of yield here? I feel like a return would work just as well given that dysfunction is blocking or am I misunderstanding

GitHub

Arduino library for A4988, DRV8825, DRV8834, DRV8880 and generic two-pin (DIR/STEP) stepper motor drivers - laurb9/StepperDriver

inland gorge
# native dagger https://github.com/laurb9/StepperDriver/blob/master/src/BasicStepperDriver.h I ...

In Arduino, yield() is not an “async return” thing like it is in other languages. Instead, it’s a way to hand back control momentarily to Arduino core functions (USB usually). Normally yield() is effectively called between calls to loop() to process things like USB or Serial. I suspect it’s here to give the Arduino core one last chance to deal with stuff before that function goes into the tight loop on line 49

native dagger
#

Here's what I get

#

I'm using a copy paste of the author's code and my doxyfile, as far as I can tell, does match theirs

#

sorted it. Had a stray = sign

green osprey
#

hi! i'm very new to this. i have an older Bluefruit circuitplayground, and i'm trying to use the Arduino IDE to put code on it. i messed something up, and now nothing works, and i get the error Error: unable to find a matching CMSIS-DAP device when i try to debug in the Arduino console. i updated the boot loader, but that seems to have made things worse.

is there any hope of recovering my device?
(i'm running the ide on windows 11)

currently it has a bootloader info with UF2 Bootloader 0.8.0 lib/nrfx but it used to be 0.2 when it was working

north stream
#

I think if you press reset twice to put it in bootloader mode, the Arduino IDE can talk to it

final geyser
#

I suddenly am unable to upload even simple sketches. keeps saying "problem uploading to board" and "programmer is not responding" I have tried three different boards and different cords, different ports, and two different computers and even the simple blink file will not upload. I have been using arduino for like 6 years and have no idea what is wrong

stable forge
#

it's possible you have more than one data-only or bad USB cable. I did have one user who had two cables and both were power-only.

final geyser
# stable forge which boards?

Thanks for helping! Uno r3 and sparkfun red board. One of the cords was the one stored with the uno board from an Arduino kit at my university so I really don’t think it was the cable. Also it was working 2 weeks ago with the same cable

north stream
#

Also check that "programmer" is set correctly, so it's using the right protocol for the one you're trying to talk to.

green osprey
#

Is it possible that by upgrading the bootloader I messed up the board?

stable forge
#

if you double-click, does a BOOT drive show up, an does the red LED pulse slowly?

green osprey
stable forge
#

I mean double-click on the reset button. Is there a ...BOOT drive visible in the finder?

#

sounds like yes

#

and does BOOT_INFO.TXT say it's version 0.something (which version), and is the board name correct?

green osprey
#

It's 0.8xxx

The board name is not what it was when I bought it. Originally it's name was "Bluefruit Circuit playground" or something,

now it's "CPLY_..." , I don't have it open in front of me , but the name is different

#

It used to be 0.2xxxx

stable forge
#

i mean the name as given in BOOT_INFO.TXT

green osprey
#

By the way, thank you for responding @stable forge

green osprey
stable forge
#

also, are you using a USB hub or anything? After the clean-out try a different port or plugging in directly. Which version of Arduino IDE are you using?

green osprey
#

I believe it's the newest version of Arduino ide

stable forge
#

i'll try this on windows with a CPB

stable forge
green osprey
#

when i hit the debug button it gives me this

stable forge
# green osprey

So you are successfully uploading too, just not debugging. Did debugging used to work for you?

#

it doesn't work for me either, and I don't expect it to, without connecting up a debug probe

green osprey
green osprey
stable forge
#

upload your Arduino sketch here, using the + to the left (don't paste a screenshot; it's hard to read and we can't copy/paste from it)

green osprey
#

it's the pre made blinky .ino script

  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO 
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN takes care 
  of use the correct LED pin whatever is the board used.
  If you want to know what pin the on-board LED is conn
  ected to on your Arduino model, check
  the Technical Specs of your board  at https://www.arduino.cc/en/Main/Products
  
  This example code is in the public domain.

  modified 8 May 2014
  by Scott Fitzgerald
  
  modified 2 Sep 2016
  by Arturo Guadalupi
*/

#include <Arduino.h>
#include <Adafruit_TinyUSB.h> // for Serial


// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}
     
// the loop function runs over and over again forever
void loop() {
  digitalToggle(LED_BUILTIN); // turn the LED on (HIGH is the voltage level)
  delay(1000);                // wait for a second
}
#

i assumed it was made to work with the CPB, but maybe it isn't?

stable forge
#

double-click the reset button so that all the neopixels come on, and press the upload button again. The red LED next to the USB jack should blink

green osprey
stable forge
#

maybe it was not really uploaded due to the previous problems, or got overwritten temporarily

green osprey
stable forge
#

any lingering issues? Feel free to post later about something

green osprey
stable forge
manic scaffold
#

i am using the adafruit PN532 Module breakout board and it says this 13:24:23.006 -> Waiting for an ISO14443A Card ...
13:24:24.427 -> Hello!
13:24:24.462 -> Found chip PN532
13:24:24.462 -> Firmware ver. 1.6
13:24:24.462 -> Waiting for an ISO14443A Card ...
13:26:19.228 -> Hello!
13:26:19.228 -> find PN53x boardHello!
13:26:20.703 -> Found chip PN532
13:26:20.703 -> Firmware ver. 1.6
13:26:20.703 -> Waiting for an ISO14443A Card ...

but isnt detecting a card and it worked once and I didnt change anything

lament belfry
low gate
#

Does anyone know if Adafruit (or anyone) sells a JST lipo charger with reversible/switchable polarity?

stable forge
green osprey
lament belfry
# green osprey going to try this

Is it possible the Blinky script needs an adafruit dependency library included. If I'm not mistaken, most non-adafruit scripts need one included. Just spit-balling here.

green osprey
prime turtle
#

Looking for advice on how to light up a single NeoPixel:
#help-with-projects message
I used various examples from the stock "Adafruit NeoPixel" and "Adafruit DMA neopixel library" and just changed the PIN to 5 and NUMPIXELS to 1

eternal cloud
safe shell
#

@prime turtle what is the power pin of the NeoPixel connected to? ...n/m, I see now it's vHI

#

you could verify the code by using the onboard NeoPixel... if that works you know it's hardware or wiring

#

oh, right, onboard is a Dotstar, sorry

stable forge
prime turtle
# eternal cloud could you please post the code you are using?

Coming directly from Examples/Adafruit NeoPixel/simple:

// Released under the GPLv3 license to match the rest of the
// Adafruit NeoPixel library

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
 #include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif

// Which pin on the Arduino is connected to the NeoPixels?
#define PIN        5 // On Trinket or Gemma, suggest changing this to 1

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 1 // Popular NeoPixel ring size

// When setting up the NeoPixel library, we tell it how many pixels,
// and which pin to use to send signals. Note that for older NeoPixel
// strips you might need to change the third parameter -- see the
// strandtest example for more information on possible values.
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

#define DELAYVAL 500 // Time (in milliseconds) to pause between pixels

void setup() {
  // These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
  // Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
  clock_prescale_set(clock_div_1);
#endif
  // END of Trinket-specific code.

  pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}

void loop() {
  pixels.clear(); // Set all pixel colors to 'off'

  // The first NeoPixel in a strand is #0, second is 1, all the way up
  // to the count of pixels minus one.
  for(int i=0; i<NUMPIXELS; i++) { // For each pixel...

    // pixels.Color() takes RGB values, from 0,0,0 up to 255,255,255
    // Here we're using a moderately bright green color:
    pixels.setPixelColor(i, pixels.Color(0, 150, 0));

    pixels.show();   // Send the updated pixel colors to the hardware.

    delay(DELAYVAL); // Pause before next pass through loop
  }
}
tardy iron
#

are there two pads each for power and ground on the LED board? make sure the Dout pin isn’t shorted to +

stable forge
# prime turtle

It looks to me like ground on the NeoPixel button is connected to A0 instead of to G (ground)

leaden walrus
#

that's just parallax, and the itsy is offset by one row

#

i'd suspect something with soldering on the button

prime turtle
tardy iron
prime turtle
prime turtle
leaden walrus
#

are you using solder without flux?

prime turtle
leaden walrus
#

common solder wire spool typically have flux (rosin core), but not all

tardy iron
leaden walrus
#

soldering to pads like that is a bit more difficult than header pins. getting both pad and wire heated well can be tricky.

#

it looks a bit cold soldered, and also the quantity of solder is a bit on the heavy side. but OK as shown, just don't try and fix it by adding more solder.

#

do you have more neopixel buttons?

prime turtle
leaden walrus
#

can just try again, and only solder the 3 main wires

#

can leave the others alone

#

get it working with just a single pixel as a sanity check of the general setup

tardy iron
#

a problem i’ve seen with rosin-core solder is the last few mm or more of the solder wire is fused together and no longer has flux in it, due to previous soldering operations. you can break off the tip to expose more flux

cold lagoon
#

Hey. I'm trying to incorporate a VCNL4040 sensor in to my code but for some reason the proximity reading is always 0 or 1 (1 if i shine a flashlight at it) the Ambient- and raw Light readings work fine. Im just using the example code of the adafruit VCNL4040 library

leaden walrus
cold lagoon
leaden walrus
cold lagoon
#

yes they change as expected

leaden walrus
#

weird. can you post a photo of the setup.

cold lagoon
#

It's complicated... 😄

#

Schematic coming up

leaden walrus
#

oh, a custom build

cold lagoon
#

i think i see the problem 🙂

leaden walrus
#

try using your phone camera to see if the xmitter light is on

#

anode not connected?

#

could bodge that as a quick fix

cold lagoon
#

yes that was it

leaden walrus
#

short 4 and 3

cold lagoon
#

what was i thinking when designing the board??? Anode? naaah that's overrated

leaden walrus
#

there's already two cathodes. should be enough 🙂

cold lagoon
#

well thanks

heavy apex
ionic crag
#

Hi

Would it be possible to use this exact keypad kit and screen with arduino? I had it soldered for raspberry pi and was wondering if there are ways to make it work with arduino as the guide on website is for raspberry pi and programed in python.

odd fjord
eternal cloud
ionic crag
eternal cloud
# ionic crag You are life saver, thanks for replying and the links C:

There seems to be an Arduino shield too https://www.adafruit.com/product/714 using the same chip and LCD + buttons configuration, so you can probably use that library directly ? Just check for the correct I2C pins. https://learn.adafruit.com/rgb-lcd-shield/using-the-rgb-lcd-shield

Adafruit Learning System

Control a 16x2 Character LCD using 2 pins

ionic crag
#

Good tip, will test that as well, thanks :)

atomic remnant
#

Hello! I'm using a TFT display from Adafruit (https://www.adafruit.com/product/3315) with ESP32 feather (https://www.adafruit.com/product/5400) and testing the display. I'm trying to read analog sensor data and show the sensor graphs on my display and be able to use the touch screen properly to stop showing data and then resume. I first tested the features of the display using example codes provided by the Adafruit libraries (all code complies) for graphing data using Adafruit ILI9341 the example codes complied but didn't show any graphs (The screen stayed white a if I didn't flash any ode to my uC) expect for graphicstest_featherwing example. I wanted to test the touch screen properly and tried the example code provided on the tutorial page for my display as well as example codes provided by Adafruit TouchScreen library but nothing worked. Again just blank white screen. Does anyone have an idea why?

heavy apex
reef osprey
#

Hey guys im making a vending machine with coin acceptor ch-926, when I ended the sampling of the coins the letter A didn't appear, the manual says that it should have appeared, instead or buzzed, now when I try to put coins it rejects them, if anyone can help please respond, or if anyone knows how to factory reset this piece of junk so that I can try again

odd fjord
reef osprey
eternal cloud
#

including

atomic remnant
# eternal cloud including

Hi! thank you for the respond. Yes I did all of that and checked the serial monitor and it's not displaying anything. checked all my soldered pins on the display and all are working (I used a DMM) EDIT: I fixed the issue. Apparently I can only use the examples that specifiy they work for feathers

marsh haven
#

Hello all,
So I am having an interesting issue and I am not sure how to go forward with debugging it. I have two VL53L0X ToF sensors from adafruit and a TCS34725 color sensor also from adafruit that I am using to create a robot for a project. For some reason, both sensors work with the example code provided in the adafruit library when tested, but when I try to use them together (in code, they are all wired up for the example code tests and work individually just fine), the readings from the VL53L0X's go to zero (dual). I am using a teensy 4.1 with teensyduino, I am not sure if this is the correct channel for this, but I have reached out on reddit and on the forums and have not gotten a solution. I have confirmed that it is indeed the sensors interacting with each other, which is odd because they are on different I2C buses on the teensy. When I have any lines in my setup() or loop() functions that call my tcs object, the readings for the VL53L0X's go to zero. All three sensors initialize just fine with no I2C conflicts, I readdress the VL53L0X's just fine. Whats especially confusing is when I look at the datasheet for the TCS34725 the hex commands to get the colors for ie. red do not match what I am seeing on my scope for what is actually being communicated to the sensor when I am getting good readings from the color sensor. (it does) I cannot seem to find the actual sensor read/write function calls or registry edits in any of the libraries from adafruit for either of the sensors so I cannot be sure how the sensors are interacting from different I2C buses, just that they somehow are. I have attached the serial output for the color sensor and my scope capture as an example.

stable forge
marsh haven
#

It gets called the same way that it does in the example code from adafruit, tcs.begin(0x29, &Wire1) (line 111) for color sensor and in the setID() function for readdressing the two ToF each one has lox1.begin(LOX1_ADDRESS, false) and lox2.begin(LOX2_ADDRESS, false) on line 69 and 79

#

here is the repo for adafruit example

stable forge
marsh haven
#

Yes they return zero. The TCS code is also adafruit code

#

on line 145 of my repo is a function entirely written by adafruit that if i uncomment it causes the VL53L0X data to return zero

#

but itll return the color readings just fine

stable forge
#

it it clear that the two VL53L0X devices are actually both in use and returning different data?

marsh haven
#

example of bad data from the sensors

#

yes they illuminate as they do when reading normally and initialize just fine

#

ill hook up my scope to check the data being communicated to them

stable forge
#

and you can cover one and get different data from it and vice vesa?

marsh haven
#

when the color sensor call is commented out, yes

stable forge
#

I want to make sure the same one is not being used twice, despite the code saying it is using two

#

never mind about the .begin(); it appears to be done in the libraries

#

I do not see anything else suspicious at the moment. Have you tried this same code on a non-Teensy 3.3V board?

marsh haven
#

output of my repository as it stands with 145 commented out

#

I have an uno sitting here i guess my next step is to try it on that

stable forge
#

the sensors don't put out 5v signals, so if you have another 3.3V board that would be less of a complication

#

suppose you use just one VL53 and the TCS, on Wire and Wire1 respectively, and don't try the I2C address code (so they are both on 0x29, but on different Wires), do you get good data?

marsh haven
#

giving that a shot, its a good idea to narrow it down, thanks

#

i only have an uno on hand besides another teensy so

#

before i switch boards im testing that out

#

I feel like I did a week or so ago but i need to be sure

stable forge
#

i would double-check the wiring, but given all the scoping, it's probably OK

#

your code seems fine, no copy/paste mistakes, etc

#

and I looked at the library code; I don't see errors there either

marsh haven
#

the two sensors are connected via the Stemma QT between them so i can just pop it off

#

similar issue, when i comment out vs uncomment out the getColor() method, except this time instead of going to zero the value it returns is forced up. Going to spend a little more time on the scope now to see exactly whats being communicated when the value is stuck like that. Here is serial output before and after uncommenting getcolor()

#

noticing a drastically different RGB value for the color sensor between the one sensor and two sensor VL53L0X implementations which is interesting

#

I didn't change the polling rate

stable forge
marsh haven
#

That was my second thought, but I have tried moving the color sensor around to wire 1 and wire 2, as well as swapping the VL53L0X's to different wires, however if it causes the issue with a single VL53L0X on any wire and the color sensor on any wire im not sure where to go from here. I guess ive gotta scope this out more, im trying to get readings from when its functioning with everything wired up but color call //out and when its gone to zero (or 9348 apparently) to see if i can isolate whats changing on each end

marsh haven
#

well while trying to hook up the probes i think i managed to blow out my color sensor so ive got to grab another from the box of them ive got tomorrow but if anyone has any more ideas im all ears

stable forge
tender wasp
#

perhaps try configuring it for a single coin first, to prove that it works and is stable across power cycles, then go back and repeat the configuration if you want more than one coin configured.

acoustic nebula
#

ding ding

lilac ginkgo
acoustic nebula
#

I generally don't hang out here

#

Some kind of animosity towards me by the owners

#

Also not thrilled that they use my libraries throughout their products, yet don't support/sponsor me.

lilac ginkgo
# acoustic nebula Also not thrilled that they use my libraries throughout their products, yet don'...

My previous message was mostly because your reply did not add a lot of value, as im not even the user who asked.... not because of the elapsed time. Ping felt useless, as in: i just tried to help back then and didnt have the knowledge to

I have no idea whether adafruit uses/recommends using your code or the user just happened to try and use it. Anyway thats none of my business either... I have never used arduino to begin with

Thanks for putting your effort on creating/maintaining an open source library, regardless 😁

acoustic nebula
#

I was indicating I'm here to answer questions

#

The user was referring to an Adafruit fork of my library that is quite out of date

lilac ginkgo
#

May be a good idea to @ them

acoustic nebula
#

I re-entered this Discord to share news of my new library release. I'm trying to be helpful to people already using it.

#

I'm not sure how much time/effort I'll contribute here because of our history

manic scaffold
#

guys i need help

#

i am using a pn532 module

#

it reads fine but it wont let me write or format like when i run the write or format code it shows nothing

stable forge
#

I do not see that anyone has added support.

#

ok, looking more closely, SAMR21 is a SAMD21 with an attached AT86RF233. So it _should" just be programmable as a SAMD21. But it's already a custom board, is that right?

#

what board are you using with the onboard SAMR21? Is it the Xplained Pro?

eternal cloud
#

Microchip Studio is an Integrated Development Environment (IDE) for developing and debugging AVR® and SAM microcontroller applications. It merges all of the great features and functionality of Atmel Studio into Microchip’s well-supported portfolio of development tools to give you a seamless and easy-to-use environment for writing, building and debugging your applications written in C/C++ or assembly code. **Microchip Studio can also import your Arduino® sketches as C++ projects to provide you with a simple transition path from makerspace to marketplace. **

You should probably just learn this, and use the existing library.

#

Are you using the Adafruit library for the sensor ?

#

Then you will need to change the library a bit by hand, and remove the references to other Adafruit code ... like #include <Adafruit_I2CDevice.h>

#

unless you want to import the whole Adafruit system of libs for it 😄

#

I mean, all of this is easier / faster than trying to port a new chip with RF to Arduino... at least I think so 😅

cobalt hedge
#

Hi guys

#

Im trying to applied this configuration

#

To my arduino nano

#

Connect

fair tusk
#

I have a adafruit sound FX board connected to a nano and I'm trying to control it with serial communication and I keep getting sound board not found in the serial monitor, I also tried it with a mega and got the same thing. what would be the cause of this?

leaden walrus
#

make sure the UG pin is grounded

fair tusk
#

I checked connuity and it is connected to gnd

leaden walrus
#

could be some other connection. can you post photo of setup.

fair tusk
leaden walrus
#

thanks

#

what's code for setting up serial look like?

fair tusk
#

its the example code menu command

fair tusk
#

yes

leaden walrus
#

is the nano in the terminal block adapter orientated correctly? the labels are swapped

fair tusk
#

it is not. oops

#

it sees the board and the menu is coming up but when I try to play a track it doesnt play, but if right after I increase the volume the track plays

#

do i need to set carriage return or new line in serial?

leaden walrus
#

the library should be taking care of any of that if needed

#

in terms of serial coms to the audio fx board

fair tusk
#

serial monitor needs to be set to New line for the menu to work

#

thank you the help

#

going to try this on my mega

fair tusk
#

so i connected the same sound board to a mega and it shows no board found

leaden walrus
#

switch to using hardware serial on the mega

#

mega has known soft serial limitations

#
Not all pins on the Mega and Mega 2560 boards support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69). Not all pins on the Leonardo and Micro boards support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
fair tusk
#

can i use software serial and just use pins listed above?

leaden walrus
#

yep

#

in theory

#

and update code

#

but mega has numerous hardware serials

fair tusk
#

does TX have any limitations?

leaden walrus
#

shouldn't. issue is with handling incoming data. outgoing is easier.

fair tusk
#

thank you i got it working on my mega using the hardware serial1

fair tusk
#

I have a hd44780 20x4 LCD display and a adafruit sound fx board control via serial and I cant get the display to work

#

I know its the code because i tested each individually

#

how does one post code in discord?

#

#include <Wire.h>
#include <hd44780.h>                       // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header

hd44780_I2Cexp lcd; // declare lcd object: auto locate & config exapander chip

const int LCD_COLS = 20;
const int LCD_ROWS = 4;

//----- adafruit sound ----------
#include "Adafruit_Soundboard.h"
#define SFX_RST 4
 Adafruit_Soundboard sfx = Adafruit_Soundboard(&Serial1, NULL, SFX_RST);

//----- defintions ----------
int sound_pins[16] = {26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41};
int sound_status[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

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

  //----- 20x4 LCD setup----------
  lcd.begin(LCD_COLS, LCD_ROWS);
  lcd.backlight();
  lcd.clear();

  //----- pin defintions setup----------
  for(int i=1 ; i>16 ; i++)
    {
      pinMode(sound_pins[i], INPUT);
    }

  //----- adafruit sound setup----------
  Serial.println("Adafruit Sound Board!");
  Serial1.begin(9600);
  if (!sfx.reset()) 
  {
    Serial.println("Not found");
    while (1);
  }
  Serial.println("SFX board found");

  lcd.setCursor(0, 0);
  lcd.print("Hello, world!");
  lcd.setCursor(0, 1);
  lcd.print("ABCDEFGHIJKLMNOPQRST"); 

  lcd.setCursor(0, 2);
  lcd.print("12345678901234567890"); 

  lcd.setCursor(0, 3);
  lcd.print("0 1 2 3 4 5 6 7 8 9"); 
  delay(5000);
  lcd.clear();
}

void loop() 
{
  //sound_check();
  //LCD_display();
  LCD_test(); 
}

void sound_check()
{
  for(int i=1 ; i>16 ; i++)
    {
      if(digitalRead(sound_pins[i])==HIGH)
        {
          if(sound_status[i]=LOW){sfx.playTrack(i);}
          sound_status[i]=HIGH;
        }
    }
}

void LCD_display()
{
  lcd.setCursor(0, 0);
  lcd.print("Sounds");

  lcd.setCursor(0, 1);
  for(int i=1 ; i>16 ; i++)
    {
      lcd.print(sound_status[i]); 
    }
  lcd.setCursor(0, 2);
  lcd.print("Sound status = ");
  lcd.print("STATUS");  
  
}```
fair tusk
#

is this okay to post code?

odd fjord
fair tusk
#

I also tried using a 16x4 LCD with I2C and it doesnt work with the sound board fx code

eternal cloud
odd fjord
#

It would be helpful to elaborate on "it does not work" -- error messages?

fair tusk
#

sorry I have all this hooked to a mega

#

i have a mega with a sound board connected and i got it to work with them menu demo code

eternal cloud
#

So, it works with the LCD connected to the mega separately? And with sound fx over serial separately?

#

but not when both are connected ?

fair tusk
#

yeah they work seperately

#

yes combined they dont work. I dont know if either work because i dont know what the sound board is doing because the screen was gonna tell me

eternal cloud
fair tusk
#

okay i changed Serial1.begin(115200);

#

LCD still doesnt work

maiden kite
#

Hello everyone, I bought a new esp32 feather tft. I am currently looking at this adafruit site to help me explore the functionalities https://learn.adafruit.com/adafruit-esp32-s2-tft-feather/built-in-tft.

I am programming in Arduino IDE. I downloaded a library with all it's dependencies to try out the TFT display for example. But each time I get an error.

 #include <Adafruit_GFX.h>    // Core graphics library
          ^~~~~~~~~~~~~~~~```

Even though all the libraries with their dependencies are installed from the library manager from the IDE itself. 
What should I do?
eternal cloud
maiden kite
eternal cloud
# maiden kite Yes:

And Adafruit_BusIO ? Just to make sure all dependencies installed correctly

smoky crest
#

Does nRF52840 support NRF24L01 out of the box or do I need to add a custom module?
I'm basically looking for a MCU that supports NRF24L01 and bluetooth out of the box, and ideally, a way for me to (re)charge it using a lithium battery.
It's proving very hard to find all these features on a MCU.

Not sure where I should be posting this message, sorry if it is the wrong place.

eternal cloud
# smoky crest Does nRF52840 support NRF24L01 out of the box or do I need to add a custom modul...

Why do you want to use the NRF24L, if you have the NRF528? The 24L is a legacy chip, not recommended for new designs.
From the Nordic page:

The ESB protocol was embedded in hardware in the legacy nRF24L Series. The Enhanced ShockBurst module enables an nRF5 Series device to communicate with an nRF5 or nRF24L Series device using the ESB protocol.

Probably a question better suited for https://discord.com/channels/327254708534116352/656770973852237844 though

smoky crest
# eternal cloud Why do you want to use the NRF24L, if you have the NRF528? The 24L is a legacy ...

Basically, I want to buy a microcontroller that has bluetooth and 2.4 GHz (not WiFi) to power a keyboard. I want to make my own keyboard that has support for bluetooth and, I guess, more importantly 2.4 GHz.
I purchased the nRF52840 recently but I returned it because I could not find a way to scan on the 2.4 GHz.
I can purchase the nRF52840 again if you are certain that it will provide a way for me to communicate with 2.4 GHz receiver. To be honest, I found the SDK documentation wasn't as good as that of the ESP32.

eternal cloud
#

@smoky crest I'm not sure that nRF52840 does support the protocol for the kind of communication you need 🤔
It does have BLE though, so you could get something like this https://www.adafruit.com/product/4062 (this board comes with battery charging circuitry) and connect a NRF24L01 module over SPI.
There is Arduino library support.

smoky crest
#

I suspect I need something like https://www.adafruit.com/product/5199 but again I am not sure.

Instead, this is basically a minimal nRF52840 wireless microcontroller dev board on a stick. You can program it in Arduino or CircuitPython and it's completely standalone. This could be useful for some situations where you want to have a standalone BLE device that communicates with a USB host but without dealing with the operating system's BLE stack.

I want to avoid the OS's BLE stack by going the wireless 2.4 GHz route.

magic idol
#
  Used: C:\Users\azusa\OneDrive\Documents\Arduino\libraries\ServoESP32
  Not used: C:\Users\azusa\OneDrive\Documents\Arduino\libraries\Servo
exit status 1```



im getting this error with servoESP32
and it really sucks lmo
was wondering if anyone could help me
eternal cloud
#

One board will be in the keyboard, registering the key presses, and the other will be connected to USB as a dongle, communicating with the host computer.

smoky crest
eternal cloud
tardy iron
#

Bluetooth is 2.4GHz, last i checked. are you wanting them to talk a specific proprietary 2.4GHz protocol like Logitech?

smoky crest
# tardy iron Bluetooth _is_ 2.4GHz, last i checked. are you wanting them to talk a specific p...

I'd prefer an open source protocol, if possible, that would mean I would avoid having to reivent everything.
Bluetooth is fine as an option but I don't want to make this the only option. https://www.adafruit.com/product/5199 seems like the sorta of thing I need but, again, I'm not sure.

How would I sniff the traffic between a Logitech wireless keyboard, or any wireless keyboard for that matter, and its wireless USB dongle? I want to see the proprietary 2.4GHz communication taking place even if it is not in plain text.

eternal cloud
smoky crest
eternal cloud
#

You register the keys on one board, and send them to the usb "dongle" board, that does the HID calls on PC

tardy iron
#

nRF has its own proprietary 2.4GHz protocol, too. but i think you have to pay a license fee to enable it

tardy iron
eternal cloud
eternal cloud
#

As long as you have jumper wires for a breadboard prototype (recommended) and you don't over voltage the module, I don't think that adapter is needed... up to you.
Though for the final project you will probably want to design a case, and solder everything together with as small a footprint as possible.

smoky crest
eternal cloud
#

No idea, sorry

eternal cloud
# maiden kite Also installed

I am not sure what it could be 😕 I have the same board, and tried it, the example code should work fine.
I guess... just start over, make a new sketch, and double check everything is installed correctly 🤷‍♀️

fair tusk
#

i'm using a mega to control a adafruit sound fx board with hardware serial. WHen i check the code it gives me a error for sfx.playTrack(0); saying error: call of overloaded 'playTrack(int)' is ambiguous
sfx.playTrack(0);
^
note: candidate: boolean Adafruit_Soundboard::playTrack(uint8_t)
boolean playTrack(uint8_t n);

note: candidate: boolean Adafruit_Soundboard::playTrack(char*)
boolean playTrack(char *name);

exit status 1

Compilation error: call of overloaded 'playTrack(int)' is ambiguous

#

how do i play track 0 in the function sfx.playTrack(0); ?

fair tusk
#

thank you @leaden walrus

fair tusk
#

i'm trying to send a command to the adafruit sound fx board to play by track name I have this code

#

sfx.playTrack(track_name[i]);

#

am i not sending the right char to the function?

#

when i use the example and try by track name i get this

#

Enter track name (full 12 character name!) >
Playing track "T01"Failed to play track?

#

when I ask it to list the tracks the names are T01 etc

#

is there a "full name" to the tracks thats 12 characters long?

leaden walrus
#

you have to give 12 characters regardless of actual name

#

filename are 8.3 format

#

note the need for padding if names are short

#

or 11 characters it seems...no dot

#

the library takes care of the leading P and trailing newline \n

#

char track_name[17] = {'TTT WAV',

hushed coral
#

I'm testing out a simple script and iOS app to receive "measurements" from an arduino nano device. The measurements are sent via bluetooth through the bluefruit to the iOS device. I've debugged on the iOS side and can see the data sent over is jumbled such as random letters and characters put together while serial shows what im sending from the arduino to the bluefruit is consistently this: String data = "Bluetooth Test 1,100.25,100,3,1234,150.5,150,6,4321"; Is there a common issue on data being wrong from the arduino to the bluefruit or a way to check what is sent?

i know both scripts work because i checked on an esp32 and outside of small changes on the arduino side, the data gets received from iOS without issues.

#

here are examples of some iOS dbugger responses regarding jumbled data:
Raw data bytes: 9c
Failed to decode data to String
Raw data bytes: 1db39f
Failed to decode data to String
Raw data bytes: 8c

north stream
#

Are you using Bluetooth in UART mode or what?

hushed coral
dusk orchid
hushed coral
#

Oh so essentaially the question was is the bluefruit connected to "rx/tx" pins? Yes, currently using softwareserial. Im receiving data so i know its working, the data is just getting corrupted between the nano and iOS device.

Example if i try to send "Hello" over itl come over similar to like "eb" or something very different

north stream
#

Could be a speed difference, maybe try setting your receiver to 9600bps, 19200bps, or 115200bps?

hushed coral
#

attempted that. still no dice sadly

#

maybe just busted bluefruit out the bag? Im not a super noobie but not a pro. So not exactly sure how to test and prove its not working

astral swift
#

is it pin 24, 15, or pin 7?

#

also, is there a way to export *.uf2 files from the arduino ide? I'm seeing ".hex" ".bin" ".elf" and ".map" files, but not ".uf2" files

fair jasper
fair jasper
fair jasper
stable forge
stable forge
#

you can also find uf2conv.py in the uf2 repo which will convert .bin to .uf2

astral swift
# stable forge i think should be D7 (or just 7).

Thanks for saving me debugging time if I was wrong. Also thanks for the pointer to that uf2 repo 🙂 you've been such a massive help in the circuitpython channel. Thanks for the help in c(++) land too👍🏽

stable forge
#

you're welcome!

astral swift
#

Is that expected to run? Or do I need "D7" instead of just 7?

stable forge
#

so it's not working?

astral swift
#

I'm currently without MCU to test with

stable forge
#

hold on....

astral swift
#

I'm just writing code at a bar for when I'm back at home and able to compile and test it. I've written that as my "Arduino/C++" test, and wrote the following as my circuitpython test: https://paste.rs/UKjO0.py

#

just as a test of the delay times between each firmware

#

I'm significantly more interested in the practical jitter between mouse movements and not mouse clicks, but I figured this might be a fair jumping off point for further inquiry

stable forge
# astral swift I'm just writing code at a bar for when I'm back at home and able to compile and...
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(7, INPUT_PULLUP);

}

void loop() {
  if (digitalRead(7) == HIGH) {
    digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
    delay(1000);                      // wait for a second
    digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
    delay(1000);  
    }                    // wait for a second
stable forge
#

7, not D7, and set a a pullup.

astral swift
#

aah, thanks for that, missed the pullup

stable forge
#

The slide switch either connects 7 to ground or to nothing. In the above example, the blink happens with the switch to the left (usb jack at top)

astral swift
#

gotcha, so if I just :%s/INPUT/INPUT_PULLUP/g I'm good with my originally pasted script?

stable forge
#

yes

astral swift
#

thanks 🙂

#

So while I'm not technically competent enough to dig into the adafruit_hid circuitpython libraries and standing a chance at understanding delays/pauses/etc, I'm not even remotely aware of how to dig into an Arduino/CPP library to do the same work

#

I say this because, I want to give context to: "Do you expect there to be a difference between the performance of each piece of code?"

stable forge
#

to do the clickspeed test??

#

or the slide switch blink?

astral swift
#

to do the clickspeed tests

#

the blink "else" statement was just to declare to me that the MCU had completed it's program

stable forge
#

my guess is that even if there is no difference people will complain that there is

astral swift
#

plan was to hover the mouse over the clickspeed test button, then plug in the MCU, and see how many clicks it can execute in the 5 second or whatever it is timer

#

lolol

#

the difference to me is actually significant and not pedantic

#

adaptive inputs for disabilities

stable forge
#

HID in arduino is not all that hard, so I think you'll be able to duplicate it. For adaptive inputs, I think it will make no difference. We are not talking about gaming performance here

astral swift
#

actually we are!

#

Folks with disabilities want to click on heads with the rest of them!

stable forge
astral swift
#

C is fast @stable forge

#

Is there an equivalent to import microcontroller microcontroller.restart/reset() in arduino?

#

That's an extra 1.5k clicks with the c code vs. the python code!

#

ish

lethal yarrow
#

There are a few ways to trigger a reset with AVR. One of the easier methods is likely to trigger an unused interrupt.

magic idol
fair jasper
inland gorge
astral swift
#

aah, that would work.

astral swift
#

I was playing with SAMD21 (circuitplayground express)?

#

THat might have a WDT on it too

#

I didn't consider intentionally triggering the WDT to cause a reboot

inland gorge
astral swift
#

Thanks!

nova swift
#

Hello, is there any way to use the Adafruit GFX Library to draw a bitmap which i can then push to my waveshare display? i just want ot draw the bitmap. writing to the display is gonna be handled by some other library.

magic idol
#

prob gonna change to NRF24L01+ istead of ESP-NOW cause i dont think espnow is reliable enough

#

so im using Arduino Nano. Thanks alot tho

timid vale
#

Currently using two Adafruit Feather RP2040 w/RFM95 LoRa Radio to send accelerometer data from one to another (using Radiohead library). Unfortunately, we are finding that the transmission seems very inconsistent and only works some of the time. I did find online that "interrupt callbacks are not working yet" on the RP2040 core. Does anyone have any insight on this?

odd fjord
timid vale
#

@odd fjord You're the goat

fair jasper
magic idol
#

my bad

safe crown
#

at SAMD51(J19A) experts here (including Metro M4 / Itsybitsy) : I'm running into a really weird issue with a fw and code that was running so far under revision D of the silicon of this MCU. Now, there are various issues on revision F (MCU silicon currently sold). Issues involve USB (tinyUSB), probably DMA and PWM / Timers. I couldn't find something obvious in the silicon revision, I wondered if anyone occurred to have issues on a recent silicon version with their application.
My board is custom, running CMSIS (5.4.0) and the CMSIS atmel version 1.2.2. I'm wondering if certain things would have changed since microchip took over atmel, like a new CMSIS / register map or something ? That would be a huge problem for backward compatibility but I figured I'd ask here

dusk orchid
safe crown
#

thank you so much @dusk orchid I'll give it a shot. I'm trying to figure out if there's something with the definitions and includes from CMSIS (the formerly Atmel-CMSIS) and run some diff, then also run some code on a recent M4 board (if I can source a F silicon revision for them)

stable forge
safe crown
#

@stable forge thank you. I'm narrowing it down to this :

#

while it doesn't provide the fix to me yet, that's one of the rare errata that show a difference between what was working so far (ref A and D) and the new rev (I don't have a G only a F in possession)

#

when using a second DMA channel on a peripheral (with a channel # > greater that the one that is eventually turned off) and chained descriptors, the DMA engine screws it up and the MCU ends crashing

stable forge
safe crown
#

the crash is for F. Which is "weird" as the errata shows that revision BEFORE are affected (the way I read it at least, otherwise the sheet is meaningless). I had issues making it to work from revs A and D, indeed (concurrency of DMA channels) so there might be something I did that made it work but it's not working anymore

#

it could be precisely what is happening from what the sheet describes : enabling a second DMA channel when the first one is already running (I'm using chained descriptors as far as I remember). Channels are getting paused and resumed, I don't know if that's causing the issue, but it could be just the allocation that causes it

final anvil
#

Im trying to use arduino for coding my micro bit v2 after this tutorial:
https://learn.adafruit.com/use-micro-bit-with-arduino/install-board-and-blink
getting this errors:

/home/julian/snap/arduino/85/.arduino15/packages/sandeepmistry/tools/openocd/0.10.0-dev.nrf5/bin/openocd: error while loading shared libraries: libudev.so.1: cannot open shared object file: No such file or directory
ERROR: ld.so: object '/snap/arduino/85/$LIB/bindtextdomain.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

edit: i have installed libudev.
Thanks in advance!

fiery imp
#

Hi, beginner here. Can't figure why status of either indicator or toggle switch is not working on the web app dashboard. sensor data though are being snt and updated successfully though. Will appreciate any help in figuring this out.

FanState.publish(fanState);

#

switch (stage) {
case 1:
if (temperature > s1MaxTemp) {
digitalWrite(fanRelay, HIGH);
fanState = 1;

eternal cloud
toxic raft
#

Does someone know can i use micropython/circuitpython (preferably circuit) on my arduino uno?

#

It is a r3 if it helps

leaden walrus
#

it's not possible. uno is not powerful enough.

modest tundra
#

New to this but is there a way to set the code so that the led strip will light up from one end to the other and hold that position for a bit before turning off? I know of the delay function but only find that it delays the leds light up.

crimson crag
#

hey everyone, I am working on a project that uses adafruits pumps. i have a playground express on a crickit and im coding via arduino. i am trying to get it to work so that one creates suction and the other pressure, i also have a solenoid which i connected to the playground. i am a beginner at coding fyi :/ ik it should be a simple coding setup but I have no idea what i am doing. some help would be much appreciated

wintry heart
#

I'm new to arduino and trying to get this 0.96in oled screen to work but nothings appearing im 99% sure my connections are good so idk what the problem is 😭

#

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

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire);

void setup() {
Wire.begin();

if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for (;;);
}

display.clearDisplay();

display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);

display.setCursor(0, 0);
display.println("Hello, World!");

display.drawRect(10, 10, 20, 20, SSD1306_WHITE);
display.fillRect(40, 10, 20, 20, SSD1306_WHITE);
display.drawCircle(70, 20, 10, SSD1306_WHITE);

display.display();
}

void loop() {
// Nothing to do in the loop for this test
}

inland gorge
eternal cloud
eternal cloud
modest tundra
#

@eternal cloud like this

#

So in the code I'm trying to get the led to go from one side to the other and then from that side back. What ends up happening is that the led comes from both sides any suggestions?

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
 #include <avr/power.h>
#endif

#define PIN 12

void setup() {
 strip.begin();
 strip.setBrightness(50);
 strip.show(); // Initialize all pixels to 'off'
}

void loop() {

 colorWipe(strip.Color(0, 255, 0), 50); 
 delay(2000);
 colorWipe(strip.Color(0, 0, 255), 50); // Blue
// rainbowCycle(20);
}
void colorWipe(uint32_t c, uint8_t wait) {
 for(uint16_t i=0; i<strip.numPixels(); i++) {
   strip.setPixelColor(i, c);
   strip.show();
   delay(wait);
 }
for(uint16_t i=strip.numPixels(); i>0; i--) 
   strip.setPixelColor(c, i);
   strip.show();
   delay(wait);
 }```
crimson crag
eternal cloud
crimson crag
#

thanks

crimson crag
#

this is what my code looks like and my circuit is shown below. Nothing is happening

#

i am trying to get one pump to blow out air, the valve switches and the other sucks air

#
#include "seesaw_motor.h"

Adafruit_Crickit crickit;

seesaw_Motor motor_a(&crickit);
seesaw_Motor motor_b(&crickit);

void setup() {
  Serial.begin(115200);
  Serial.println("Dual motor demo!");
  
  if(!crickit.begin()){
    Serial.println("ERROR!");
    while(1) delay(1);
  }
  else Serial.println("Crickit started");

  //attach motor a
  motor_a.attach(CRICKIT_MOTOR_A1, CRICKIT_MOTOR_A2);

  //attach motor b
  motor_b.attach(CRICKIT_MOTOR_B1, CRICKIT_MOTOR_B2);

  crickit.setPWMFreq(CRICKIT_DRIVE1, 1000);
}

void loop() {
  motor_a.throttle(1);
  motor_b.throttle(0);
  crickit.analogWrite(CRICKIT_DRIVE1, CRICKIT_DUTY_CYCLE_OFF);
  delay(1000);

  motor_a.throttle(0);
  motor_b.throttle(0);
  crickit.analogWrite(CRICKIT_DRIVE1, CRICKIT_DUTY_CYCLE_MAX);
  delay(1000);

  motor_a.throttle(0);
  motor_b.throttle(-1);
  crickit.analogWrite(CRICKIT_DRIVE1, CRICKIT_DUTY_CYCLE_OFF);
  delay(1000);
}

eternal cloud
pine bramble
#

hello there,

I am using a CCS811 module on my Arduino uno R3.

The problem is, is that it continuously print: "error!". No matter what i do. I have tried to use different arduino, but it does not seem to work.
Ignoring the warning will only mke the Css811 return a 400ppm in CO2 and a 0 value of TVOC gasses.

I have no clue what to do

This is my code:


#include "Adafruit_CCS811.h"

Adafruit_CCS811 ccs;

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

  Serial.println("CCS811 test");

  if(!ccs.begin()){
    Serial.println("Failed to start sensor! Please check your wiring.");
    while(1);
  }

  // Wait for the sensor to be ready
  while(!ccs.available());
}

void loop() {
  if(ccs.available()){
    if(!ccs.readData()){
      Serial.print("CO2: ");
      Serial.print(ccs.geteCO2());
      Serial.print("ppm, TVOC: ");
      Serial.println(ccs.getTVOC());
    }
    else{
      Serial.println("ERROR!");
      Serial.println(ccs.readData());
      Serial.println(ccs.checkError());
      while(1);
    }
  }
  delay(500);
}
#

Feel free to ping me when you respond

eternal cloud
pine bramble
eternal cloud
#

so it doesn't read the data correctly, even though it's available

the picture doesn't show any clear details, are you sure your wiring is correct?

pine bramble
#

I think so, if i remove some wires then the serial monitor will print: "Failed to start sensor! Please check your wiring."

eternal cloud
#

if you could take some pictures from above, where the connections and pin numbers are clearly visible, that would help to double check 🙂

pine bramble
#

i'll send the image in a minute

#

here are the images

eternal cloud
#

looks okay, unless this sensor board has some quirky stuff (it's the aliexpress one? )

pine bramble
#

i don't know where they got it

#

it last i might buy a new one and hope that that works

eternal cloud
pine bramble
eternal cloud
#

yea, it's one of the aliexpress ones, looking a bit into it

#

it's supposed to be powered from 3V, doesn't have a regulator, so not 5... try that

pine bramble
#

the arduino uno only support 3.3V, is that fine too>

eternal cloud
#

yea, 3.3

pine bramble
#

maby the module itself doesn't work

eternal cloud
eternal cloud
pine bramble
eternal cloud
#

or if you have another board

pine bramble
pine bramble
eternal cloud
#

Even better if you'd have one that supports CircuitPython, you could test it with that

pine bramble
stable forge
#

If it was working and it stopped, did you accidentally connect 5V to it?

eternal cloud
#

It wasn't accidental, I'm assuming.
5V was connected to VCC on the sensor, and I completely forgot that Arduino Uno boards have 5V logic (never worked with one 😅)

That would explain the stop working part.

magic idol
#
const int speakerPin = 3; // Speaker PWM output pin

void setup() {
  // Set speaker pin as output
  pinMode(speakerPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // Read audio input from microphone
  int micValue = analogRead(micPin);

  // Adjust micValue for speaker output (map to 8-bit range)
  byte audioOutput = map(micValue, 0, 1023, 0, 255);

  // Output audio to speaker
  analogWrite(speakerPin, audioOutput);
  Serial.println(micValue);

  // Add some delay to smooth out the audio output
  delay(10);
}

Context :
i wanted to use an arduino nano to get input from a mic and output that same audio to a speaker ( a phone speaker since its small enough ).
It does sort of work but its just beeps, no actual audio. BUT mic voltage seems to change when i speak into the mic, and when that happens theres like an air sound on my speaker.

Is there any way to fix this?

stable forge
# magic idol ```const int micPin = A0; // Microphone analog input pin const int speakerPin ...

to get telephone-quality speech, you need to sample at a rate of 8 kHz. 10 kHz is once every 0.1 msecs. You included a 10msec delay, so that is at least 100x slower than you need. Even if you removed that delay, I don't know how fast that loop is really going to run. At least remove the delay and the println. You could run the loop, say 10,000 times, and see what the elapsed time is. But if this is a practical project, and not just "let's see what happens", then skipping the microcontroller altogether is what to do.

magic idol
#

ill try this out in a sec

stable forge
magic idol
#

the remove delay/println actually somewhat worked!

#

but its still really low quality

stable forge
#

it will work for really low-frequency audio

magic idol
#

maybe i should add some filters to it?

#

i dont know why its also making that high pitched noise lmo

stable forge
#

the analogWrite is not going to work, based on the PWM rate

#

that's the PWM. It's not true analog, like I said

magic idol
#

oh i see

#

thank you

stable forge
#

read the link

#

analogWrite() is really a misnomer

#

it's simulated analog

magic idol
#

oh ok

#

mind is mixed up rn

stable forge
#

you can use high-clock-rate PWM and then filtering to do analog output, but for audio, that's not going to work at the low clock rates analogWrite() provides

stable forge
#

you need at least twice the highest frequency you want to output, to avoid what is called "aliasing", and then you need good low-pass filters.

#

You would be better off picking a different board that has true analog out. But what is your use case here? Are you trying to record audio and also output it?

magic idol
magic idol
stable forge
#

so that means the highest audio frequency possible is 450Hz, which is pretty low. Telephone bandwidth is typically up to 4 kHz

#

human speech usually starts around 350 Hz

tame bay
#

hello I am looking for someone who can help me finish this code. I have done as much as I could with it and the last bits of code I need is to send out a signal when any 6 numbers is entered, order of said numbers doesn't count.

#

If you want, I can return the help with a drawing

fair tusk
#

I have a TFT display 240x320 ST7789 display I wired it and got it to show the purple flowers image. I can't seem to convert my own image to show. I tried multiple online image sitesthe last one had all the options i needed. https://redketchup.io/bulk-image-resizer but the image still wont show up after a power cycle

#

I get blue screen then black screen

#

nevermind i forgot to change the file name in the sketch

eternal cloud
tame bay
# tame bay

My goal is to be able to type in 6 numbers from a keypad that will be displayed on an LCD. When 6 numbers of any combo is typed in, the device will send out a signal. I'm using and arduino uno, I think I have pictures somewhere I needed, I am stuck on figuring out how to code the thing to send a signal when 6 numbers have been typed in.

Oh, I think I figured out a worl around. I will test that out and then come back.

eternal cloud
tame bay
eternal cloud
fickle nest
#

Hello and good day, I would like to know if AdafruitIO (Adafruit's IoT cloud service) supports STM32duino?

tender wasp
#

the second link notes that it takes a few cycles to loop over 8 output pins, so it might be more CPU-intensive than your single PWM output.

magic idol
fresh idol
#

For using the Adafruit_SHT4x library it tells me I need two wires but I can't figure out where in the example i assign the correct GPIO pins.

safe shell
#

@fresh idol what board? are you using the default I2C pins?

fresh idol
#

I'm using NodeMCU 1.0 (EPS-12E).

#

adding #include <Wire.h> and Wire.begin(D1, D2); to setup made it work not sure why i needed those and why the example didn't have them.

eternal cloud
# fresh idol adding #include <Wire.h> and Wire.begin(D1, D2); to setup made it work not sure ...

The library already uses Wire, and defaults to the i2c bus defined for classic arduino boards https://www.arduino.cc/reference/en/language/functions/communication/wire/
And the example was written with those in mind i guess.
For any other boards, the i2c bus needs to be specified

pine bramble
#

Also sorry for responding so late

dusk orchid
# fickle nest Hello and good day, I would like to know if AdafruitIO (Adafruit's IoT cloud ser...

Adafruit IO supports any device, you can interact via MQTT or the HTTP API. There are some libraries to make it easier, but you basically need mqtt or web working first and then look at the adafruit_IO library https://github.com/adafruit/Adafruit_IO_Arduino/tree/master/examples

Separately there is an open-source arduino based firmware called WipperSnapper that gives a nice device+component configuration through the adafruit IO site (the devices page), but the STM32duino is not currently supported

eternal cloud
fickle nest
#

I did manage to get it to work with the mqtt example, but the adafruit IO examples dont seem to work for some reason

fluid wagon
#

Hi! Is anyone using platformio with an airlift device? I am trying to set up the platformio.ini to download and install the custom WiFiNINA, but, I can't seem to figure it out.

fluid wagon
#

Ok, I worked it out, file spacing. Good times!

eternal cloud
dusk orchid
# fickle nest alright thanks

Happy to help get you further, if you have mqtt working that's the main precursor. Then it's password = Adafruit IO Key, then often people forget to create a feed before using it or attempt to use the feed Name instead of feed KEY for that part of the mqtt topic. Lastly there are SSL issues with older microcontrollers (root SSL certificates changed) so make sure the ATWINC1500 is updated or switch to non-ssl based MQTT (port 1883 instead of 8883). Read the docs and see how far you get

tame bay
#

Hello, I'm seeking for advice on how to deal with this error. I'm very new to coding and thus struggles a bit understanding the culture of the coding community so I'm sorry if I come of in a negative way. But I would like some help with this error, as I don't know how to solve it.

odd fjord
#

It is not clear why you are using while statments there at all

tame bay
#

As for the while statements I'm not sure, someone else on my team did the code for that portion of code and it gave the wanted outcome.

safe crown
# stable forge the crash is rev D or rev F?

I ended up sizing down the code to something super simple as a tester, to reproduce what I was facing with my app, and also making it compatible with an itstybitsy M4 (same family as my samd51j19a even if not exact model, concerned by the same errata sheet).
Bottom line: in rev F of the silicon, if you allocate a dma channel and set it with a trigger source then allocate another channel with the SAME trigger source, first channel will never start its job and will not finish it.
Triggering the SECOND one will eventually sometimes start the first channel, sometimes not

#

My use case is to use a timer (TCC) and use 2 of its outputs (TCCx[0] and TCCx[1]) to send pulse trains using PWM. I managed to replicate this with the default init of D4 and D5 on the itsty. Code works on the ones I have here, which are rev D chips. Same code (using the adafruit zero dma lib) works on my older board rev D and has mentioned issues on rev F

#

weirdest is : when the second channel is allocated, and configured with the trigger source, the first DMA channel is not even running (DMAC enable is set to 1 though). If I allocate without updating the trigger source, my first channel behave properly. If the second DMA channel is set to a different trigger (for instance another timer) it work. As soon as I set it to the same trigger source, even without firing it (startJob() ), it doesn't work

#

if I revert / change the trigger source of the second channel on the fly during execution (by pressing a switch), and move the trigger source to something else, first channel works again

#

if anyone has access to a rev F MCU / board ATM, I'd be glad to confront my findings, I'm really lost

odd fjord
odd fjord
#

No problem. Posting actual code allows the helpers to cut/paste examples and suggetions. Screenshots can be hard to red.

crimson crag
#

hello everyone. i am trying to work the air pumps so that one creates pressure and the other creates vacuum. the solenoid is used to switch between each. my code looks like this: ```#include "Adafruit_Crickit.h"
#include "seesaw_motor.h"

Adafruit_Crickit crickit;

seesaw_Motor motor_a(&crickit);
seesaw_Motor motor_b(&crickit);

void setup() {
Serial.begin(115200);
Serial.println("Dual motor demo!");

if(!crickit.begin()){
Serial.println("ERROR!");
while(1) delay(1);
}
else Serial.println("Crickit started");

//attach motor a
motor_a.attach(CRICKIT_MOTOR_A1, CRICKIT_MOTOR_A2);

//attach motor b
motor_b.attach(CRICKIT_MOTOR_B1, CRICKIT_MOTOR_B2);

crickit.setPWMFreq(CRICKIT_DRIVE1, 1000);
}

void loop() {
motor_a.throttle(1);
motor_b.throttle(0);
crickit.analogWrite(CRICKIT_DRIVE1, CRICKIT_DUTY_CYCLE_OFF);
delay(1000);

motor_a.throttle(0);
motor_b.throttle(0);
crickit.analogWrite(CRICKIT_DRIVE1, CRICKIT_DUTY_CYCLE_MAX);
delay(1000);

motor_a.throttle(0);
motor_b.throttle(-1);
crickit.analogWrite(CRICKIT_DRIVE1, CRICKIT_DUTY_CYCLE_OFF);
delay(1000);
}


the solenoid switches but my pumps dont work. can anyone tell me whats wrong with it? it might be my wiring or its my code but im unsure.
eternal cloud
crimson crag
#

they dont start

eternal cloud
# crimson crag they dont start

you only have them on for 1 second at a time... maybe they do start, but you miss it? try a longer delay
also, you don't need to reverse them, it won't change the air flow (so throttle 1 or -1 does the same thing for these pumps)

crimson crag
eternal cloud
# crimson crag ill try a longer delay. so how would i change the airflow?

When powered, the pump sucks air in from the side of the plastic casing and pushes it out the tubing port. Reversing the motor polarity does not change the direction of air flow! If you need to both inflate and deflate something, you'll need two pumps.

So how you have them connected is great, the one on the right sucks in the air, and the one on the left pushes it out (or maybe the other way around, i don't have any on hand to try 😅 )
you will probably have to time your solenoid valve with pumps, so air flow can happen

#

look at the 2 gifs on the product page here: https://www.adafruit.com/product/4699
first one you can see the upper pump moving and sucking the air out of the baloon, and second one the lower pump inflates it

crimson crag
eternal cloud
#

but these pumps don't reverse, so just pick an interval

crimson crag
#

thanks i really appreciate your help

eternal cloud
#

Sure! toebeans I hope you get it working soon!

crimson crag
#

me too lol

eternal cloud
# crimson crag me too lol

I meant I hope you get it working really soon, cos I've been dying to see that product page balloon inflate completely ever since you started posting about your project 😆
So either you post a video, or I have to make the project myself, just for that, lol

crimson crag
spice otter
#

I am using the LSM6DSOX and VEML7700 Arduino libraries.
I need to specify the I2C pins to use when initializing these.

It seems quite complex, so I would like some assistance so I can specify the I2C pins to use.

spice otter
#

I do not know where the pins are defined. There is a TwoWire class that is apparently where the I2C pins are defined. However, I have not found where the TwoWire class is defined.

I am not using a regular Adafruit board. I am using an Arduino Portenta C33 on an Arduino HAT Carrier. I need to use I2C pins on the Raspberry Pi compatible connector. I just need to find out how to define the I2C pins I need to use. The Pi connector is at the top of the picture.

stable forge
spark otter
#

Hey everyone, it's my first time using a breadboard and a display and I'm just confused about all the pins, I'm looking at the website and there are different displays with a different amount of holes

#
  • Monochrome 0.96" 128x64 OLED Graphic Display - STEMMA QT
  • Half Sized Premium Breadboard - 400 Tie Points
  • Arduino UNO R3
    hopefully this helps
#

Wait do I even need a breadboard for this? I'm watching a video and it says Stemma QT doesn't need it

#

Okay cool, I got it all wired up with stemma qt

#

Oh nice, it works :D

safe crown
# stable forge Could you please open an issue about this in <https://github.com/adafruit/Arduin...

greetings @stable forge : issue opened, bug report submitted to microchip and test code added. I plan to try to source some 51J19 and 51G19 in QFN package at mouser asap to try to put my hands on revision F chips, the ones I have currently at home are J19 only and in TQFP package. My goal would be to swap MCU with the rework station on existing itsy M4 and M4 express to double confirm the issue and using the exact SAMD core as it exists at adafruit, so that it can be reproduced by others

#

I confirm the 2 M4 express on my bench are rev D too so I can't make this test happening again until I source new versions of the MCU (in QFN format). Let me know if this is something you have at the facility. Cheers

pine bramble
#

@eternal cloud sorry that i ping you, but could you please help me:

/***************************************************************************
  This is a library for the CCS811 air

  This sketch reads the sensor

  Designed specifically to work with the Adafruit CCS811 breakout
  ----> http://www.adafruit.com/products/3566

  These sensors use I2C to communicate. The device's I2C address is 0x5A

  Adafruit invests time and resources providing this open source code,
  please support Adafruit andopen-source hardware by purchasing products
  from Adafruit!

  Written by Dean Miller for Adafruit Industries.
  BSD license, all text above must be included in any redistribution
 ***************************************************************************/

#include "Adafruit_CCS811.h"

Adafruit_CCS811 ccs;

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

  Serial.println("CCS811 test");

  if(!ccs.begin()){
    Serial.println("Failed to start sensor! Please check your wiring.");
    while(1);
  }

  // Wait for the sensor to be ready
  while(!ccs.available());
}

void loop() {
  if(ccs.available()){
    if(!ccs.readData()){
      Serial.print("CO2: ");
      Serial.print(ccs.geteCO2());
      Serial.print("ppm, TVOC: ");
      Serial.println(ccs.getTVOC());
    }
    else{
      Serial.println("ERROR!");
      while(1);
    }
  }
  Serial.println("Loop");
  delay(500);
}

I used this code from the library, but the loop does not seem to work.

I get no errors, and the serial monitor does not print "Loop".

I used this tutorial to wire: https://learn.adafruit.com/adafruit-ccs811-air-quality-sensor/arduino-wiring-test (i have the stemma QT version, so according to this tutorial, i do not need to connect it to WAKE)

And here are some pictures of the actual wire:

Adafruit Learning System

A sensor to sense the presence of different gasses in the air we breathe.

pine bramble
#

the ccs.available() will always return zero, so thats why i think that the loop function does not un, how can i solve this?

#

i have changed the code to:

/***************************************************************************
  This is a library for the CCS811 air

  This sketch reads the sensor

  Designed specifically to work with the Adafruit CCS811 breakout
  ----> http://www.adafruit.com/products/3566

  These sensors use I2C to communicate. The device's I2C address is 0x5A

  Adafruit invests time and resources providing this open source code,
  please support Adafruit andopen-source hardware by purchasing products
  from Adafruit!

  Written by Dean Miller for Adafruit Industries.
  BSD license, all text above must be included in any redistribution
 ***************************************************************************/

#include "Adafruit_CCS811.h"

Adafruit_CCS811 ccs;

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

  Serial.println("CCS811 test");

  if(!ccs.begin()){
    Serial.println("Failed to start sensor! Please check your wiring.");
    //while(1);
  }

  // Wait for the sensor to be ready
  while(!ccs.available()) {
    Serial.println(ccs.available());
  };
}

void loop() {
    Serial.println("Loop");
  if(ccs.available()){
    if(!ccs.readData()){
      Serial.print("CO2: ");
      Serial.print(ccs.geteCO2());
      Serial.print("ppm, TVOC: ");
      Serial.println(ccs.getTVOC());
    }
    else{
      Serial.println("ERROR!");
      while(1);
    }
  }
  delay(500);
}

And it still does not work, the onlything that prints is "CCS811 test"

eternal cloud
pine bramble
eternal cloud
#

after begin, like : "sensor started" and after while: "data available"

#

i have a feeling it gets stuck on that while

pine bramble
#

this is what it prints

eternal cloud
#

so it doesn't even get out of ccs.begin()? but doesn't error either... huh..

pine bramble
#

yeah its really weird

#

ifi remove the sensor:

#

then it does print B

#

but then obviously its not available so it will keep printing false

#

i have tried a different arduino, but that also does not work.

eternal cloud
#

i'm looking at your pics, and they're a bit blurry... but it looks like the soldering connections are not very solid

#

could you maybe try to reinforce them a bit? and make sure you solder all the pins (for mechanical and electrical stability) , not just the ones you are using

pine bramble
#

i'll ping you when i am done, ok?

eternal cloud
#

it seems weird that it doesn't begin the sensor, so an unstable connection might be the cause

eternal cloud
pine bramble
#

yoo it works

eternal cloud
#

Oh! and move the power connection to 5V, it needs to be same voltage as the logic pins
(which i keep forgetting are 5V on the arduino uno 😅 lol)

pine bramble
pine bramble
eternal cloud
pine bramble
#

alright

eternal cloud
#

long term it will matter, you can get errors since the reference is not the same

#

but yaaay! it works!

pine bramble
#

it constantly returns 400ppm and 0 TVOC, in the tutorial it says burn it in for 15 minutes, but does that mean that for 15 minutes it is going to return this value?

eternal cloud
#

i mean, voc should stay 0 if you have nothing stinky around 😄 you can test it with an alcohol swab

#

and yea, these types of sensors need data samples to calibrate themselves

pine bramble
#

It litterly just worked!

#

thanks

eternal cloud
#

try to put it next to an open window for a while, for baseline measurements of CO2

pine bramble
#

I also have another CO2 sensor but that one is an entire product so i can compare them, and i will do that what you said!

grand knot
#

Hey all, I just took delivery of some new mini ESP32-c boards and went to try a sketch. I ended up with it in what looked like a constant boot loop, dumping a hex to the console. Thinking I was doing something wrong, I grabbed an ESP32S, switched boards and had the same thing! I have (aint it always the way) just swapped laptops, set up as before with links to boards managers etc. I have tried with some older versions, no luck. The odd thing is using https://web.esphome.io/, it connects to the ESP, and programs it just fine. So, clearly a Laptop issue, maybe a layer 8. Any recommendation?

copy of error
ELF file SHA256: 86b572acc230adfe

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0
Access Point Started
IP Address: 0.0.0.0

assert failed: tcpip_send_msg_wait_sem IDF/components/lwip/lwip/src/api/tcpip.c:455 (Invalid mbox)
Backtrace: 0x400835a1:0x3ffb1f60 0x4008b6e1:0x3ffb1f80 0x40090b61:0x3ffb1fa0 0x400ede92:0x3ffb20d0 0x400fe29d:0x3ffb2100 0x400fe2fd:0x3ffb2120 0x400ed681:0x3ffb2170 0x400d4934:0x3ffb2190 0x400d49bd:0x3ffb21d0 0x400d4c81:0x3ffb2200 0x400d286f:0x3ffb2220 0x400d9daa:0x3ffb2290

grand knot
spice otter
#

OK, I will try this. Thank you! 😉 😄

inland gorge
grand knot
# inland gorge This often happens to me when I choose the wrong ESP32 board type.

Yeah, I had something similar before. The esp32C boards are clones, so who knows, but the others are normally used the wroom board for these before all fine. I am going for an uninstall, clean-out and resintall. I know they are fine as can load esphome via the webtool, so just got to be somtthing on the local install. Cheers all

inland gorge
grand knot
#

Good shout. will add to the list of checks 🙂

spice otter
#

I am defining pins according to the Raspberry Pi Connector.

#

No.

spice otter
#

This is the Raspberry Pi pinout I am using.

#

I am using the pins on the Arduino HAT Carrier.

#

I understand this.

#

I have a header file that translates the Arduino Portenta pins to Raspberry Pi pin names.

#

Adafruit libraries and I2C usage

stark kindle
# pine bramble I also have another CO2 sensor but that one is an entire product so i can compar...

You may know this already but the CCS811 isn't a CO2 sensor. It reports "eCO2" values - this is "equivalent CO2". The company that made it created a model of what CO2 measurements corresponded to what VOC measurements in a closed room. It's commonly sold or advertised as a CO2 sensor but it's not a real CO2 sensor .

For instance, if you put it inside a bag and then inflated the bag with CO2, it wouldn't notice because VOC levels wouldn't change. A real CO2 sensor would register the added CO2.

So beware how you use it; if you use it in ways other than the very limited scenario it was designed for, the CO2 levels it reports will be meaningless.

charred salmon
#

Man, that's like the HDMI to VGA cables that used to be sold ages ago that only worked if you had an extremely specific set of video cards that actually had the ability to put an analog VGA signal out on the HDMI port.

#

Sure, they did let you connect a VGA display to an HDMI port, but only if you satisfied a bunch of conditions that they didn't actually specify.

north stream
#

That sounds like DVI-I more than HDMI

charred salmon
#

That would have made sense. Alas, it was definitely HDMI.

fair jasper
#

I found a bug in a Seesaw lib where it incorrectly assumes a chip arch. How do I report it to AdaFruit?

fair jasper
#

—> Is there example code somewhere for the Servo over ATtiny I2C?

Even though I fixed the PWM frequency bug, I still can’t get the ATtiny to generate a valid PWM waveform for a Servo. The oscilloscope shows the signal as 0..100% duty cycle when it should be 5..10%. Others have reported this issue, too, with the Adafruit_Servo library calls.

leaden walrus
#

@fair jasper you probably have older firmware. see forum post for more info. if you have a USB serial cable like this:
https://www.adafruit.com/product/954
should be pretty easy to reprogram with updated firmware.

hexed mauve
#

Hey folks. I'm working on a project where I take a linear voltage input and convert it to a logarithmic output. This is to control the rate of the VCO on a 74HC4046 chip, which has an exponential response for its pitch control voltage.

So, the Arduino is reading a voltage between 0 and 5 volts as a number between 0 and 1023. The output from the Arduino is a voltage between 0 and 5, expressed as a number between 0 and 255. What math do I have to do to make the output curve logarithmic?

#

Ultimately what I need is for the rate of the VCO to scale linearly with the input control voltage.

tardy iron
#

do you need to use that chip specifically? i’m pretty sure there are linear voltage-to-frequency converters

hexed mauve
#

I am told by an engineer I trust that the 4046 is a good candidate for this application. In this case it is acting as an external clock for a vintage speech synthesizer chip where the clock rate determines the pitch of the synthesized speech.

The speech synth chip has a standard clock rate of 720kHz. Ideally I'd like 5 octaves of stable pitch coverage, which means halving the standard clock rate twice and doubling it twice for a frequency range of 180kHz to 2,880kHz.

The Arduino nano has a clock rate of up to 8MHz, but the rate of a PWM output is way way lower because it's based on divisions of the master clock. I think the maximum frequency is like 500Hz. You can do some trickery to change how this works, but that messes with functions like delay() and millis() which are important for this application.

tardy iron
#

what model of Arduino? AVR can do logarithms with the math library, but painfully slowly. you might manage with a lookup table though

hexed mauve
#

Arduino Nano. And yeah, I've considered the lookup table option, but I'm not sure where to start with actually building that table. I've also run into some memory limitations, so this may not be feasible depending on the size of the table.

tardy iron
#

you could program one of the timers directly. the Arduino core typically uses only 1 timer for delay and millis. you’d lose some analogWrite capabilities though

hexed mauve
#

I will def look into that, thanks! I'm still curious about converting the linear input to a logarithmic output though

tardy iron
#

ATmega328P has 32k of flash. you can probably spare 1k for a lookup table. note you might need some analog filtering on the PWM output to make it suitable for the VCO

#

generally you’ll want to use a small program run on your host computer to generate the code to cut and paste into the lookup table

tardy iron
#

oh, to clarify, you put the lookup table in PROGMEM so it only takes up flash, not RAM

obsidian knoll
#

what the heck is NAMELENMAX+1

#
hexed mauve
# obsidian knoll what the heck is ```NAMELENMAX+1```

In the second link you shared, when they define char value[NAMELENMAX+1], they're saying

  1. create an array
  2. of data type "char"
  3. named "value"
  4. of length "NAMELENMAX+1"

It's sorta confusing here because they didn't define this NAMELENMAX variable in their code. It's not some fancy keyword or anything, they're just assuming you already have a maximum name length in mind. In this case, 5 would do, since "Harry" has 5 characters. But if the name exceeds the length you define, you'd get an error.

Basically, when you define this char array, even before you assign the values "Bob" or "Harry," C++ sets aside a certain number of bits in memory to accommodate whatever you might put there.

Certain data types will always occupy the same number of bits in memory. A single char is always 8 bits, so 8 * namelenmax gives you the number of bits your name is taking up in memory.

This remains constant for each char array you define, even if the name is only 3 characters, like "Bob". The array will contain "B", "o", "b", and 2 null characters which take up the same amount of space as any other character. So, in order not to waste space in memory, you only want your maximum array length to be as long as the longest name you're giving it.

obsidian knoll
#

ah. ok.

#

i thought it was some kind of macro to automatically set the length

#

Kinda weird that the compiler can't just figure that out, especially if used w/ the static keyword?

hexed mauve
#

Agreed tbh. For me, coming to C++ from Python was super annoying, because Python handles all this stuff in the background. The tradeoff is that Python requires a lot more computation to accomplish this, so it ends up being extremely slow in comparison.

C++ is for the nerds who are working directly with hardware, so it requires more intimate knowledge of what the computer is physically doing when it moves the bits around. In the end the code ends up being more efficient and less likely to do something it's not supposed to.

#

It also didn't help that the Arduino forums are, like, the most hostile place in the world. People are so mean there lol

obsidian knoll
#

The arduino community in general is extremely toxic

tardy iron
#

the usual way to have an array of structures containing variable length strings, when you don’t want to specify a max string length, is to store them as pointers

obsidian knoll
#

Neat

#

For context, I'm trying to store ssid:password combos

#

They are never changed after flashing

north stream
north stream
obsidian knoll
#

Why is the last set null/null?

north stream
#

You need a way to find the end of the array. You can either precalculate the length with something like sizeof(passwords) / sizeof(struct kv) or you can just test for NULL when looping through it.

obsidian knoll
#

I see

#

Cool, thanks!

north stream
#

Note: I made a couple of post edits to fix up variable typing, indenting, and remove a trailing comma (Python allows that, most C compilers don't)

#

My loops generally start like this:

#
for (struct kv kvp = passwords; kvp->value != NULL; ++kvp) {
#

The other approach is: ```arduino
#define ARRAYLEN(x) ((sizeof(x) / sizeof(x[0])

struct kv kvp = passwords; // key-value pointer
struct kv kve = kvp + ARRAYLEN(passwords); // key-value end

for (kvp = passwords; kvp < kve; ++kvp) {

#

Note you can also use PROGMEM to store the data in flash instead of RAM (some compilers will do that for you with static const and others won't)

fair jasper
obsidian knoll
#

I assume I could switch it to two chars too

fair jasper
fair jasper
leaden walrus
north stream
tardy iron
obsidian knoll
#

what am I missing?

#

@north stream What am I missing here?

#

I get the same with your example?

struct kv {
    int                  key;
    static const char *  value;
};

static const struct kv passwords[] = {
    { 123, "Bob" },
    { 345, "Harry" },
    { 234, "Sue" },
    { -1, NULL }
};
north stream
#

I was typing that from memory, I probably missed something, but I'm not sure what it is

obsidian knoll
#

it still wants the size 🤔

#
struct kv {
    int                  key;
    static const char *  value;
};

static const struct kv passwords[][30] = {
    { 123, "Bob" },
    { 345, "Harry" },
    { 234, "Sue" },
    { -1, NULL }
};

This works

#

nope nvm

north stream
#

Try it with the size, like passwords[4] =

obsidian knoll
#

this works.

struct commands
{
  int   cmd;
  char  descr[25];
};

commands cmds[] =
{
  {16, "Hammond Organ"},
  {17, "Percussive Organ"},
  {18, "Rock Organ"},
  { 0, "" }                   // end of list marker 
};
north stream
#

Ah, instead of an array of pointers to char, an array of char[n] so it preallocates the storage. A little wasteful, but it works. I vaguely remember there's a cleaner way

obsidian knoll
#

kinda ugly

#

i was really hoping to not have to preallocate

north stream
#

I don't think you have to. Did you try passwords[4]?

obsidian knoll
#

OHO

#
struct commands {
  char* ssid;
  char* password;
};

commands cmds[] = {
  { "ssid1", "password1" },
  { "ssid2", "password2" },
  { "ssid3", "password3" },
  { "", "" }
};
#

this works.

north stream
#

Note that using NULL instead of "" will save a tiny amount of space and making checking for the end more efficient.

obsidian knoll
#

i see

#

so, what is different here lol

#

you used static const char in the struct?

north stream
#

I'm basically telling the compiler "these things aren't gonna change and are local to this module" which allows the compiler to do various kinds of optimizations

obsidian knoll
#

yeah so if i add static const it breaks.

#

This works:

struct wifiCredStruct {
  char* ssid;
  char* password;
};

wifiCredStruct wifiCreds[] = {
  { "ssid1", "password1" },
  { "ssid2", "password2" },
  { "ssid3", "password3" },
  { "", "" }
};

This does not:

struct wifiCredStruct {
  static const char* ssid;
  static const char* password;
};

wifiCredStruct wifiCreds[] = {
  { "ssid1", "password1" },
  { "ssid2", "password2" },
  { "ssid3", "password3" },
  { "", "" }
};
#

Which is weird...

worldly pewter
#

Has anyone successfully made a fake arduino IDE without the arduino.cli library?

obsidian knoll
#

I get error: too many initializers for 'wifiCredStruct'

#

@north stream aha maybe got it.

struct wifiCredStruct {
  char* ssid;
  char* password;
};

static const wifiCredStruct wifiCreds[] = {
  { "ssid1", "password1" },
  { "ssid2", "password2" },
  { "ssid3", "password3" },
  { "", "" }
};

This works fine.

#

is this equivalent?

#

now to figure out how to for loop it! lol

north stream
#

Kinda-sorta. The details of where the variables are stored and the compiler optimizations vary, but practically, it will work. If you need to get more speed or free up RAM, is where the complications come in.

obsidian knoll
#

i really do not

#

this is a super simple project

north stream
#

Yeah, I admit I am guilty of premature optimization there

obsidian knoll
#

but yeah - it seems to work well enough haha

#

I am not fully understanding how to iterate through this

north stream
#

The example I gave above should still work

#

Declare a pointer to wifiCredStruct, initialize it jto point to wifiCreds, then you can access its elements with ->ssid and ->password

#

Then if you increment the pointer, it will move forward to the next entry in the array of structs

#

For the non-NULL version above, it would look something like ```arduino
for (wifiCredStruct * wcsptr = wifiCreds; *wcsptr->ssid != '\0'; ++wcsptr) {
// do stuff with wcsptr->ssid and wcsptr->password
}

obsidian knoll
#

ahhhhh.

north stream
#

Or you can skip putting the declaration in the for loop: ```arduino
wifiCredStruct * wcsptr;

for (wcsptr = wifiCreds; *wcsptr->ssid != '\0'; ++wcsptr) {

obsidian knoll
#
  for (int i = 0; i < sizeof(wifiCreds) / sizeof(wifiCreds[0]); i++) {
    Serial.println(wifiCreds[i].ssid);
    Serial.println(wifiCreds[i].password);
  }
#

This works. Why is your way better?

#

(i mean like. what are the benefits)

north stream
#

It's a stylistic difference, mostly. Personal preference. Note that if you're doing the sizeof() check, you don't need the final {"", ""} end of array marker

obsidian knoll
#

i see

north stream
#

What the compiler does under the covers is interesting to some, but in most cases not important

obsidian knoll
#

Final solution is

struct wifiCredStruct {
  char* ssid;
  char* password;
};

static const wifiCredStruct wifiCreds[] = {
  { "ssid1", "password1" },
  { "ssid2", "password2" },
  { "ssid3", "password3" }
};
  for (int i = 0; i < sizeof(wifiCreds) / sizeof(wifiCreds[0]); i++) {
    Serial.println(wifiCreds[i].ssid);
    Serial.println(wifiCreds[i].password);
  }
  Serial.println("CREDS DONE");

Output is

ssid1
password1
ssid2
password2
ssid3
password3
CREDS DONE
#

and that works :)

north stream
#

I would expect a pair of blank lines for {"", ""}

obsidian knoll
#

yes

north stream
#

If you deleted that entry, it would still work, but without the blank lines. I had only included that for the non-sizeof() approach

obsidian knoll
#

gotcha

tardy iron
#

putting static on a structure member doesn’t really make sense in C. (edit: it might actually not be allowed by spec.) in C++, struct is a different variant of class, so static means there’s one value shared among all instances of the class. i think that might explain the “too many initializers”

#

making the members const char * (no static) might work (edit: works), and might be a stronger hint to the compiler to put the strings in read-only data. forcing them into PROGMEM is a harder problem. Arduino has a hacky F() macro that might or might not work here

hexed mauve
#

Also, this design is using 15v AC, whereas mine is using 5v DC. So I've got some work to do lol

brisk chasm
#

can someone help me with code debugging I have two codes one with wifi and adafruit io support and one without and the one that uses wifi its touchscreen does not work while the one without its works perfectly, I have tried chatgpt and it does not help.

Here is the one with wifi:

here is the one without wifi:

hexed mauve
#

So, I'm realizing that the chip I intended to clock with the external oscillator has its own internal clock whose frequency is set by an RC pair at pin 15. Would it make more sense just to vary the current to that pin, rather than all this external oscillator business?

#

Again the goal here is to have 1v/octave control of pitch of the sounds this chip makes. I could have the Arduino measure a control voltage at one of the analog pins, then use PWM to a DAC to change the voltage at the MCRC pin. This would let me implement the 1v/octave response curve in software. Or is there something I'm missing here theory-wise?

tardy iron
hexed mauve
#

Looking now

#

Omg I can totally do this

#

I can't believe it was Right There.... lol

tardy iron
hexed mauve
#

Now I just need to pick a suitable DAC and I'm off to the races

tardy iron
hexed mauve
#

That's the trick with one volt per octave. The input voltage is linear, but the frequency output needs to be exponential. It should behave like this:

x = control voltage
y = frequency

x-3 = y/8
x-2 = y/4
x-1 = y/2
x+0 = y*1
x+1 = y*2
x+2 = y*4
x+3 = y*8

tardy iron
#

i still think that having one of the AVR timers generating the clock directly is easier. you can go up to half the CPU clock, depending on mode

#

(you’ll have to program the timer registers directly; Arduino PWM is too limited)

hexed mauve
#

I believe the Nano can do up to 8MHz, so half that frequency does cover the range I need. But can I adjust the rate of that timer on the fly && with high resolution? Fixed clock rate is a no-go, as it has to be modulated based on some input voltage. Also need to be able to add a freq offset for musical tuning and temp compensation

#

Also, can I get that timer output routed to a pin, or would I need to solder directly to the chip?

tardy iron
tardy iron
#

some drawbacks include doing low-level programming of the timer registers takes a lot of careful reading of the chip manual, and maybe writing a custom ISR to get the timer updates sequenced correctly

errant geode
#

Hello, i want to connect 5v relay module to pcf8574 expander, does anyone know how to do it properly? I connected it like regular pins, but relay doesn't change, i am powering pcf chip with 5v, i use multimeter to check voltage when set to high, and it shows about 4.5 v. when not connected to anything and about 2-3 v. when connected to realy. What can cause this voltage drop and how to fix it? I have no problem to controll realy wiht arduino's io pins, but can't do it with pcf8574's pins.

tardy iron
errant geode
#

I see that leds on relay module are turning on and off, but relay module itself doesn't work, it there a way to "boost" power or something?

hexed mauve
#

My first thought was that the relay itself might have some input resistance. If you measure the resistance across the relay pins and it's super low, that definitely narrows it down to an expander issue and you'll want to amplify the voltage to the relay. Or as argonblue says, use a different expander with more suitable characteristics for your application.

#

I'm not super familiar with the pcf8574 or the specific relay you're using, so probly take my advice with a grain of salt

tardy iron
tardy iron
#

adding a stronger external pullup to the PCF8574 output might be enough for your use case, but i can't say for sure without knowing more details

hexed mauve
#

Huh, I guess I could skip the external DAC step and use the Arduino's PWM output for the current injection part. Downside is the 8 bit limitation. A smoother curve is better for musical reasons

fair jasper
#

Yes, my plan is to use the ATtiny for several solenoids (digital), a brushed DC motor (PWM), and the servo (PWM). I got all working via the ATtiny but the servo. For the motor, I need to play with the frequency to make it start turning at a low speed (I’ll prob’ly end up gearing it anyway because a gentle start is inconsistent — seems to depend on the environment, like the temperature).

fair jasper
leaden walrus
#

firmware can be uploaded via arduino ide

#

once the USB cable is setup

#

start by just trying to upload a basic blink example

#

if you have the megatinycore installed in the arduino ide, that should be all you need

lethal yarrow
tender sinew
#

I just extended analog input of Arduino Uno using Multiplexer. I would like extend output pins as well.

#

I am using 74HC4051

#

I followed this tutorial to hook things up for the multiplexer that is used for extending inputs in Arduino Uno.

#

Here is my code.

#

What I am trying to do is "if Switch1 is on, blink LED1"

#

very simple

#

but I would like to have 8 input and 8 output

#

Can anyone help me setting up the Mux2 for this?

brisk chasm
#

how can this code snipped destory tocuh function "void connectToWiFi() {
wifiAttemptCount = 0;
while (wifiAttemptCount < maxWiFiAttempts && WiFi.status() != WL_CONNECTED) {
WiFi.begin(WIFI_SSID, WIFI_PASS);
Serial.println("Connecting to WiFi...");
delay(5000); // Delay 5 seconds before checking status
wifiAttemptCount++;
}
if (WiFi.status() != WL_CONNECTED) {
Serial.println("Failed to connect to WiFi. Continuing without internet.");
} else {
// Initialize Adafruit IO if connected to WiFi
io.connect();
while (io.status() < AIO_CONNECTED) {
Serial.println(io.statusText());
delay(500);
}
}
}"

fair jasper
# tender sinew I just extended analog input of Arduino Uno using Multiplexer. I would like exte...

It seems like it would be all the same except replace the analogRead calls with analogWrite, right? Am I missing something?

BUT I suggest you avoid using the same chip for both input and output of all 8 lines. Instead, use a second MUX chip. If you have only a single MUX in your design, split the 8 lines into an input-only group and an output-only group. Switching input/output dynamically means that you have to switch the Arduino’s pinMode at the exact same time as the MUX, and that means you might transition through a state when the Arduino OUTPUT is driving a line high at the same time the MUX OUTPUT is driving the same line low (is that a short circuit?)

fair jasper
brisk chasm
tender sinew
fair jasper
# brisk chasm cant I just use wifi.discconect(true). if it has not connected after 5 times

I’ve never done it, so I’m guessing that you have to be careful to set the pin mode as INPUT or INPUT_PULLDOWN when looking for Touch, and then set it to whatever WiFi wants (you have to look that up) when you try to connect to that. And allow a sufficient delay between the last time you use the pin and the switchover, so you are sure that the pin is not still in use.

Another way to do this is to get a second chip to process the touch events, like a Adafruit Cricket or similar, and then feed that signal in through a GPIO to the Arduino chip. That splits the features.

crimson crag
#

guess what i finally got working? heres the code for you folks : ''' #include "Adafruit_Crickit.h"
#include "seesaw_motor.h"

Adafruit_Crickit crickit;

seesaw_Motor motor_a(&crickit);
seesaw_Motor motor_b(&crickit);

void setup() {
Serial.begin(115200);
Serial.println("Dual motor demo!");

if(!crickit.begin()){
Serial.println("ERROR!");
while(1) delay(1);
}
else Serial.println("Crickit started");

//attach motor a
motor_a.attach(CRICKIT_MOTOR_A1, CRICKIT_MOTOR_A2);

//attach motor b
motor_b.attach(CRICKIT_MOTOR_B1, CRICKIT_MOTOR_B2);

}

void loop() {
crickit.analogWrite(CRICKIT_DRIVE1, CRICKIT_DUTY_CYCLE_MAX);
delay(500);
motor_a.throttle(1);
delay(5000);
motor_a.throttle(0);

crickit.analogWrite(CRICKIT_DRIVE1, CRICKIT_DUTY_CYCLE_OFF);
delay(500);
motor_b.throttle(1);
delay(5000);
motor_b.throttle(0);

crickit.analogWrite(CRICKIT_DRIVE1, CRICKIT_DUTY_CYCLE_MAX);

delay(1000);
}
'''

#

i need to upgrade to send the video but i promise it works now

fair jasper
# leaden walrus once the USB cable is setup

Ok, I get it: the examples ARE different releases of the firmware... I want the latest pid (BTW, pid 5690 is installed on both my ATtiny chips, so your theory about old firmware was right). And that’s where I should add CONFIG_PWM_16BIT, right?

UPDTE: it installs on the ATtiny… testing PWM now…

Couldn’t get ANY PWM output. I’m trying to change the example to specify PWM pins now, as well as enable the PWM function (which apparently is not done in the latest example — I don’t get that.)

brisk chasm
#

is there a io.disconnect like wifi.disconnect(true)

true nimbus
#

Question: i want to power a feather with one of the lipo battery packs, but i also want to turn it on and off with a switch... is there any easy way to do this without chopping off the connector from the battery and soldering wires together?

eternal cloud
#

unless your board has an enable pin

tardy iron
eternal cloud
true nimbus
#

i do have an enable pin, but yeah i want to turn it completely off, not using any power, unless switch is on

#

so if i have my lipo plugged into the battery socket, and i attach a switch between GND and EN, then that would do it?

tardy iron
tardy iron
true nimbus
#

seems to work!

#

and this isn't shorting out the battery or anything right?

eternal cloud
true nimbus
#

the only other thing i have connected to those pins is a music maker feather wing

#

which presumably isn't doing anything

tardy iron
true nimbus
fair jasper
# leaden walrus the seesaw firmware for the attiny's are all set up as arduino sketches under ex...

I can’t get example_pid5753 to do anything useful with Seesaw’s servo.write(angle) over I2C, on either ATtiny module (I updated both — mistake!). The oscilloscope shows zero signal. Previous firmware at least had a PWM-looking wave, even if the wave was wrong.

I’ll try modifying the example_pid5753 sketch — it looks like someone forgot to set CONFIG_PWM and CONFIG_PWM_16BIT, and some default PWM pins. I can’t find where those are supposed to be set; do you know?

I’d also like to enable debugging if I can figure that out — hopefully I can just call Serial.print?

final anvil
#
Could not find a valid BME280 sensor, check wiring, address, sensor ID!
SensorID was: 0x0
        ID of 0xFF probably means a bad address, a BMP 180 or BMP 085
   ID of 0x56-0x58 represents a BMP 280,
        ID of 0x60 represents a BME 280.
        ID of 0x61 represents a BME 680```
i have connected them cables as documented. how would i test that the sensor is faulty?
eternal cloud
final anvil
#

I’m using an Esp32-wroom board

#
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>

#define SEALEVELPRESSURE_HPA (1013.25)

Adafruit_BME280 bme; // Create a BME280 object

void setup() {
    Serial.begin(115200);
    while(!Serial);    // Wait until Serial is ready
    Serial.println(F("BME280 test"));

    // Initialize BME280 using GPIO21 (SDA) and GPIO22 (SCL)
    bool status = bme.begin(0x76, &Wire);  // You may need to change the address to match your sensor
    if (!status) {
        Serial.println("Could not find a valid BME280 sensor, check wiring, address, sensor ID!");
        Serial.print("SensorID was: 0x"); Serial.println(bme.sensorID(),16);
        Serial.print("        ID of 0xFF probably means a bad address, a BMP 180 or BMP 085\n");
        Serial.print("   ID of 0x56-0x58 represents a BMP 280,\n");
        Serial.print("        ID of 0x60 represents a BME 280.\n");
        Serial.print("        ID of 0x61 represents a BME 680.\n");
        while (1) delay(10);
    }

    Serial.println("-- Default Test --");
    delay(1000);
}

void loop() { 
    printValues();
    delay(1000); // Delay between readings
}

void printValues() {
    Serial.print("Temperature = ");
    Serial.print(bme.readTemperature());
    Serial.println(" °C");

    Serial.print("Pressure = ");
    Serial.print(bme.readPressure() / 100.0F);
    Serial.println(" hPa");

    Serial.print("Approx. Altitude = ");
    Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
    Serial.println(" m");

    Serial.print("Humidity = ");
    Serial.print(bme.readHumidity());
    Serial.println(" %");

    Serial.println();
}```
#

VCC -> 3.3V
GND -> GND
SCL-> GPIO22
SDA -> GPIO21
these are my connections

eternal cloud
royal jolt
#

Help, I am following this guide: https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/updating-firmware
For the Feather M0
When I get to the step: Then select the Updater tool built into the IDE
The item in the drop down is "Firmware Updater" and not "WiFi101 Firmware Updater"
Selecting the existing option returns the error "No supported board connected"

What should I do?

Adafruit Learning System

ARM Cortex M0+ with fast & fun wireless built in

eternal cloud
#

what firmware version do you have ?

you have a M0 feather, did you add the setPins() code described next?

fickle nest
#

Hello everyone, Good day. I need help with reading a characteristic's value,storing it and displaying it in the serial monitor of the arduino IDE. Can anyone help with this?

eternal cloud
orchid fossil
#

I'm looking for guidance based on the information provided by the Serprog project and GPIO documentation. Specifically, I'm interested in whether it's feasible to make an SPI flasher using the ESP32 without requiring a level shifter for 1.8V chips.

References:

Serprog project: https://github.com/thisiseth/esp32-serprog
ESP32 GPIO documentation: https://espeasy.readthedocs.io/en/lates ... /GPIO.html

According to the GPIO documentation:

`GPIO-12, when driven high, sets the flash voltage (VDD_SDIO) to 1.8V instead of the default 3.3V. It has an internal pull-down, so if left unconnected, it defaults to low (3.3V). This pin's high state may interfere with flashing or booting if a 3.3V flash is used, causing a flash brownout. Refer to the ESP32 datasheet for more details.
GPIO-15, when driven low, silences boot messages. `

I should mention that I'm not a programmer, nor am I particularly adept with electronics. However, I can handle software installations from GitHub and have some soldering experience. If it's possible, I'd appreciate guidance on how to do it.

GitHub

flashrom/serprog SPI programmer implementation for esp32 family - thisiseth/esp32-serprog

fickle nest
#

i added a service and characteristic to that service

#

well multiple characteristics

#

I'm sending a thermocouple's temperature to one characteristic

#

that one is working fine

#

the other one i'm sending a set point

#

its also working fine

#

right now the problem is with my 3rd characteristic

#

I want to be able to read values written to it by my app i built with MIT App Inventor

#

the user would write something in a text box and click the send button

#

after the send button is clicked

#

it will write what was in the text box into the characteristic

#

now the problem is reading that value and storing it in a buffer in the arduino IDE

#

I spent the whole day trying to figure it out

#

but i couldnt

royal jolt
eternal cloud
royal jolt
stable forge
royal jolt
eternal cloud
stable forge
dusk orchid
# brisk chasm is there a io.disconnect like wifi.disconnect(true)

Think you disconnect or close the connection of the mqtt client that you pass in. io will be in a disconnected state when next used as it checks the mqtt client status, so you io.connect again when needed (i think it reconnects the mqtt client then). Worth playing around with some of the examples in the library on github

pine bramble
#

Hello! I am using a feather RP2040 and arduino with Control_Surface library and I get "verify" errors when trying to use the pin names such as GPIO18 "GPIO18 not defined in this scope". frustrated and not able to find much info, I tried the circuit python pin names and got no errors!? but it was obviously not working as expected.. I also somehow got the idea to try D18 as a pin number and it also compiled without errors and ran identically glitchy to when I used the cp pin names... I feel like Im missing something big here, can anyone clue me in!!?? thanks!

eternal cloud
# pine bramble Hello! I am using a feather RP2040 and arduino with Control_Surface library and ...

https://learn.adafruit.com/adafruit-feather-rp2040-pico/arduino-usage

There is no pin remapping for Arduino on the RP2040. Therefore, the pin names on the top of the board are not the pin names used for Arduino. The Arduino pin names are the RP2040 GPIO pin names.

To find the Arduino pin name, check the PrettyPins diagram found on the Pinouts page. Each GPIO pin in the diagram has a GPIOx pin name listed, where x is the pin number. The Arduino pin name is the number following GPIO. For example, GPIO1 would be Arduino pin 1.

The Feather RP2040 has the GPIO pin names listed on the bottom of the board as GPx, where x is the pin number. The Arduino pin name is the number following GP. So, for example, pin GP0 would be Arduino pin 0.

pine bramble
eternal cloud
pine bramble
# eternal cloud try with **p**x instead of just x as pin number ?

yeah... I'm pretty stumped by the time I even got something reacting using D18 or SCK there is the Control_Surface library and Earl F. Philhower RP2040 board lib. involved in this mix as well, but I dont know enough about all this to know where to go next.. and I get the "not defined in this scope" error with p18

inland gorge
pine bramble
pine bramble
eternal cloud
#

can you test the pins on the feather with a simple sketch? maybe if you have a led or a button laying around to check that the basic functionality works?

inland gorge
pine bramble
inland gorge
#

I just tried this sketch for the Feather RP2040 and it compiles and works

void setup() {
  pinMode(18, OUTPUT);
}
void loop() {
  digitalWrite(18, HIGH);
  delay(1000);
  digitalWrite(18, LOW);
  delay(1000);
}
pine bramble
inland gorge
eternal cloud
pine bramble
pine bramble
inland gorge
pine bramble
inland gorge
inland gorge
# pine bramble this is very messy... "GPIO18" and "p18" would not compile... i got a "not defin...

In general, on the arduino-pico core, the pin number "18" and the pin define "D18" will be the same value. You can see that in the "generic.h" pin definition in the core: https://github.com/earlephilhower/arduino-pico/blob/master/variants/generic/common.h
Also if you look farther down, it looks like arduino-pico also creates defines for any default SPI and I2C bus (e.g. "SCK", "MOSI", "MISO") if one is defined for the board. And you can see at the bottom of the "pins_arduino.h" file for the Feather RP2040, it sets the RP2040's "spi0" peripheral to be the default SPI bus: https://github.com/earlephilhower/arduino-pico/blob/master/variants/adafruit_feather/pins_arduino.h

This means that SCK == D18 == 18 when passing in a pin to something like digitalWrite(). And of course, this means no other pin defines like "GPIO18" or "p18" will work. (That's not really a standard in Arduino)

pine bramble
#

im going to massively simplify everything on my end and start testing. it is a MIDI CC and note controller, and it shows up as a Midi device and sends CC messages... its just very spastic and glitchy.

lucid jackal
#

hello i need some help plz

#

i got a BNo08x 9Dof accelerometer and a ,96 in display from adafruit, its all connected to an esp32 s2 qtpy via i2c

#

for some reason its decided that it wont display anthing

twilit nexus
#

Anyone with experience using the Ivan Seidel arduino Linked List library potentially able to read some arduino code and help me figure out why I can't get LL node values to print to the serial monitor when iterating through the list?

eternal cloud
eternal cloud
twilit nexus
#

then, I am attempting to iterate through the list like so: Serial.print("updateMatrix called"); Node current = nodeList.get(0); //Serial.print("x: " + current.x); //Serial.print("y: " + current.y); //these both work but values in loop wont print // if (currentnext == null) { // Serial.println("No next node found"); //} //LOOP NOT WORKING CORREDCTLY while (current != null) { matrix.drawPixel(current.x, current.y, HIGH); Serial.print("x: " + current.x); Serial.print("y: " + current.y); current = current->next; // Move to the next node } matrix.write();

#

sorry for the formatting, how do you color/format text here again?

#

Anyways, the loop is not iterating past the first variable & im pretty sure theres something wonky with my next pointer in current= current.next I am coming from java and do not know all of the CPP pointer annotations

leaden walrus
eternal cloud
lucid jackal
#

u want me to send it

eternal cloud
fair jasper
leaden walrus
shrewd crag
#

I want to use a feather esp32 s3(item 5323) with an OLED feather wing 128x32 (item 2900) and use Arduino. I see that the primary guide page says "Arduino coning soon". What does that mean?

#

I have to run and make dinner, so I'll have to see the reponse later. Thanks in advance!!

shrewd crag
eternal cloud
next parrot
#

HEy all, sorry for bothering you guys, I'm having a issue here using a 8x8 matrix. I'm using a esp32 wroom devkit and I'm just testing the matrix by lighting up 1 led at a time. The problem is that the matrix.show() is lighting up all leds every 2nd time it is executed.

#

My code is very simple, I just use this

next parrot
#

You mean this?

next parrot
#

I tryed to remove the clear function just to test, but it still lights up all leds every 2nd "show"

eternal cloud
next parrot
#

And thanks for helping titicr2Chopper

surreal pawn
next parrot
#

got other things on it to write logs to a oled

#

Going to try the fastled lib

#

FastLed works fine

eternal cloud
# next parrot FastLed works fine

I see... I'm not familiar enough with the Adafruit_NeoMatrix library to dig through all the bitmasks atm, lol, but glad the FastLed lib is working!

stable forge
#

thanks for pointing that out

eternal cloud
stable forge
#

The feedback link is still the best place, but which guide is it?

leaden walrus
eternal cloud
stable forge
next parrot
fair jasper
crisp hinge
#

hello, my esp32 manages a relay which cuts power to the electric strike. the problem is that this cut completely disrupts my LCD screen on which strange characters appear. the electric strike has a power supply separate from the screen. Do you have any idea ?

north stream
#

The relay itself is an inductive load, so when power to it is turned off, it can create a voltage spike to the control circuitry. The usual ways of dealing with this are either a flyback diode or snubber network to absorb/dissipate the voltage spike.

crisp hinge
#

Oh ok, which flyback diode should I use ? The power driver is 220v to 12v and then after there is a regulator which tranform the 12v to 5v which powers the LCD screen

north stream
#

Popular choices are a 1N4001 or zener diode, depending on the coil voltage of the relay

crisp hinge
#

The coil voltage of the relay is 5V

#

So Zener diode ?

north stream
#

A zener like a 1N4735 would serve well, but if you have an ordinary 1N4001 around, that would probably work too

#

The advantage to a zener is it absorbs both reverse voltage spikes and overvoltage spikes. 1N4734 would give slightly better protection than 1N4735, either is good, it mostly depends on what's available to you.

crisp hinge
#

I will buy the best option, so the 1N4734 right ?

#

Can you confirm that you talk about 2 separate things, the 1N4734 and the zener diode

#

and 1N4734 > zener in my case

#

The thing is, I don’t have this problem on another installation that has exactly the same circuit. The only difference is that the cable passes through a steel tube for the door.

north stream
#

The 1N4734 is a zener diode

#

Voltage spikes are weird things, sometimes they're enough to interfere with other circuitry, sometimes they aren't. And the interference can be coupled in various ways (conduction, radiation, induction, capacitance, etc.) Makes it tricky to debug. My usual approach is to try to avoid the spikes the first place.

crisp hinge
#

Between the regulator and the ttgo ? Or between the regulator and the lcd screen ? Or between the relay and the electric strike ?

#

By the way, when we cut off the power to the electric strike with a key switch, the problem does not appear. Does this confirm your suggestion?

north stream
#

It would seem to, since it would imply that the problem is caused by the relay itself, not the strike or its power

crisp hinge
north stream
crisp hinge
#

Ok, I’ll let you know, thanks !

stable forge
crisp hinge
north stream
#

You don't care to share it here?

crisp hinge
#

I would prefer to send it in private message, but we can keep on with the discussion here

crisp hinge
#

I sent it, if you have any idea I am interested, thank you very much

fair jasper
fair jasper
# leaden walrus well, might be worth double checking what you're working with. i'm assuming it's...

So no joy yet. I tested all the output pins and nothing resembling a PWM's voltage is seen on the scope. I uploaded the 5690 example, and checked that it arrived via a sketch on an ESP32 that just queries the PID over I2C returns '5690' and the right date. The uploader had no errors, so the next step, I guess, is to debug the ATtiny? Unless you have other ideas?

I added a pin like this, but changed no other line:

// Can have up to 3 addresses
#define CONFIG_ADDR_0_PIN          12
#define CONFIG_ADDR_1_PIN          13
#define CONFIG_ADDR_2_PIN          14
leaden walrus
#
#define PIN 7
void setup() {
  pinMode(PIN, OUTPUT);
}

void loop() {
  digitalWrite(PIN, HIGH);
  delay(500);
  digitalWrite(PIN, LOW);
  delay(500);
}
#

change pin as needed

fair jasper
fair jasper
leaden walrus
#

cool. so basic uploading is working.

leaden walrus
#

now try your sketch again to verify you can connect and talk to the seesaw. whatever you did here:

via a sketch on an ESP32 that just queries the PID over I2C returns '5690' and the right date.

fair jasper
# leaden walrus now try your sketch again to verify you can connect and talk to the seesaw. what...

attiny.begin returns 0. It never responds to the I2C startup.

I had to switch to the ATtiny module that is soldered to the ESP circuit, so as a sanity check I repeated the LED upload on this chip (worked), and then uploaded the full peripheral code. And then the sketch to the ESP. There are other chips on the board that share power but I disconnected all their I2C QT sockets. I'm going to switch to the ATtiny's other QT port, to test if the first port went bad,

#

[same for the other QT port - zero from attiny.begin()]

leaden walrus
#

sounds like you have something custom going on? suggest working with the breakout before moving to a custom PCB (or whatever the ESP circuit is)

#

try an I2C scan maybe?

#

what board are you using to connect to the seesaw?

fair jasper
#

no PCB. Just a breadboard for the ESP32 connected to a hard-wired board of motor drivers and the ATtiny.

The ATtiny is getting power over Stemma QT, and has pins 0 & 1 connected to MOSFET motor drivers. Pin 11 is connected to a servo motor input. I can cut the 3 signal wires (they're just wire-wrapped), if you think that will isolate the ATtiny.

IIRC, this wiring worked for everything but the servo, just before I updated to the peripheral sketch that added 16-bit PWM.

leaden walrus
#

the default firmware won't work for a servo. but should be able to see some form of PWM output.

#

are you basing success on the servo/motor behavior? or are you able to scope the output pins?

fair jasper
#

I'll scope it now... hold on...

#

hmm, if I can't see the ATtiny over I2C, there's nothing to check ont he scope... I think the first thing to check is an I2C scan. right?

leaden walrus
#

yep. i2c scan is simple good sanity check.

fair jasper
#

ok, trying an I2C scan...

#

No I2C devices found

leaden walrus
#

try re-uploading the firmware

#

one other detail - be sure to set the clock to 10Mhz if powering via 3.3V

#

it's an option in the arduino ide

fair jasper
#

i've got 5v.

leaden walrus
#

ok. default 20MHz should be fine.

#

but not sure why it's not showing up in i2c scan

#
Scanning...
I2C device found at address 0x49  !
done

Scanning...
I2C device found at address 0x49  !
done

Scanning...
I2C device found at address 0x49  !
done
#

that's what i'm getting running an i2c scan on a qt py m0

#

note that if you are powering via the STEMMA QT connector, the ATTiny will be powered at 3.3V.

#

there's a voltage regulator on the breakout

fair jasper
#

ok, I'll change the clock to 10

#

That's weird. This error is not highlighted in red:
pymcuprog.serialupdi.link - WARNING - UPDI init failed: Can't read CS register.

leaden walrus
#

it's a warning. not an error.