#help-with-arduino
1 messages · Page 15 of 1
Hello , sorry if i am wrong here 🙂
I have a Arduino UNO R4 Wifi and would like connect the Adafruit Sensor DSP310 on the second Wire1 Port via QWICC.
For this sensor i use the #include <Adafruit_DPS310.h> Library.
But i dont know how can change the Port , any idea how can do this ?
My Code https://git.unixweb.net/joachim/arduino-uno-r4-wifi/src/branch/main/mqtt-wifi-dsp310-sensor/dsp310.ino
At the moment i am using the First "Wire" Port . Thanks a lot ...
The begin_I2C() method accepts optional arguments for an I2C address, and a Wire object.
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 ?
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
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.
here's where that call happens:
https://github.com/adafruit/Adafruit_BusIO/blob/fc25cd496702d45cf63b86b3b87b870e761a126b/Adafruit_I2CDevice.cpp#L31
it's called indirectly from the DPS310 library here:
https://github.com/adafruit/Adafruit_DPS310/blob/26e2cacc531a8763e8a5dfb9b59f1646180fb59b/Adafruit_DPS310.cpp#L73
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.
Ouch. That's pretty rough.
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
Makes sense to me, I've bought stuff for similar reasons
It works now ... many thanks for help
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
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
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
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
Got it thank you
Hoping for a hand setting up doxygen for arduino. I am following https://www.woolseyworkshop.com/2020/03/20/documenting-arduino-sketches-with-doxygen/ but the output I'm getting is different from the author
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
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
I think if you press reset twice to put it in bootloader mode, the Arduino IDE can talk to it
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
which boards?
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.
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
Also check that "programmer" is set correctly, so it's using the right protocol for the one you're trying to talk to.
The ide recognizes it, but windows doesn't. And the debugger says it can't find it.
And the code I put on doesn't work.
I tried putting on the blinky script, and it won't run
Is it possible that by upgrading the bootloader I messed up the board?
if you double-click, does a BOOT drive show up, an does the red LED pulse slowly?
If I double click on the icon in the devices menu (like where flash drives show up) then I can see a .txt file with the boot info, I think. I'm very new to this and not sure
The red power LED is pulsing slowly
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?
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
i mean the name as given in BOOT_INFO.TXT
By the way, thank you for responding @stable forge
The name is correct in the .txt file
Try cleaning out the board when it's not plugged in: https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#device-errors-or-problems-on-windows-3094694
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?
No, directly to the laptop
I believe it's the newest version of Arduino ide
i'll try this on windows with a CPB
I can upload. Here's a screenshot of the Tools menu and you can also see the upload message. Could you give a similar screenshot?
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
i don't know, this is my first time using arduino to load code. i used to only use circuit python.
my main issue, is the program is not running. my neopixels arent flashing
ok, just use the middle button (the plain right arrow), not the right button (debugging uploading)
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)
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?
I uploaded that exact script to my CPB, and it's working.
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
i just downloaded the Adafruit CircuitPLayground Library in the sketch manager, and it's working. i wonder if that was it
should not make a difference. Are your Board Support Packages up to date? (but that shouldn't really matter)
maybe it was not really uploaded due to the previous problems, or got overwritten temporarily
i don't know, it's the only thing i did differently
any lingering issues? Feel free to post later about something
wait, i didn't give you accurate info.
i tried this script https://learn.adafruit.com/circuit-playground-bike-light/basic-neopixel-animation
which worked.
but i tried the above again, and it;s not working, and no error messages
the above meaning the toggle Arduino sketch? Not sure why. You could try the non-toggle (on/off) sketch in Examples->Basic->Blink, but it should be the same.
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
Have you checked your device Manager to see what port the board has been assigned to ? Whatever port Windows says it is, that is the one you want your script and/or the IDE to use. Hope this helps.
Also make sure you are using the right libraries based on the Card you're using.
Does anyone know if Adafruit (or anyone) sells a JST lipo charger with reversible/switchable polarity?
I think we would not do this because the consequences of the the polarity being wrong would be catastrophic
yes, it's the right port. when i load the Adafruit script it works, when i load the blinky script, it doesn't
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.
probably, i'm very new to this.
which one would you recommend?
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
could you please post the code you are using?
@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
Could you show a photo of the other side of the NeoPixel "button", with the connections still intact, so we can check the wiring
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
}
}
are there two pads each for power and ground on the LED board? make sure the Dout pin isn’t shorted to +
It looks to me like ground on the NeoPixel button is connected to A0 instead of to G (ground)
that’s parallax
that's just parallax, and the itsy is offset by one row
i'd suspect something with soldering on the button
Yes I noticed it on my really bad soldering picture too and then went immediately checking this - they are good, not connected! stil confusing.
i would redo all the solder joints, just to be sure. solder bridges can sometimes be hard to see
If you guys didn't see anything obvious wrong, then it must be my bad soldering 😞 my first job and I didn't know I need flux. Will try soldering another new pixel board when I got flux delivered!
I used a multimeter to check the connection. So I believe the connection might be good, but my excessively long soldering time could be destroying the led with heat..?
are you using solder without flux?
Now I'm really embarrassed!
common solder wire spool typically have flux (rosin core), but not all
we’re all beginners at some point
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?
Yes I do
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
Thanks for all the advices!
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
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
are you moving something solid (like a hand) in front of it?
yes at various distances
are the other values changing at all?
Proximity:18
Ambient light:20
Raw white light:30
yes they change as expected
weird. can you post a photo of the setup.
oh, a custom build
fwiw, the adafruit breakout schematic is here:
https://learn.adafruit.com/adafruit-vcnl4040-proximity-sensor/downloads
try using your phone camera to see if the xmitter light is on
anode not connected?
could bodge that as a quick fix
yes that was it
what was i thinking when designing the board??? Anode? naaah that's overrated
there's already two cathodes. should be enough 🙂
well thanks
https://learn.adafruit.com/adafruit-ov5640-camera-breakout?view=all#pinouts
Do I need to connect all the 8 data pins of the camera (CAMERA_DATA)?
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.
Yes. What are you connecting it to and since you posed this in the Arduino channel, I'm curious what library you are planning to use?
It should work with Arduino, since it's using this chip to connect to the ras pi through I2C https://www.adafruit.com/product/732
and there is an Arduino library for it https://github.com/adafruit/Adafruit-MCP23017-Arduino-Library
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
Good tip, will test that as well, thanks :)
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?
A Feather board without ambition is a Feather board without FeatherWings! Spice up your Feather project with a beautiful 2.4" touchscreen display shield with built in microSD card ...
sorry, I'm connecting it to an esp32, using circuitpython
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
Ah -- I have gotten it to work with a feather esp32s3 (one pin to spare)
Turn out if you turn off the power supply the coin acceptor forgets the sampling, does anyone know how to fix that?
did you do everything on this page https://learn.adafruit.com/adafruit-2-4-tft-touch-screen-featherwing/tft-graphics-test ?
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
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.
github with my code: https://github.com/adam567890/lava/blob/main/sketch_feb14a.ino
I don't see that you are calling Wire.begin() and Wire1.begin() at the top of setup(). I thought .begin() was necessary. But my experience is with CircuitPython, and not with Teensyduino.
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
so you're saying the Adafruit example works fine, but after adding the TCS code, using Wire1, the sensors no longer return valid data?
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
it it clear that the two VL53L0X devices are actually both in use and returning different data?
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
and you can cover one and get different data from it and vice vesa?
when the color sensor call is commented out, yes
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?
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
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?
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
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
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
also could try one VL53 on Wire and one on Wire1
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
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
You sound pretty experienced, but you could show us photos of your connections to the STEMMA/QT cable, the shutdown pins on the VL53 sensors and to the TLC sensor
I know nothing about this device, but the manual has very particular instructions for setting it up. perhaps you turned off the power before setup was complete? this looks like the kind of device where the setup is a little obtuse and must be followed exactly or everything goes to pot.
https://malangelectronic.com/wp-content/uploads/2013/06/CH-926_multi_coin_selector.pdf
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.
ding ding
Ping out of nowhere on a 3 month old message 😬
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.
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 😁
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
May be a good idea to @ them
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
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
It is different enough: https://forum.arduino.cc/t/adding-support-for-at-samr21g18a/1229444
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?
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 😅
Hi guys
Im trying to applied this configuration
To my arduino nano
Connect
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?
I checked connuity and it is connected to gnd
could be some other connection. can you post photo of setup.
its the example code menu command
yes
is the nano in the terminal block adapter orientated correctly? the labels are swapped
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?
the library should be taking care of any of that if needed
in terms of serial coms to the audio fx board
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
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).
can i use software serial and just use pins listed above?
does TX have any limitations?
shouldn't. issue is with handling incoming data. outgoing is easier.
thank you i got it working on my mega using the hardware serial1
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");
}```
is this okay to post code?
yes -- more here <#welcome message>
I also tried using a 16x4 LCD with I2C and it doesnt work with the sound board fx code
Are you trying to load the arduino code ON the sound fx board ?
It would be helpful to elaborate on "it does not work" -- error messages?
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
So, it works with the LCD connected to the mega separately? And with sound fx over serial separately?
but not when both are connected ?
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
Serial1 needs to work on 115200 to communicate with the sound board
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?
Do you also have the Adafruit GFX library installed ?
Yes:
And Adafruit_BusIO ? Just to make sure all dependencies installed correctly
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.
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
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.
So does something like this https://www.amazon.co.uk/Development-Compatible-Management-Alternative-Accessories/dp/B0CLLM1JBN provide 2.4 GHz. I am guessing based of the name.
I'm sorry if this seems like beginner level questions but I simply do not yet know what to purchase.
I've purchased this https://flowduino.com/2021/08/24/arduino-nano-r3-nrf24l01-rf-nano/ but it has no bluetooth support and I'm also wondering how I'd connect up the battery - there is no documentation on how to do so.
@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.
Thanks for the link!
So I am sort of confused ... how do keyboard and mouses communicate over 2.4 GHz? If you happen to know a device that will allow me to capture packets being sent by a keyboard or mouse, I'm happy to look at it. as I might probably need it later,
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.
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
If I'm understanding this right, you want to build a 2.4 GHz keyboard, not a bluetooth one?
Then you don't need a BLE capable MCU, but you will need 2 boards that communicate to each other - with the NRF24L01 chip (?) - the nRF52840 documentation says something about proprietary only protocol over the 2.4 tranciever 🤷♀️
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.
I'd like for it to work with both 2.4 GHz and bluetooth, like typical keyboards work - there is a switch that you move to turn it into the mode you want.
nRF52840 documentation is lacking as I cannot find any documentation on how to even start programming with the propriety only protocol.
Thanks for the feedback, BTW.
Thanks for the feedback, BTW
Sure, sorry I don't have more capable answers, haha, I'm trying to figure out as I go myself (I just got caught in wifi keyboard rabbit hole now 😆 )
Bluetooth is 2.4GHz, last i checked. are you wanting them to talk a specific proprietary 2.4GHz protocol like Logitech?
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.
Also installed
The way I see it, you don't need some proprietary protocol, just 2 arduino boards communicating to each other https://howtomechatronics.com/tutorials/arduino/arduino-wireless-communication-nrf24l01-tutorial/
That's a very good link you just sent. Thanks a lot.
You register the keys on one board, and send them to the usb "dongle" board, that does the HID calls on PC
nRF has its own proprietary 2.4GHz protocol, too. but i think you have to pay a license fee to enable it
to sniff a 2.4GHz protocol, you probably want something like a SDR that can receive in that band. unfortunately, it seems like the readily available ones don’t, and will need a down-converter
If you use something like the feather nRF52840 + NRF24L01 over SPI in the keyboard, you might be able to switch between connection types (BLE vs the other NRF24L01) in the same code 🤔
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.
Also are there any Arduinos with dual USB type C ports? Like this, https://www.amazon.co.uk/DollaTek-ESP32-S3-DevKitC-1-ESP32-S3-Bluetooth-compatible-Development/dp/B0BVQLW2S6, ?
No idea, sorry
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 🤷♀️
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); ?
thank you @leaden walrus
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?
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',
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
Are you using Bluetooth in UART mode or what?
hm, maybe im not sure what you're asking. im using the UART pins on the bluefruit yes.
https://learn.sparkfun.com/tutorials/bluetooth-basics/all What's often referred to as SSP or Bluetooth serial, is effectively UART over bluetooth. Each device declares what kind of protocols / service / characteristics it supports. They can be custom, or standard types.
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
Could be a speed difference, maybe try setting your receiver to 9600bps, 19200bps, or 115200bps?
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
https://cdn-learn.adafruit.com/assets/assets/000/047/156/large1024/circuit_playground_Adafruit_Circuit_Playground_Express_Pinout.png?1507829017 << What "pin" is the slide switch if I choose to use the arduino IDE but do not import adafruit_circuitplayground.h ?
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
Which pins is I2C running on? Because if it’s any of pins 26..41 pins, you’re also using that for the sound inputs. That would explain why it works individually — you are using each pin for only 1 purpose.
Did you ever delete any of the dependent lib’s, then reinstall it? The IDE is really stupid about that… you have to delete the corresponding folder to enable it to reinstall, and it gets confused and says it reinstalled, but it really didn’t.
Why do you have 2 servo lib’s installed? Could you delete the one you’re not using in the code? One thing I find very confusing is that there are a number of competing lib’s that all do the same thing, and keeping track of which one I used for each project is overly complicated. It’s like the Arduino IDE was built to compile only 1 sketch at a time.
i think should be D7 (or just 7).
you can't, but you can download CURRENT.UF2 from the bootloader, and that is everything in the flash.
you can also find uf2conv.py in the uf2 repo which will convert .bin to .uf2
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👍🏽
you're welcome!
btw, also listed on the Pinouts page: https://learn.adafruit.com/adafruit-circuit-playground-express/pinouts#internally-used-pins-2906291
@stable forge https://paste.rs/Bdx6y.cpp
paste.rs is a simple, no-frills,
command-line driven pastebin service powered by the Rocket web
framework.
Is that expected to run? Or do I need "D7" instead of just 7?
so it's not working?
I'm currently without MCU to test with
hold on....
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
paste.rs is a simple, no-frills,
command-line driven pastebin service powered by the Rocket web
framework.
plan is to run them both on the circuitplayground express and then compare/contrast the results with something like this clicker test: https://clickspeedtest.com/
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
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
??
7, not D7, and set a a pullup.
aah, thanks for that, missed the pullup
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)
gotcha, so if I just :%s/INPUT/INPUT_PULLUP/g I'm good with my originally pasted script?
yes
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?"
to do the clickspeed tests
the blink "else" statement was just to declare to me that the MCU had completed it's program
my guess is that even if there is no difference people will complain that there is
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
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
actually we are!
Folks with disabilities want to click on heads with the rest of them!
This library has a Mouse.click(), so I think it will be easy to code up in Arduino: https://www.arduino.cc/reference/en/libraries/hid-project/
woah
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
There are a few ways to trigger a reset with AVR. One of the easier methods is likely to trigger an unused interrupt.
one is the default Servo.h and the other is servoESP32 since im using esp32 for my project
I’m guessing that the ESP32 version is the only one you need. Delete the other one (you can always reinstall). My reasoning is that if your ESP has onboard timers for the PWM signal, that lib will set the PWM timer frequency to 50 hz whereas the non-ESP will time the signals in software, which takes processor attention and is slightly unreliable (ex, interrupts).
Which chip/board are you using? You can trigger a reset via software but it depends on the chip you're using. But most use a built-in feature of the chip called a "watchdog". If you're using a RP2040 / Pico, you can use rp2040.wdt_begin(15) to trigger the watchdog to reset the board after 15 milliseconds
aah, that would work.
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
Yes, you can use Adafruit_SleepyDog I think then: https://github.com/adafruit/Adafruit_SleepyDog (it's in the Library Manager)
Thanks!
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.
i did and it showed more errors that time
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
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?
you can try using the “reliable datagram “ mode to improve the reliability.
@odd fjord You're the goat
More messages about duplicate servo libs? Or something else? It’s easier to help if you give details.
im not sure what it was but i recently deleted the code lmo
my bad
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
could try the arm developer hub, or their discord, they've got the expertise to answer revision based questions
https://discord.com/invite/armsoftwaredev
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)
They would not change regjster maps on a hw rev. But if you can document the various issues, that would be very helpful. File issues for them in our SAMD board support repo: https://github.com/adafruit/ArduinoCore-samd/
@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
the crash is rev D or rev F?
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
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!
Maybe this step will help https://github.com/sandeepmistry/arduino-nRF5/?tab=readme-ov-file#linux
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;
Which web app? What board and sensors?
Full code (posted like this #welcome message ) and general project details are useful when asking for help.
Does someone know can i use micropython/circuitpython (preferably circuit) on my arduino uno?
It is a r3 if it helps
it's not possible. uno is not powerful enough.
There is https://github.com/keith-packard/snek if you have no other choice of boards.
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.
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
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
}
hard to tell from the angle of the picture, but it looks like the displays "VDD" pin is plugged into the REF pin. For that Arduino, it should be plugged into the "5V" pin
What boards are these? Do you have any documentation?
And please post your code like #welcome message
please post code like this #welcome message
thanks new to this
@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);
}```
are there resources available online that have examples of the code in arduino? i know i have to use seesaw library and im using the motor pins on crickit
Hmm, most of the Crickit guides and examples seem to be in either circuitpython or makecode, but this should be enough to get you going https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-construction-kit/arduino-dc-motors-2
thanks
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);
}
Looks like you forgot to power your crickit board 
https://learn.adafruit.com/adafruit-crickit-creative-robotic-interactive-construction-kit/powering-crickit
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
what errors are you getting exactly?
i'll send you a screenshot of my serial monitor
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?
I think so, if i remove some wires then the serial monitor will print: "Failed to start sensor! Please check your wiring."
if you could take some pictures from above, where the connections and pin numbers are clearly visible, that would help to double check 🙂
I used this as a tutorial: https://cdn-learn.adafruit.com/downloads/pdf/adafruit-ccs811-air-quality-sensor.pdf
i'll send the image in a minute
here are the images
looks okay, unless this sensor board has some quirky stuff (it's the aliexpress one? )
no, i bought it from a local store (OKAPHONE)
i don't know where they got it
it last i might buy a new one and hope that that works
did it come with any documentation?
https://www.okaphone.com/artikel.asp?id=493547
Its not in english so you might need to tranlsate it
this is the link, the owners of the store sended me the link i sended earlier (https://cdn-learn.adafruit.com/downloads/pdf/adafruit-ccs811-air-quality-sensor.pdf)
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
the arduino uno only support 3.3V, is that fine too>
yea, 3.3
it still has the same result
maby the module itself doesn't work
Do you think that this would be a better alternative; https://www.okaphone.com/artikel.asp?id=493397
I'm not sure ... 🫤
This looks like the board made by Adafruit, so I would think so
But do you have no other ideas that might could help?
Not for this, the code is just the example, so it looks fine, the wiring seems ok too.
You could wait a bit and see if anyone else sees something we missed, or knows of a way to test the sensor
or if you have another board
i think i am just going to buy the other sensor (https://www.okaphone.com/artikel.asp?id=493397)
i unfortunately don't have another board
Even better if you'd have one that supports CircuitPython, you could test it with that
Well i have also other wires and programms on the arduino (soldered), the CO2 sensor just stopped working and i rewired everything, so that i could check if the sensor just doesn't work or if the soldering broke
The power wiring looks suspicious. It looks like the 5V is connected to something, but I'm not sure what. The Arduino may not read 3.3V pulled up I2C lines that well. Do you have a 3.3V board to test with?
If it was working and it stopped, did you accidentally connect 5V to it?
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.
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?
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.
i need the microcontroller for another purpose
ill try this out in a sec
also note that analogWrite is not really analog, it's PWM, usually at around 500 Hz, which is way lower than you want. An UNO-style ATmega328 Arduino (like the Nano) does not have true analog output
other boards have a true DAC output, but ATmega328 does not. See https://www.arduino.cc/reference/en/language/functions/analog-io/analogwrite/ and see the ** and *** footnotes.
it will work for really low-frequency audio
maybe i should add some filters to it?
i dont know why its also making that high pitched noise lmo
the analogWrite is not going to work, based on the PWM rate
that's the PWM. It's not true analog, like I said
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
how much do i need
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?
Think of the project as something like a walkie talkie
Im pretty sure 900hz is possible on the nano
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
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
lol thanks
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
Well, this is... vague, lol.
You are more likely to get some help when you describe what your goal is, what the hardware is, add pics of the wiring when relevant, where are you stuck, what errors you encounter... and then go back and finish your own code.
Ah ok 👍
Sorry about that
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.
"the thing" ? what sort of signal? send it to where? 😅
A blue tooth signal to a phone from the devices serial monitor.
do you have a bluetooth capable peripheral connected to the UNO?
Hello and good day, I would like to know if AdafruitIO (Adafruit's IoT cloud service) supports STM32duino?
@magic idol you might be able to improve output quality with an R-2R resistor ladder DAC? this was the tech for the '80s Covox Speech Thing or Disney Sound Source printer port audio devices. there are a number of search hits for "arduino R-2R DAC" or "arduino resistor ladder DAC", like:
https://www.digikey.com/en/maker/tutorials/2022/how-to-build-a-simple-r-2r-dac-shield-for-the-arduino-uno
https://www.hackster.io/boris-leonov/generating-audio-with-an-arduino-and-a-resistor-ladder-dac-d5a6b1
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.
thanks for these, ill try them out when i eventually return to the project
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.
@fresh idol what board? are you using the default I2C pins?
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.
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
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.
All i have is 4 Arduino UNO R3's
Also sorry for responding so late
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
if you ordered the product from the other link, it should be fine working with uno r3, Adafruit sensor boards are 5V tolerant
I have a STM32 Nucleo Board that is wired to a ATWINC1500 breakout board on a breadboard, I want to use it with the Adafruit IO is this possible? as I dont see adafruit talk about only using the ATWINC1500. instead its with boards that have the atwinc1500 built on to them like one of the feathers.
I did manage to get it to work with the mqtt example, but the adafruit IO examples dont seem to work for some reason
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.
Ok, I worked it out, file spacing. Good times!
Like Tyeth said, Adafruit IO is hardware independent, so yea, it should work.
It doesn't matter how the ATWINC1500 is connected, as long as you wired it correctly, and you can use it to communicate over wifi.
Make sure you set up your Adafruit IO login credentials correctly, and check out the getting started guides https://learn.adafruit.com/series/adafruit-io-basics
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
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.
There should be an expressiton that will be True or False in the paretheses for the while statement while (x>7) or if you want it to run forever while(True)
It is not clear why you are using while statments there at all
ok, i'll try that. thank you for the help ^^
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.
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
You'll likely get more help/tips if you post the entire code -- see this message for instructions on how to post code here <#welcome message> screenshots are not recommended.
ah ok, sorry about that
No problem. Posting actual code allows the helpers to cut/paste examples and suggetions. Screenshots can be hard to red.
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.
do the pumps not work like you want them to, or they don't start at all ?
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)
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
oh right lol i forgot about that. can you tell me more abt the value associated with the throttle command? is 1 the max flowrate it can reach (i believe its 2.5 LPM) and anything below is variable?
any value between 0 and 1 is speed in one direction for DC motors, and 0 to -1 is reverse direction
but these pumps don't reverse, so just pick an interval
thanks i really appreciate your help
Sure!
I hope you get it working soon!
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
i gotchu im working on it rnrn
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.
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.
Could you please open an issue about this in https://github.com/adafruit/ArduinoCore-samd ? Thanks. We'd be interested in new behavior, and figuring out if there's a workaround. I don't know if we have started rev F chips yet (whether we've been shipped any). I will ask. Have you brought it up with MicroChip?
I was going to suggest raising this in their forums, but I see that you just did: https://forum.microchip.com/s/topic/a5CV40000000b1BMAQ/t394578. Post that link in the issue as well. And I would suggest you open a support case with them as well: https://microchip.my.site.com/s/newcase
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
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
@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:
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"
add some prints in setup to see if the sensor starts correctly, or it just hangs there
sure, i will add more prints to the code
after begin, like : "sensor started" and after while: "data available"
i have a feeling it gets stuck on that while
this is what it prints
so it doesn't even get out of ccs.begin()? but doesn't error either... huh..
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.
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
i'll ping you when i am done, ok?
it seems weird that it doesn't begin the sensor, so an unstable connection might be the cause
sure
yoo it works
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)
i
does it matter that much? the tutorial says 3 to 5V?
Connect Vin (red wire on STEMMA QT version) to the power supply, 3-5V is fine. **Use the same voltage that the microcontroller logic is based off of. **For most Arduinos, that is 5V
alright
long term it will matter, you can get errors since the reference is not the same
but yaaay! it works!
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?
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
try to put it next to an open window for a while, for baseline measurements of CO2
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!
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
you didn't post your code, but could it be something like this: https://github.com/espressif/esp-idf/issues/9782#issuecomment-1426827903
Not sure but I binned my code and just trying to get the LED to blink
OK, I will try this. Thank you! 😉 😄
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
The main issue I've encountered is if the sketch is programmed to use PSRAM and the board doesn't have it, I think it will boot loop. It could be esphome is designed to either not need PSRAM or have a check for it
Good shout. will add to the list of checks 🙂
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
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.
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.
That sounds like DVI-I more than HDMI
That would have made sense. Alas, it was definitely HDMI.
I found a bug in a Seesaw lib where it incorrectly assumes a chip arch. How do I report it to AdaFruit?
create an issue in the repository https://github.com/adafruit/Adafruit_Seesaw
Done. Thanks.
—> 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.
@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.
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.
do you need to use that chip specifically? i’m pretty sure there are linear voltage-to-frequency converters
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.
what model of Arduino? AVR can do logarithms with the math library, but painfully slowly. you might manage with a lookup table though
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.
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
I will def look into that, thanks! I'm still curious about converting the linear input to a logarithmic output though
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
oh, to clarify, you put the lookup table in PROGMEM so it only takes up flash, not RAM
what the heck is NAMELENMAX+1
https://forum.arduino.cc/t/2-element-array/453863
it shows up here too
HOw can I set up an array with the following key, value pairs. {123, "Bob"},{345,"Harry"},{234,"Sue"}; I want to be able to read the array, compare the id to a variable and if match display the name . My code attempt so far is: char myArray[][2] = { {123,"Bob"}, {345,"Harry"}, {234,"Sue"}, }; void setup() { // put your setup code here, to ...
In the second link you shared, when they define char value[NAMELENMAX+1], they're saying
- create an array
- of data type "char"
- named "value"
- 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.
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?
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
The arduino community in general is extremely toxic
C and C++ can implicitly size a simple character array. an array has to have a constant element size, though. if you want an array of other arrays (or structures), only the outermost array can have an implicit size
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
Neat
For context, I'm trying to store ssid:password combos
They are never changed after flashing
5 octaves is a lot of range. While there are linear-to-logarithmic converters, it might work better to electronically swap components to change ranges, and then tune within the ranges. You might also look at other tunable oscillators. The LM331 is an old school approach, but so is the 4046. There are also digital approaches like PLLs and programmable oscillators/dividers.
argonblue is right, this is normally done with pointers. Here's the way I generally approach it: ```arduino
struct kv {
int key;
static const char * value;
};
static const struct kv passwords[] = {
{ 123, "Bob" },
{ 345, "Harry" },
{ 234, "Sue" },
{ -1, NULL }
};
Aha
Why is the last set null/null?
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.
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)
I like this form because it gets rid of that pesky “struct” keyword all over the place:
int key;
static const char * value;
} kv_t;
I assume I could switch it to two chars too
Do you know someone who has actually done this to the ATtiny? (You, maybe?) The Adafruit ATtiny page points to a 25-page instruction manual that outlines all the technical issues in loading new firmware when a module lacks a bootstrap.
Or should I just replace the ATtiny with a Cricket and be done?
Turns out this is a bug in the 2023 firmware, so I likely got an old module. Instead of updating the firmware (which I gather is many steps and can go wrong, bricking the chip), would you suggest I just migrate to something like a Cricket (which has more example code than the ATtiny).
yes. i've done it and can help walk you through it if you want. but you'd need to have some way to UPDI program first. like the USB serial cable.
but also, just to sanity check seesaw in general - what's your general goal? is it just PWM (for controlling motors/servos) over I2C?
I do like typedef when working with C, but it can cause bizarre, hard to debug problems in C++ and especially Arduino/wiring.
yeah, Arduino auto-generates function prototypes, and that can fail in difficult-to-debug ways if you’re using typedefs or other “advanced” language features that it wasn’t designed for
typedef struct wifiCredStruct_ {
static const char* ssid;
static const char* password;
} wifiCredStruct_t;
static const wifiCredStruct_t wifiCreds[] = {
{ "ssid1", "password1" },
{ "ssid2", "password2" },
{ "ssid3", "password3" },
{ -1, NULL }
};
I think I am probably doing this wrong.
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 }
};
I was typing that from memory, I probably missed something, but I'm not sure what it is
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
Try it with the size, like passwords[4] =
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
};
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
I don't think you have to. Did you try passwords[4]?
OHO
struct commands {
char* ssid;
char* password;
};
commands cmds[] = {
{ "ssid1", "password1" },
{ "ssid2", "password2" },
{ "ssid3", "password3" },
{ "", "" }
};
this works.
Note that using NULL instead of "" will save a tiny amount of space and making checking for the end more efficient.
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
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...
Has anyone successfully made a fake arduino IDE without the arduino.cli library?
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
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.
Yeah, I admit I am guilty of premature optimization there
but yeah - it seems to work well enough haha
I am not fully understanding how to iterate through this
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
}
ahhhhh.
Or you can skip putting the declaration in the for loop: ```arduino
wifiCredStruct * wcsptr;
for (wcsptr = wifiCreds; *wcsptr->ssid != '\0'; ++wcsptr) {
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)
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
i see
What the compiler does under the covers is interesting to some, but in most cases not important
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 :)
I would expect a pair of blank lines for {"", ""}
yes
If you deleted that entry, it would still work, but without the blank lines. I had only included that for the non-sizeof() approach
gotcha
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
I've seen one approach where someone was able to get 7 octaves of 1v/octave coverage out of the 4046 (see pic attached). However, this application is for audio rates. I'm skeptical about whether this can be generalized to RF range. Gonna try it anyway when my parts arrive.
Also, this design is using 15v AC, whereas mine is using 5v DC. So I've got some work to do lol
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:
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?
that RC pair is probably part of an oscillator or feedback loop, so it seems likely to need a buffer and filter if giving it a PWM output as its reference voltage. does the datasheet say you can do that sort of thing to change frequency?
it sounds like clocking MCX directly should work?
Yeah, but that would require another component and a lot of BS to get the 1v/octave curve working at RF rates. I think the current injection route is more flexible and simpler to implement
Now I just need to pick a suitable DAC and I'm off to the races
wait, how can you have both linear frequency per input voltage and also 1V/octave at the same time?
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
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)
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?
it depends on how the Nano routes its pins
i think there are some timer modes that let you change the frequency each cycle
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
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.
the PCF8574 is a quasi-bidirectional I/O expander and might not work for all use cases
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?
You would want an opamp for that I think
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
it really depends on what the relay module is expecting. if it's meant to be driven directly by GPIO, it might have optoisolators so you don't need protection diodes for your GPIO lines. which relay module is it?
note the PCF8574 will only source 30 to 300 micro amps when set high, except up to 1 milli amp temporarily during the I2C acknowledge pulse. this is in contrast to sinking 10mA when set low
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
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
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).
Thank you for the help! I have both the “authentic” (non-Chinese) FTDI from adafruit and a CH340 version, and have some experience hooking the the FT up to the Rx/Tx lines to get sketches into modules. But changing the firmware, I‘ve read, is a different process that is not controlled by, say, the Arduino IDE — is that right?
firmware can be uploaded via arduino ide
once the USB cable is setup
start by just trying to upload a basic blink example
the seesaw firmware for the attiny's are all set up as arduino sketches under examples in the firmware library repo:
https://github.com/adafruit/Adafruit_seesawPeripheral/tree/main/examples
setup serial cable like this:
https://learn.adafruit.com/adafruit-attiny817-seesaw/advanced-reprogramming-with-updi#step-3138713
if you have the megatinycore installed in the arduino ide, that should be all you need
Yes, in AVR that would be clear on compare match mode.
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?
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);
}
}
}"
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?)
Some chips use the same pins for touch and WiFi.
Look up the chip’s datasheet to see which functions share pins. Shared pins can’t be used for multiple functions at the SAME time, so you have to choose a function per pin, or make sure one is off when the other is being used, or use a different chip. Switching a pin between functions may be challenging.
cant I just use wifi.discconect(true). if it has not connected after 5 times
ohh ok I will try that when I get back home
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.
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
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.)
is there a io.disconnect like wifi.disconnect(true)
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?
solder battery wire extenders together? https://www.adafruit.com/product/3814 https://www.adafruit.com/product/261
unless your board has an enable pin
depends on how much of it you want to turn off? grounding the enable pin is supposed to put the 3,3V regulator into standby
Awesome, congrats! 
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?
what do you have it hooked up to that’s using the battery and not the 3.3V?
yeah, that’s supposed to work. i haven’t personally tried it though
nah
EN - This is the 3.3V regulator's enable pin. It's pulled up, so connect to ground to disable the 3.3V regulator.
ah i understand this question now, cause shorting enable to ground just disables the regulator, it still leaves BAT and USB powered
the only other thing i have connected to those pins is a music maker feather wing
which presumably isn't doing anything
the version with the speaker amplifier needs BAT or USB voltage, and doesn’t seem to have an easy way to disable them
rip, you're right, just took an amp meter to it and it still draws 5mA with GND<->EN shorted
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?
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?
Is it an adafruit sensor, and what board are you using?
Please post some pics to double check your wiring. The exact test code would be helpful too, since there are variations.
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
without posting the exact board and its pinouts, i cannot confirm that gpio22 and gpio21 are the correct I2C connections for your board
looking at the sensor pics though, it seems like the header pins are not soldered properly, and that creates an unstable connection, they need to be reinforced.
also, I'm not sure 0x76 is the correct address for the sensor, the Adafruit board default address is 0x77, and can be jumpered to 0x76, but yours could be different
running an i2c scan would help confirm
https://learn.adafruit.com/scanning-i2c-addresses/arduino
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?
in the guide, the drop down does say just "FirmwareUpdater" , so that is correct...
what firmware version do you have ?
you have a M0 feather, did you add the setPins() code described next?
also, did you follow this part of the guide, where you specify the link to the Adafruit board definitions https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500/setup ?
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?
Don't really understand what you mean, what value do you need to read?
And on what board?
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.
I'm using a Adafruit Bluefruit LE SPI Friend
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
Attached is what I see in the guide, it doesn't match what I see in the UI
Yes I have set pins
Firmware version installed: 19.5.2
I added this board manager URL https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
Is that what you mean when?
Edit, fixed https://forums.adafruit.com/viewtopic.php?p=1008894#p1008894
I see, glad it works now! (and sucks it's not supported in newer versions of Arduino IDE..)
I'm not bothered by that, just annoyed that the documentation hasn't been updated to reflect this. I'm gonna send off an email later to let adafruit know it needs to be updated
I can make this change in the guide, to say to use a version of Arduino IDE that is before 2.0
Awesome! I did have trouble finding the right version, it isn't on previous versions page, it's on the default download page under legacy
There is a link on the left side "Feedback? Corrections?" where you can leave feedback on any guide
OK, I added a warning box and a redundant warning in the text.
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
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!
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.
Thanks for your input! I have changed all to the digit-only gpio pin numbers (simply 18 instead of D18 or SCK) and I get exactly the same result, the same reactions from the controller, that i was getting before. hmmm
oh... weird 🤔
try with px 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
just use the number. like digitalWrite(18, HIGH)
I get the "not defined in this scope" error with p18
yes, I did... I get identical results as the other nonsense I tried!?!
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?
For the Feather RP2040?
that will probably be my next step
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);
}
I think that whatever my problem is, it is best indicated by the fact that my doing that yields the very same results as nonsense that should not have worked at all... its probably a big issue, somewhere in my setup of all these pieces, hw or sw.
if the above sketch doesn't compile, then it's either the Arduino IDE is set to the wrong board (this happen to me a lot) or it's set to the wrong core. The suggested core to use is this one: https://github.com/earlephilhower/arduino-pico, which has an adafruit-supplised board definition for the Feather RP2040:
yep, this https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json should be added here and then install the corresponding rp2040 board manager
this sketch does compile fine.
I do have the Earl Philhower board setup... but something is wrong so Im gonna start over on the IDE setup and work out simple tests for the rp2040 uncoupled from the midi controller parts it is for.
ah apologies then, I thought you said your issue was a compilation one where you couldn't get "GPIO18" pin definition to compile.
this is very messy... "GPIO18" and "p18" would not compile... i got a "not defined in this scope" error BUT "18" "D18" and "SCK" ALL DID COMPILE, and yielded the same glitchy reactions from the controller.
what is the controller? what is the code you're using to control it?
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)
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.
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
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?
It's usually best to just post the code, and if someone knows the problem, they will respond.
Are they connected through stemma qt? What code are you using? Are you getting any errors?
Alrighty, I am using this struct for the nodes struct Node { int x; int y; };
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
use the example_pid5690 sketch since you have a PID 5690 seesaw breakout
formatting like this #welcome message
and you didn't post the code where you actually create and populate your list.
stemma qt and no errors, the code works on other boards
u want me to send it
posting your code is usually helpful, yes 🙂 (preferably formatted like this #welcome message)
Great, I'll try it! I added a third pin.
BTW, how did you figure that out? I can't find any documentation that tells me that I've got the 5690 seesaw.
well, might be worth double checking what you're working with. i'm assuming it's one of these?
https://www.adafruit.com/product/5690
yes, that's the module.
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'm starting with the example code embedded on the web page (https://learn.adafruit.com/adafruit-oled-featherwing/usage) and I'm only seeing the adafruit graphic blinking on the display and no reaction to the buttons
I have to run and make dinner, so I'll have to see the reponse later. Thanks in advance!!
Stop the presses. This code work great! https://github.com/adafruit/Adafruit_SSD1306/blob/master/examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino
Pretty sure that "Arduino coming soon" thing is a leftover in the guide from when it was first published. The esp32 s3 chip was really new, and there was no proper Arduino support for it yet.
Now it should be working fine... as you already discovered 🙂
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
And this is what I get
which product ID?
You mean this?
I tryed to remove the clear function just to test, but it still lights up all leds every 2nd "show"
please post your whole code, this portion alone doesn't give enough info
I'm not at home now, going to send the code when I arrive home again
And thanks for helping 
it sucks that every page on https://docs.arduino.cc turns solid white when I press the down arrow
back home
this is the code
got other things on it to write logs to a oled
Going to try the fastled lib
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!
@eternal cloud I have removed the "Arduino coming soon" verbiage.
thanks for pointing that out
Sure!
Somewhat related, where is it best to report mistakes in guides? I know of at least one guide with broken / missing code, that was reported through the feedback link a while ago, but still isn't fixed.
The feedback link is still the best place, but which guide is it?
the PID number is in the example sketch name, so use that to match sketch (firmware) to product
https://learn.adafruit.com/circuitpython-animated-holiday-wreath-lights/code code is completely missing, project bundle empty
fixed, thanks - we reorganized the Learn Guide source code repo to make it less flat and missed changing the URL for the code.py. I think the folders image will regenerate soon.
now I'm trying to create some code to write text and so 🙂 Already found some examples!
Just as a test, comment out all the wifi lines to isolate it to just the matrix code.
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 ?
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.
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
Popular choices are a 1N4001 or zener diode, depending on the coil voltage of the relay
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.
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.
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.
To be sure, where have I to put this diode ?
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?
It would seem to, since it would imply that the problem is caused by the relay itself, not the strike or its power
Ok, I'll investigate. Could you please detail where I need to add the diode? ^
There are a few options, I normally place the diode in parallel with the relay coil: https://www.electronics-tutorials.ws/blog/relay-switch-circuit.html
Ok, I’ll let you know, thanks !
make sure you get the polarity right. The diode will burn up if it's reversed
noted, thanks
Can I send you the schema in a private message and continue our discussion here about the issue ? Maybe you’ll find an other issue on the schema ?
You don't care to share it here?
I would prefer to send it in private message, but we can keep on with the discussion here
I sent it, if you have any idea I am interested, thank you very much
OK, I finally get it: the PID is the product number of the part sold by Adafruit, and also part of their URL, and also in the example sketch's name. I had presumed, incorrectly, that since the PIDs in the library were all for the ATtiny module that I should choose the largest number to get the latest version. I suggest adding that tidbit of PID knowledge to the README file.
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
verify the uploading is working by uploading a simple blink example sketch. nothing i2c or seesaw. just toggle a gpio pin on the attiny.
#define PIN 7
void setup() {
pinMode(PIN, OUTPUT);
}
void loop() {
digitalWrite(PIN, HIGH);
delay(500);
digitalWrite(PIN, LOW);
delay(500);
}
change pin as needed
and then look at it on the scope, or connect an LED?
that works. pin 7 hops between 0v and ~5v.
cool. so basic uploading is working.
ok, now reload the PID5690 firmware again. for now, don't modify it from the original:
https://github.com/adafruit/Adafruit_seesawPeripheral/blob/main/examples/example_pid5690/example_pid5690.ino
uploaded, no errors.
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.
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()]
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?
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.
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?
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?
yep. i2c scan is simple good sanity check.
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
i've got 5v.
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
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.
it's a warning. not an error.