#help-with-arduino
1 messages Β· Page 104 of 1
thanks
How do you mean, opposite?
and what happened instead?
well, your sleep is like 0-5000, so they could sleep for 5 seconds
oh yes
so, to be clear, if you remove the randomness, can you turn all the LEDs on?
π
digitalWrite(13,HIGH);
delay(100);
digitalWrite(8,HIGH);
delay(100);
digitalWrite(7,HIGH);
delay(100);
good?
well nothing is turning on
Not sure what your actual wiring is like, but you might need resistors on all the LEDs.
something like this:
disconnect power before you mess with the breadboard
ok but what power
the power to the arduino
maybe, what wires are you trying to use?
it's not easy, unless you feed it a lot of power and you burn it out
yup
wow then it's alright
does anode & cathode both produce electri-city
Is this wire ok
@faint raft ayo
yup, that wire is fine
with those wires and the resistors, yes
YAAAAAAAAAAAY
should i read sum server rules
i better treat those rules as a server manual
why does the resistor keep falling or did i became weak from my laughter spells
jk btw ive never laughed this much before
is my breadboard too smol or should i cut the resistoru
I mean... Bend the resistor's legs. Like a spider, preparing to jump for your face.
lmao
lmmo
do the blubs only need to be in pos neg
physics debugging
my first time
i hope the metal does not goes in my food
i just ate a grape with my resistor
stick those grapes right in your face-hole
lmmo
now i know why my physics teacher was the only teacher trying to understand me
Why?
cuz
im 16
most quiet kid of my class
quiet kid memes motivated me to do java
and java & cpp are my fav
i almost failed in every subject including computer xd
Why?
cuz
i had very bad interest
nothing interesting
im still in school tho but pandemic
ive also managed a 300k subs channel before only to loose it
I would have loved to be in school during the pandemic... would have kept me the F away from all the kids that bullied me.
anyway, this conversation should probably go in #general-chat
look for the longest leg
maybe not three Ks, mkay?
sure
i just realized if i flip my breadboard everything will trip
Good enough?
wait i just assumed that blue is 1
pos
nvm i was right i overthunk that
oh well nothing is starting
no lights
int ra; //random
int dv; // delay
int pin; //actual pin
void setup() {
Serial.begin(9600);
pinMode(2,OUTPUT);
delay(1000);
pinMode(-3, OUTPUT);
delay(1000);
pinMode(-6, OUTPUT);
delay(1000);
pin = 13;
}
void loop() {
digitalWrite(2,HIGH);
delay(100);
digitalWrite(-3,HIGH);
delay(100);
digitalWrite(-6,HIGH);
delay(100);
// ra = random(4);
// if (ra==3){
// digitalWrite(pin,HIGH);
// delay(random(5000));
// digitalWrite(pin,LOW);
// delay(random(120));
// pin = 8;
// ra = random(5);
// }
// if (ra==2){
// digitalWrite(pin,HIGH);
// delay(random(5000));
// digitalWrite(pin,LOW);
// delay(random(120));
// pin = 7;
// ra = random(5);
// }
}
wait
nvm
ok so what is wrong
help
nothing's working hmm
it was like $50 should'nt be that bad
why do you have negative numbers on your pinModes?
cuz it was a negative pin?
one second
everything fits in the breadboard nicely
is the bread road broken
well tensorflow is not this hard but um
should i test a motor
why cant i control z in irl
wait imma use google
my arduino is working perfectly nothing else is
Are you following any kind of guide for this?
nop all my brain
but u can recommend me a course
one second i should wear gloves
just realized unity is a million times easier
ok enough if i cut black part of the wire end will something happen
don't cut any wires
@lapis meteor what are you trying to do?
AM I only capable of writing code or is just bad
sure
I thought if I can do cool things in unity why not irl
void LEDPattern::Twinkle()
{
int i = random(_NumLeds);
_Leds.data()[i] = PaletteMode(i);
fadeToBlackBy(_Leds.data(), _NumLeds, _ledsettings._pattern_fade_amount);
}
This makes a twinkle effect on my strip! when i set the Update (millis) in the main loop to very slow like 127 the fading becomes choppy! is there any way to smooth this out? i noticed that fadeToBlackBy uses uint8_t on the fadeAmount would it be possible to make and use a float variant of that fadeToBlackBy to smooth out the fading when Update is slow?
I have here a 1K Ohm resistor conected to the cathode of the led, and red wire is connecting anode to digital pin on Arduino
1k ohm
it doesnt matter
is my arduino not getting enough power
It is connected to your PC, right?
ofc
Then itβs ok
okk
Now, find the GND pin on your arduino and connect it to the negative power terminal on the breadboard
ohhh ground pin
do i need to make any further changes in the code
Your code should look like this for turning on a single LED:
int ledPin = <yourLedPin>;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
}
alright amazing
If you want to do blinking led you could try adding a delay after each digitalWrite, like this:
digitalWrite(ledPin, HIGH);
delay(500); // in miliseconds
digitalWrite(ledPin, LOW);
delay(500);
Let me know how it goes.
brown wire is connected to gnd right?
Yes
you should put brown wire on the same row as your resistor
okkk
oh my i made it blink
good
what do you mean?
okk
can't believe even my circuit wants me to be fit lmao
how do i increase 5v to 50
you can't do that with arduino and it's high voltage lol
duh
your led will burn
probably kind of the same
well, it's the same principle as LED, and programming it is the same
oh
youtube
wow
Electroboom, element14
it's too fast, i watch some vids at 2x some at slower
wow
can i get the link for it to open instantly
Adafruit was founded in 2005 by MIT engineer, Limor "Ladyada" Fried. Her goal was to create the best place online for learning electronics and making the best designed products for makers of all ages and skill levels. In the last 10 years, Adafruit has grown to over 100+ employees in the heart of NYC with a 50,000+ sq ft. factory. Adafruit has e...
this is it
great
i can only do 110 at my best lol
oo
i was a gamer
until i left gaming for data science now unity then micro controllers
anyways cya, i love this server
Glad I could help.
I've been having the worst of luck with getting the Seeed Wio Terminal connected to WiFi and SSL with mTLS against an MQTT server (Mosquitto). If I connect using the IP address it complains about missing domain name, but, sometimes it actually works, and I can send a message to the server. However, it's intermittent and the device will lose connection and then kind of get stuck in a re-connection loop. Attaching my code for your perusal.
The certificates.h file contains output from pycert_bearssl.
https://github.com/OPEnSLab-OSU/SSLClient/tree/master/tools/pycert_bearssl
Any help appreciated!
Hey Gusys
I just bought the Adafruit_MCP4725 DAC
The Problem is that my sine wave is delayed due to other code execution, how can have a smooth sine wave
Thats my code
You can use a timer interrupt to send the samples at a regular rate
Alternatively, if your other code operates in small enough chunks, you can periodically check millis() and use that to decide when to send samples.
is this only code based possible or do i need to trigger the input for example with an 555 timer ?
Yes, the chip has on-board timers you can use. There are libraries available to do some of the setup for you: https://www.arduino.cc/reference/en/libraries/timerone/
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.
@north stream thx bodya π
So appreciate the help here. @north stream @livid osprey Iβll be back with the project tomorrow and will give it a try.
Does anybody have any ideas about this one? Why does the Seeed Wio Terminal not connect properly to MQTT using TLS?
More appropriately, what did I do wrong? π
Maybe the SSL Certificat is not trusted
Well, it is. Because it's added in the chain in certificates.h.
anyone know what this error means?
Error: lo register required -- `sub r10,#1'
i'm running the acceldemo example code for the LIS3DH triple axis accelerometer on a STEMMA QT PY (SAMD21)
Sounds like you are trying to build your library for a target it does not support
This error comes from the assembler, and it is very probable your target MCU does not have a compatible instruction set to the inlined assembly in the library
Try building for another processor type, and see if the error goes away
If your library (or any of its dependencies) does not include any inline asm, perhaps your toolchain is broken somehow
Looks like SAMD21 is THUMB-based, which means that sub can only use the low registers (r0-r7), while this sub is targetting r10. Perhaps you need to switch your compiler to something that can output THUMB-compatible ASM? (See https://stackoverflow.com/questions/33994100/error-lo-register-required-when-build-libunwind-in-android-ndk)
Do you know in which file the error occurs?
so. i found out if i turned off "here be dragons" in optimize it works
and use standard.
i haven't tried the other ones
So, toolchain error
Generally, it is a good idea to leave all optimizations off while debugging
sure. but it still seems a bit strange that one would work and other wouldn't
IDK what software you are using, but here be dragons may be referring to enabling experimental optimizations that may not be completely ported to THUMB
Hence the generation of assembly that won't run in THUMB processors
i am using arduino ide 1.8.15
Oh, makes sense -- This forum post https://community.platformio.org/t/test-fails-to-start-with-build-option-ffast-math/25342 says that here be dragons refers to --fast-math
Hi there! I am having a weird problem I canβt wrap my head around. I have a Teensy 4.1 project and I am running a test on my code using the test framwork provided byplatformio. So far so good. The test executes as expected and all is fine. As soon as I add the custom build option -ffast-math to my platformio.ini the test no longer executes. Th...
Which tries to optimize away mathematical operations.. Probably something in there broke your code
interesting
--ffast-math tends to break math in general development too.. It disables IEEE float compat
From man gcc:
-ffast-math Sets the options -fno-math-errno, -funsafe-math-optimizations, -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans, -fcx-limited-range and -fexcess-precision=fast. This option causes the preprocessor macro "\__FAST_MATH\_\_" to be defined. This option is not turned on by any -O option besides -Ofast since it can result in incorrect output for programs that depend on an exact implementation of IEEE or ISO rules/specifications for math functions. It may, however, yield faster code for programs that do not require the guarantees of these specifications.
Hey y'all, seeking help on an LED icicle project:
https://learn.adafruit.com/holiday-icicle-lights-with-flair/hardware
https://learn.adafruit.com/holiday-icicle-lights-with-flair/arduino-code
I'm using a Feather M4 Express
with Feather-Header.
I have a lot of questions as I'm troubleshooting, but the first ones are:
Can someone help me with the M4 Express pins vs M4 Header pins?
The Board pins, on the Bat side, are:
SDA, SCL, 5, 6, 9, 20, 22, 23, 23, USB, En, Bat
And the board pins on the Header-Bat side are:
0, 1, 2, 3, 4, 5, 6, 7
And the pins scoped in the Code, are:
int8_t pins[8] = { 13, 12, 11, 10, SCK, 5, 9, 6 };
The SCK pin is on the Opposite side of the board, and opposite side of the header pin?/Ground-side. --- all my data pins are on the Bat-side of the header 0 - 7 pins, so, is SCK even used (since it's on the Groun-side)?
Does it matter which order the pins are scoped? is:
==
int8_t pins[8] = { 5, 6, 9, 10, 11, 12, 13, SCK };```
?
3.
I have data pins soldered to Feather-Header Bat-side pins 0, 1, 2, 3, 4, and 5
Which Feather M4 pins are actually being used though? -- 5, 6, 9, 10, 11, 12 are mapped to Feather-Header Bat-Side pins 0, 1, 2, 3, 4, and 5, respectively?
related to question 1:
e.g. Are the Feather-Header pins also getting SCK Ground-side pin data? If not, why might you think the author says the SCK pin needs to be defined?
np -- If you want to learn more about GCC's optimization options, see https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
(FYI: GCC is the compiler used by Arduino)
@restive heath - So - I see that rather than stacking the Feather M4 and the NeoPXL8 FeatherWing - you've chosen to wire them
Normally you'd just stack them using stacking headers - and all the connections from the M4 to the XeoPXL8 would made and correct... and you'd could ignore that part.
Is there a pin mapping/table somewhere?
This is what I just troubleshot:
int8_t pins[6] = { SCK, 5, 9, 6, 13, 12 };
// SCK == PIN 0
//int8_t pins[8] = { SCK };
// 5 == PIN 1 not pin 0.......
//int8_t pins[8] = { 5 };
// 9 == PIN 2
//int8_t pins[8] = { 9 };
// 6 == PIN 3
//int8_t pins[8] = { 6 };
// 10 == PIN NOT IN USE
//int8_t pins[8] = { 10 };
// 11 == PIN NOT IN USE
//int8_t pins[8] = { 11 };
// 13 == PIN 4
//int8_t pins[8] = { 13 };
// 12 == PIN 5 SPLAT STRIP
//int8_t pins[8] = { 12 };
The NeoPXL8 maps 8 pins of the M4 to the 8 outputs down the center (0 to 7).
which pins of the M4 is somewhat configurable via the little solder jumpers on the NeoPXL8 board. Did you solder any of those?
no.
I followed the tutorial linked. No jumpers mentioned/soldered.
Then by default, outputs 0 to 7, come from SCK, D5, D9, D6, D13, D12, D11, and D10 in that order
Where is this documented? I had to process of elimination to figure it out
Since we first started carrying NeoPixels back in 2012, the chainable RGB LEDs have taken over the world. And a big part of that success is due to the simplicity of their wiring - just one ...
on the product page
it does matter which order the declaration in C++ is made. You want:
Fantastic.
I missed that. Certainly needed it.
Now, the header, pins 0 thru 7,
the neighboring pins, they are duplicates?; there are two sets of 0 thru 7 pins?
Down the middle? One rows are the data pins to the neopixel strips - the other row are all ground
(sorry had to help son for a moment... back)
You want them in the order that the code is expecting them... which, oddly, isn't in 0 to 7 order:
int8_t pins[8] = { 13, 12, 11, 10, SCK, 5, 9, 6 };
oh ----- huh. I interpreted there are two sets of data pins from the product description π Thanks for letting me know ---- good stuff.
Cleaned up my comments as I dug into your answers and tried some stuff on my own to clarify & verify. Np.
Very cool. This is all info I was wanting about 1am Friday night π π I think it's close; I only have 5 drip strips -- not 7, so I need to refactor to get the Drip Strips and Splat strip acting as such -- and now that I have the Pin Mappings, and that the code is expecting out of order pin mappings, that clears out a lot of fog
(back again - more son helping had to happen)
are you just modifying the OozeMaster 3000 code as per the Icicle example?
Which NeoPXL8 pins do you have the drips on - and which do you have the "splat" row on?
I can show you how you modify the code to handle your setup
Fantastic! I've been trying to refactor it without much success. Learning a lot though.
Yes, I am modifying the OozeMaster code 3000 per the Icicle example - mostly -- I only have 5 icicles, instead of 7
So,
The data pins are 0 thru 5:
icicle 0 on pin 0,
icicle 1 on pin 1,
icicle 2 on pin 2,
icicle 3 on pin 3,
icicle 4 on pin 4, and
splat-strip on pin 5
Next piece is getting the splat strip to be a splat strip.
And then, maybe timing of the splat strip LEDs -- mapping led0 to icicle 0, led 1 to icicle 1 --- but we'll find out
edit:
My Splat strip is stuck on icicle 0 =/ but also Icicle 0 is working as an icicle
edit 2:
GOT IT.
if (N_DRIPS < _num_of_data_pins_in_use minus 1) { ...
//SET NUM OF ICICLES (total_num_of_icicles, icicle_strip_, splat_timing)
set(5, i, x);
}
And - you have it working? or still wrong things on wrong pins?
it's working. I'll post a pic in a sec. Just adjusting the gravity
Some days I wish I could adjust gravity.... π
Can't really see the drips from far away -- they're too far back on the ledge. I'll move them forward tomorrow.
BUT IT WORKS.
Thanks for helping today, @obtuse spruce !
Looks great, @restive heath
I've tried 1/3G (Martian gravity) 1/6G (Lunar gravity) and 0G, they're a lot of fun.
arduino is not ooop
such a screwed thing
int ra; //random
int dv; // delay
int pin; //actual pin
int bulb2;
int randomik;
void setup() {
// Serial.begin(9600);
pinMode(13,OUTPUT);
}
void loop() {
digitalWrite(13,HIGH);
}```
im frustrated with its physics
im getting a raspberry pi if i cant deal with this cotton candy of wires
certainly my creativity is dying
Wow it got stuck to the woodπ
Mr brain, it's broken
How much will I get a raspberry Pi for
Does it requires physics
at the rate everyone
You might find this guide helpful for using the breadboard https://learn.adafruit.com/breadboards-for-beginners The connections you have in the picture will not work. If you are not more careful, you may damage your microcontroler.
Hi, could use some help. I soldered a design ( https://there.oughta.be/a/macro-keyboard) but the LED behave strangely
like D1-D2-D3-D4-D7 but it is the default script:
It sort of is, in the sense that C++ is.
I'm not sure what you mean by "behave strangely". Some more description of what you're seeing can help us help you.
Just letting you know, the breadboard-side of circuit design is identical between Arduinos and Pis. C++ is definitely capable of OOP, but basic circuit fundamentals is a strict requirement for any of these electronic projects. A Pi will allow access to Python, but will certainly open a new can of worms with learning to configure and setup your build environment.
Definitely go through the breadboard basics in Jerryn's link, and consider playing with an Arduino simulator like Wokwi (https://wokwi.com/arduino/new?template=arduino-uno) or TinkerCAD Circuits (https://www.tinkercad.com/learn/circuits) if you want to connect wires to components without risking any permanent damage to your own hardware.
And if, after you get past the hurdles of circuit design, you decide the C++ in the Arduino IDE is still not for you, there are a plethora of CircuitPython or MakeCode devices that allow for more streamlined software development. None of this bypasses the process of how to put together components from the hardware side, but if you have a goal in mind, we can certainly help you find the right resources to get you where you want to be.
I don't think basic circuit fundamentals classify as physics in terms of difficulty or academic rigor, but definitely has a basis in said field. I've seen people who struggle with basic physics create some really neat electronic designs, so it isn't strictly required to make stuff these days.
There's also Rust, Lua, Forth, and several other possibilities.
@lapis meteor what are you trying to do?
i can help:)
If you are just trying to light up an LED using the Arduino Uno, I can guide you step by step and explain everything
Hello - I am having issues compiling code for my Adafruit Metro ESP32-S2 Express using Arduino. I'm not using CircuitPython because I need to connect to a WAP2 Enterprise so must use Arduino. I have a Mac and am following the Adafruit set-up tutorial and have installed the esp32 board on Arduino. I've successfully installed the METROS2BOOT drive and can see it on my computer. However, the board does not show up under Port on Arduino. When I put the board in bootloader mode, it shows up under Port, but the METROS2BOOT drive disappears from my computer. I try compiling the Blink sketch, but I get the following error: "Error compiling for board Adafruit Metro ESP32-S2." I've been searching for a solution for hours but am having no luck. Any suggestions?
Hi
I am having issue with the QtPy ESP32-S2 with Arduino
When I connect it to the PC it doesnβt make the noise of the USB detection and it doesnβt show in the Device manager
it will appear as a USB DFU device only if you put it into boot mode: hold down the boot button and press reset or apply power.
do the lights come on?
There are 2 buttons on the board
Reset and another one
I donβt think it is BOOT button
It should show up in Other Devices as ESP32-S2. Do you see it there?
It is not going to show up as a disk drive. You have to use a specific program to upload to it in DFU mode. The ESP Arduino board package should support this, I think.
Read about using it with Arduino here: https://learn.adafruit.com/adafruit-qt-py-esp32-s2/arduino-ide-setup
I did that
I followed that link
To install the driver
But when I disconnect and connect it doesnβt make the USB detected sound
is there a yellow triangle in Device Manager or not?
looking... which driver did you install?
This one
did you mean the Board Support Package? That is not a driver.
though it may contain one
what version of Arduino are you using?
1.8.13
I am installing 2.0 RC, which may include it outright. I'll get back to you in a few minutes
OK
it will be a while, I need to try it on another machine besides my laptop
Is there a way to reset the board ?
To factory settings and then try to connect it again
I saw something on the adafruit website regarding erasing the ROM
that should not be necessary for the problem you are having. Let me get a working recipe
This is getting more confusing. I don't have an easy solution for you at the moment. Asking for more info but it may not be soon. Don't wait around.
the documentation is not answering my questions
OK
I have no trouble doing this from Linux, which has the right drivers built in
that would also be true on Mac
OK
Windows does not have built-in DFU drivers
I am using a windows machine
i have a solution but will be back in about 1-1.5 hours
@pine bramble I am back, if you are around
What I found is that even without installing a driver, when I plug in the board and put it in boot mode, a new COM port appears. You can see this in the Ports listing in Device Manager. Open that up, plug in the board with the boot button pressed (or reset with boot pressed), and then choose that COM port in the Port menu in Arduino. I was able to upload. If you are in boot mode, your board will then not restart automatically. Instead you need to press reset, without boot, and the program you uploaded will start. From then on, as long as your Arduino program does not crash, you should be able to upload without going back into boot mode.
Sharing this question again in case it was missed π I keep getting the following compiling error with the Metro ESP32-S2: Arduino: 1.8.19 (Mac OS X), Board: "Adafruit Metro ESP32-S2, Enabled, Disabled, Disabled, Internal USB, Enabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi), QIO, 80MHz, 4MB (32Mb), 921600, None"
[73397] Error loading Python lib '/var/folders/1f/16yxxxyx7lv6c3hn8htr35gr0000gp/T/_MEIyU41Q3/libpython3.8.dylib': dlopen: dlopen(/var/folders/1f/16yxxxyx7lv6c3hn8htr35gr0000gp/T/_MEIyU41Q3/libpython3.8.dylib, 10): Symbol not found: ____chkstk_darwin
Referenced from: /var/folders/1f/16yxxxyx7lv6c3hn8htr35gr0000gp/T/_MEIyU41Q3/libintl.8.dylib
Expected in: /usr/lib/libSystem.B.dylib
in /var/folders/1f/16yxxxyx7lv6c3hn8htr35gr0000gp/T/_MEIyU41Q3/libintl.8.dylib
exit status 255
/Applications/Arduino.app/Contents/Java/arduino-builder returned 255
Error compiling for board Adafruit Metro ESP32-S2." I've uninstalled and reinstalled Arduino 3 times and can't seem to get it to work. Any help is much appreciated!
It could be the libraries are built for a different version of MacOS
I just read a thread online about that being an issue with a different ESP32 board so that is likely the problem. I'm currently running an old MacOS (Sierra 10.12.6). I might just find a Windows to use. Thanks for your help!
All 12 LEDs should be lit, but only 6 are lit and then one LED behaves strangely. Even with direct setting of individual LEDs i can only address 6 of them, not 12.
does someone have the code to write a float/integer to a flash-chip via the serial flash library by paul stoffergen
or just logging data from any sensor to the flash chip
Hello there chat!
In short - I'm using an arduino library (with help of PlatformIO) ACAN2515 to talk to the CAN bus.
The issue is - if I upload or debug, everything is fine,
If I reset or start the program by plugging the pico2040 in, something is missing and the Can chip initialization fails...
The trace goes deep to the internals of the adruino module and I can't really make heads or tails by that point.
Perhaps there is a common knowledge about that sort of thing?
?
Have you looked at the examples in the libraryhttps://github.com/PaulStoffregen/SerialFlash/tree/master/examples
The basic idea is that you are writeing a string of bytes to the flash chip. Creating a structure allows you to "pack" your data (floats,integers...) into the structure then write it to the flash. When you read it back, the structure knows how to decode it.
THis is the critical part ```// are we recording?
if (isRecording == true) {
// is it time for another sample?
if ( currentMillis - prevMillis > sampleInterval ) {
prevMillis = currentMillis;
// prepare the record for writing to the flash chip
// read in the data from your real sensors here!!!!
oneRecord.recordNumber++;
oneRecord.timeStamp = currentMillis;
oneRecord.temperature = getFakeTemperature();
oneRecord.pressure = getFakePressure();
oneRecord.acceleration = getFakeAcceleration();
// write the record to the flash chip
file.write( (uint8_t *)&oneRecord, sizeof(oneRecord) );
}
}```
that is what I missed π
Glad it helped -- Good luck!
Folks, I have fixed that *** issue and would like to write an article. My first actually.... Where would be a good place to drop one, so that it could reach people quickly. I imagine it's a doozie to figure out that stuff for yourself, even though the solution is obvious in retrospective.
Your best bet would be to post it on some relevant forum somewhere
They will probably have all the SEO stuff figured out, and it will probably show up in google search results
I have written the jetbrains for a place on their site
it's about integrating pico with their CLion IDE
You could also do a writeup in your blog or something and then send it to hackaday
So I need a blog... haha π
π
https://gifcities.org/ if you want your dose of early web nostalgia
I guess you are referring to hypnospace heh
yeah))
Haven't played it, not enough time. Looks nice though
i suppose I'll walk it through on youtube π
just wanna ask if someone says "serial 1 pins" does that mean these two pins?
fadeToBlackBy(_Leds.data(), _NumLeds, 255);
for ( float i = 0; i < _ledsettings._pattern_lead_pixel_size; i+= _ledsettings._pattern_lead_pixel_size )
{
float pi = _pattern_position + i - _ledsettings._pattern_lead_pixel_size;
DrawPixels(pi, _ledsettings._pattern_lead_pixel_size, ColorFromPalette(_ledsettings._palette_current, pi * 255 / _NumLeds, Brightness, _ledsettings._palette_blend));
}
void LEDPattern::DrawPixels(float fPos, float count, CRGB color)
Why does the palette start by the color from the end and then suddenly flips over to the start of the palette? :S
It depends on the board. And the software. But maybe?
teensy 3.2
Yes, those should be Serial1. https://www.pjrc.com/teensy/td_uart.html
perfect and thanks for the link
guys I have a data exceeds available space issue
In my sketch I have over 400 GPS coordinates, and I guess Arduino can't handle it in the way I "wrote" the code
`static const Position positions[450] =
{
{12.345678, 98.765432},
{23.456789, 87.654321},
....`
so this is how the sketch looks like, 448 more of the brackets with numbers....what methods could I use to shorten this? is there a simple way to shorten this code in a way?
That array would take 3600 bytes, assuming that the Position type is just two floats. What Arduino are you using?
just a regular uno r3
"Sketch uses 12102 bytes (37%) of program storage space. Maximum is 32256 bytes.
Global variables use 3030 bytes (147%) of dynamic memory, leaving -982 bytes for local variables. Maximum is 2048 bytes."
this is the message
Depending on the accuracy needed, you might be able to compress that somewhat.
what are my options? π
The earth has a circumference of about 40,000km, so if 1-km accuracy were suitable, you could store lats and longs in 16 bits, which would halve your storage.
16 bits meaning...
12.345, 98.765
instead of
12.345678, 98.765432
or something like that?
I would like to have some accuracy really
I'd convert the values to integers and store them in 16-bit ints. Unfortuately, the naive approach of just multiplying them by 1000 wouldn't work for some locations, so you'd have to do a little more math to pack and unpack them.
For more accuracy, you'll have to get even fancier.
You could also connect an external storage chip to hold these values? Perhaps an EEPROM or SPI flash?
where do I start for converting it into integers?
im a noob needless to say, hence asking π
It's one of those problems that gets interesting quickly. A minute of latitude is about 1.8km. However, a minute of longitude varies, from about 1.8km at the equator to zero at the poles. So you could theoretically compress longitude values more in polar regions while still having good resolution. The amount of compression this buys you depends on both how willing you are to indulge in complicated trigonometry and the distribution of your points (if many of them are polar locations, you'll get more compression).
hooly moly
To think of it another way, the earth has about 510072000 square kilometers of surface area. Assuming you could somehow divide it up evenly and assign each piece to a 32-bit quantity, that yields 0.118 square kilometers per piece.
i never would've guessed it could get that complex, I figured there's a way to compress it like CSS SASS and such π
That's why I like to do those basic calculations, which quickly yield what the theoretical maximum compression could be. If that's not enough, something else has to budge. Personally, I like Hem's idea of storing the data elsewhere (FRAM chip, SD card, whatever) and not getting into the complexities of trying to compress (and recover) the data, and the attendant loss of precision.
well I planned on using scaling this gizmo down and using Nano instead of Uno...but now this makes for another challenge
You could, of course, use something like an ItsyBitsy M4 Express, and take advantage of both a smaller board and (much) more storage.
I might be behind with the times...
are there any Nano editions with faster chip?
can't be that 328P is where they stopped?
There are things like the Nano Every, with an ATmega4809 chip, but it's not that much larger.
does code change if the chip changes?
Generally it does, but not a whole lot.
An ordinary Trinket M0 (an even tinier board) still has 256kB of flash, a serious improvement over the ATmega328
oh nice, how come Arduino themselves dont do those kind of fast/compact devices?
They're starting to. The Nano 33 BLE is a much more powerful board.
so the limit I got on the compiler "Maximum is 2048 bytes" - which part of Ardu specs is this?
2048 bytes of memory? or what exactly?
Hmm, that's RAM. I would have thought the compiler would have seen your const keyword and put that data into flash instead of RAM, but apparently it did not. You may need to add the PROGMEM keyword and you might have to use slightly different code to read the values from the array so it fetches them from flash.
The 328P has 32kB of flash and only 2kB of RAM
If you can find a way to convince the compiler to store that data in flash, your problem might be solved.
what the... π
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.
just added static const Position positions[450] = PROGMEM
and it compiled
Sketch uses 12102 bytes (37%) of program storage space. Maximum is 32256 bytes.
Global variables use 518 bytes (25%) of dynamic memory, leaving 1530 bytes for local variables. Maximum is 2048 bytes.
Sweet!
i mean just to nerd out - why did that one word PROGMEM cut down the global variables from 3030 bytes to 518
That was apparently what told the compiler to just have that data in flash instead of trying to build a copy of it in RAM as well.
awesome! my friend has that 33 BLE or some similar factor Arduino with wifi, will try to make it work without progmem just to see if it works
like you mentioned, the code should stay the same?
despite different chips used from uno?
Yes, unless you're doing specific things that depend on certain hardware features. In general, the compiler does a good job of abstracting the implementation details so you can use the same source code, but there are some details that are going to vary.
If you were writing your code in assembler, it would need a complete rewrite, but a "portable" language like C gives you the freedom to change architectures and the compiler just takes care of the details for you (for the most part).
if in my case I just compile this "328p" code (so to speak) to the 33 and it works on the first test...are there any chances that the code dumbs out for some reason mid operation, despite first quick test working out fine?
Probably not, but I really don't know enough to be sure.
Not sure if this is the right place, but I'm at a loss. I'm happy to ask elsewhere if I'm in the wrong spot. Preface with "I'm an absolute noob at this." I am trying to replicate the exact functionality shown in the video on this page (https://www.adafruit.com/product/3406), though I have a 16 pixel ring.
My original goal was, I thought, very simple. A small ring light that I could put on my webcam for video calls (dark environment here). It would be powered via a USB on my PC. The functionality of choosing the color and brightness via the Bluefruit Connect app looked like a nice bonus. But now that the board (Feather nRF52 Bluefruit LE - nRF52832) and LED ring (NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers) are here, I can't get anything to work.
Am I missing something super obvious, or did I jump into the wrong end of the pool here. How can I get this functionality out of the two devices I have, or even any other devices, as absolutely simply as possible?
When you say "I can't get anything to work", how far did you get? Does the code compile? Can you load it onto the board?
I downloaded the library specific to the nrf52 and there's a "neopixel" example within it. It compiles fine. Loads to the board. I can connect with the app. Neither the color picker nor neopixel sections of the app produce any result on the LEDs. I've also tried several of the neopixel test examples that should (if I'm reading them correctly) just loop colors on the LEDs to verify they work. No lights.
I've tried to stick to prebuilt examples, either directly through the IDE or other projects utilizing the same hardware, since as is obvious... I feel I'm in way over my head at this point. Haha. I feel like creating and flashing my keymap on my KB was way easier.
@hot minnow - can you point us to exactly which "neopixel" example you're working with? I'm not finding it in the Adafruit nRF52 core files.
Yes.
As far as I can tell.. this board doesn't have a neopixel on it - so this example, for this board, will use the neopixel attached to pin D30 which is, oddly enough labeled 16 on the board, on the short header side, next to the USB power pin.
Is that where you've connected the data line of your NeoPixel ring?
Yep.
Oh wait - OOOOOOO pin out diagram is SOOOOOO confusing
Agreed!
My bad - D30 is the pin labeled 30 on the board - fourth from the right edge on the short header side
I think that is where you should have the data line of the NeoPixel ring
on that diagram the numbers in white text on back are the physical pin numbers... which don't directly matter for something like this.
The number in white text on purple background is the arduino pin number, like 30 or D30 which you use in code to talk about the pin.
Congrats!
Thank you! Now I can mount this thing and NEVER TOUCH THE CODE AGAIN. haha
I am back now
hi, so try what I wrote up. Another staff member also tried it and it worked for him too
you can ignore the yellow triangle. The important thing is that putting the board in boot mode will cause a COM port to appear, and that is the one to choose in Arduino to upload. Then after you upload, you must press reset to get the program to run. Once there is a working program on the board, the Arduino program will notice upload attempts (on a different COM port!), and you won't have to use bootmode. again. You can also install the UF2 bootloader, and it can also be used for Arduino uploads, if you double-click reset.
It happened to 2 QyPyβs that I have and when I connect them they both show up as COM 6
did you set COM6 as the port in Arduino and then upload?
you can also do this https://learn.adafruit.com/adafruit-qt-py-esp32-s2/factory-reset, which will load the UF2 bootlaoder
to Windows, they look identical, so yes
But when I plug in two different boards they are given different COM ports
It only happens to those specific boards
I believe it is because there is not a unique ID seen by Windows when you plug those in, in boot mode
so it can't tell them apart
for most other boards, a unique ID is presented. Are you saying you have other identical boards Windows can tell apart? e.g. two Arduino Uno's?
When I plug 2 Arduino in my PC I get 2 different COM ports
I think you will see different COM ports once you have Arduino programs running on these boards, but I am not sure. The on-board chip has to have a unique ID (which I am pretty sure it does) that it presents during USB enumeration
What I donβt understand is why they donβt make a sound when i plug them in my PC
because they are mostly not recognized as a known device
I think I saw the same thing
nevertheless, the COM port appears, and you can use it
But I have another QtPy ESP32-S2 board that when I plug it in the PC it makes a noise and works fine
Only these two that I got have it
that one has the bootloader or a running program on board, which identifies itself properly
Try the "factory reset", it will make things easier, I believe
OK
excellent! glad the instructions worked out; we just rewrote them to be clearer
Hello wonderful people.
hi:)
I am here, with a math problem... I think. So, I am trying to use the freeMemory() function with a SAMD51, but for some reason I am getting negative values. I am going to climb out on a limb and start sawing near the tree trunk... First assumption: my variable storage is not large enough for the entire memory, so it's flipping?
#ifdef __arm__
extern "C" char* sbrk(int incr);
#else
extern char *__brkval;
#endif
int freeMemory() {
char top;
#ifdef __arm__
return &top - reinterpret_cast<char*>(sbrk(0));
#elif defined(CORE_TEENSY) || (ARDUINO > 103 && ARDUINO != 151)
return &top - __brkval;
#else
return __brkval ? &top - __brkval : &top - __malloc_heap_start;
#endif
}
Required reading: https://learn.adafruit.com/memories-of-an-arduino/measuring-free-memory
Also checked this solution, but it didn't help either: https://learn.adafruit.com/adafruit-feather-m0-basic-proto/adapting-sketches-to-m0
Values I am getting:
- In setup(): -25625
- In loop(): -33877
PLS SEND HALP
So. I am using CLion with Platform IO for this. Could that impact anything?
Maybe I should try to compile with Visual Studio Code? ... BRB... VSCODECOMPILE.exe running...
Nope. Same same. But not even really different.
OK. So, either nobody knows, or everybody knows, and you're all laughing at me. π
Anyway, ping me if you have any idea of what's up with this memory thing.
@faint raftcould it be as simple as the print function casting an unsigned int to a signed int ?
probably not. just a wild guess.
any chance &top is getting optimized out? https://godbolt.org/z/eTehnb4ov
nvm i think gcc is just doing that because its local
I am not sure. I will continue to do some debugging here, but yeah, it's pretty odd. Without the requisite knowledge I feel like I am stumbling around in the dark and that one light is a freaking angler fish.
how can i start an lcd
where do the pins go to?
like its a bloody circle with holes and expect wires to go through it???
im monke btw
i wanna see if it is included in the kit
ah yes hookup wires is it?
holy, its insanely hard or did i watch a not so good tutorial
nvm i will do that project later on
to figure that out, it would help to know exact model of the LCD - are there any marking on it?
1602A
okay, next short question
it is based around this issue:
2 votes and 5 comments so far on Reddit
somebody said he fixed it, but i do not have a clue how and didn't got his answer (yet):
I resolved the issue by chunking the binary data 100 bytes at a time and sleeping between sending images. I'm still working on the best timing.
code is something like:
def sendBinaryToDevice(self, data):
if self.debug:
print("Sending " + str(len(data)) + " bytes of binary data.")
self.ser.write(data)
any help appreciated
I have an adafruit feather m4 CAN. what's the avrdude -p partno (name) for it? I tried scraping it out of the arduino gui, but I didn't find it. I assume there's a way to find it, what is it? I know the fqbn is adafruit:samd:adafruit_feather_m4_can, but that's different.
Not sure if it has one, since it's not an Atmel MCU? What's it for?
SAMD (or in this case, SAME) doesn't use avrdude for programming. If you need the chip name though, I believe it's ATSAME51J19A.
lalalalal lalalalala la6
Hello can someone help me with what is wrong in this code. I am a beginner so apologies if this is a very silly mistake. I am using the SerialFlash library: https://github.com/PaulStoffregen/SerialFlash for my flash chip and am having an issue with the below code. Basically when I print my read flash chip data it gives 0 on the serial monitor.
#include <SPI.h>
const int cspin = 16;
SerialFlashFile file;
char filename[16];
char buffer1[256];
void setup() {
// put your setup code here, to run once:
SerialFlash.begin(cspin);
Serial.begin(9600);
SerialFlash.create( "dummy.txt", 16 );
file = SerialFlash.open("dummy.txt");
//file.write( (uint8_t *)&oneRecord, sizeof(oneRecord) );
//file.write((uint8_t *)&noom, 256);
}
void loop() {
// put your main code here, to run repeatedly:
//file.write((uint8_t *)&noom, 256);
//file.write(buffer, 256);
Serial.println(file.read(buffer1, 256));
}```
the data is already written to the flash chip this is just to read it
this is the read function -
```file.write(buffer1, 256);```
It looks like you are calling create() each time in the above code, which would probably erase and regenerate an empty file.
Precision Drawing and fadeToBlackBy
i created a thread for a problem i have relating to ESP32 / WS2812B / FastLED, if anyone can take a look! i posted alot of info (the reason for creating the thread)
ok I changed that but I am still not getting the desired result
#include <SerialFlash.h>
#include <SPI.h>
const int cspin = 10;
SerialFlashFile file;
char filename[16];
char buffer1[256];
void writedat(){
SerialFlash.begin(cspin);
SerialFlash.create( "dummy.txt", 16 );
file = SerialFlash.open("dummy.txt");
//file.write( (uint8_t *)&oneRecord, sizeof(oneRecord) );
//file.write((uint8_t *)&noom, 256);
file.write(buffer1, 256);
}
void readdat(){
Serial.begin(9600);
SerialFlash.begin(cspin);
file = SerialFlash.open("dummy.txt");
Serial.println(file.read(buffer1, 256));
}
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
writedat();
readdat();
}
void loop() {
// put your main code here, to run repeatedly:
} ```
Is it still printing 0, or does it print 16 now?
it prints 16 now, is that what it should be printing?
Yes, because you created the file originally with a length of 16 in the create() call.
So it can only write or read a maximum of 16 bytes.
SerialFlash is a bit funky and doesnβt work like a standard file system. In particular, unless you erase the whole flash chipβ¦ you canβt ever recreate a file, or even rewrite it. as such, your older code might have poisoned the file dummy.txt. try the code with a new, previously unused file name.
oh I see, thanks for clarifying!
yeah I wasn't going to use SerialFlash at first but the SPIMemory/SPIFlash library doesn't work for me
At some point i need to package up my flash code as a library. It handles a block of state that you want to persist often, like synthesizer settings, and you want whatever the user last tweaked to be there after a power cycle.. so the code is saving after every knob turn. It handle all layout, erasing, and wear leveling.
Aha, so that's why I didn't find an avrdude line. I see there's a bossac line, I guess that's it. Thanks for your help.
I see:
bossac -i -d --port=ttyACM0 -U -i --offset=0x4000 -w -v /tmp/arduino_build_851300/foo.ino.bin -R
I don't know where it says which chip it is, that must be baked into the bin. I'll investigate.
i created a thread for a problem im having relating to ESP32 / WS2812B / FastLED, if anyone can take a look! i posted alot of info (the reason for creating the thread)
realy need some help with this :/
#include "AdafruitIO_WiFi.h"
#include <DHT.h>
#define DHTPin D5
#define DHTType DHT22
DHT dht(DHTPin, DHTType);
#define WIFI_SSID "WiFi Name"
#define WIFI_PASS "WiFi Password"
#define IO_USERNAME "your username"
#define IO_KEY "your key"
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
AdafruitIO_Feed *temperatureFeed = io.feed("Temperature");
AdafruitIO_Feed *humidityFeed = io.feed("MHumidity");
void setup()
{
Serial.begin(115200);
io.connect();
dht.begin();
while(io.status() < AIO_CONNECTED)
{
Serial.print(".");
delay(500);
}
}
void loop()
{
io.run();
float t = dht.readTemperature();
float h = dht.readHumidity();
temperatureFeed->save(t);
delay(100);
humidityFeed->save(h);
delay(5000);
}```
I would like to connect a si7021 sensor to an Arduino uno for a class project and then use the built-in esp8266 and use the adafruit io dashboard to display the temperature and humidity but the code I found doesn't help me much thanks to anyone who can help me
in this code I would have to change the dht22 sensor to a si7021 sensor but it doesn't work
Hey, I am having some trouble getting an Arduino to communicate to a PC over UART. I am using the Python UART library on the PC, and the Ardunio is simply not getting the UART info. Any tips?
Did you connect Rx to Tx?
What UART hardware are you using on the PC side, and how are you wiring it?
Never mind. It works on Linux by outputting the plain text to /dev/ttyAMC0 Is there any problem with that?
It does. It appears to have been an issue with the Python library, so bypassing the Python library fixed the issue as far as I can tell.
which python library? pyserial?
I think so. It was import serial
unless something else is taking the com port when it connects, should work
Oh, would monitoring the serial output of the Arduino over the Arduino IDE count?
yes. if arduino serial monitor is using it, then you won't be able to open it in python.
can i use the imagereader with an ili9486?
i cant find a lcd driver from adafruit for it but the driver need to inherit from Adafruit_SPITFT
I need a very specific sensor recommendation
When you have a closed room and you open it suddenly and it creates air drag and maybe a change in barometric pressure
So, I've tried to search it on the web but the queries I'm using are not giving me any result
I need to detect that effect of the door opening and closing in the smallest from factor posible
Any guidance?
lots of barometric sensor options:
https://www.adafruit.com/category/114
could maybe also do it optically? like with a time of flight sensor pointed at door?
or this approach:
https://learn.adafruit.com/no-code-iot-door-alarm-with-wippersnapper
but that may be too intrusive, since it requires hardware mounted to door
or how do i display adafruit gfxcanvases?
@shut echo No Idea about the imagereader or SPITFT, but Waveshare's ILI9486 library should work with adafruit_gfx? https://github.com/ImpulseAdventure/Waveshare_ILI9486/blob/master/examples/GraphicsTest/GraphicsTest.ino
and what about displaying gfxcanvases
tft.drawRGBBitmap(0, 108, canvas.getBuffer(), 320, 372);
does not work
You're going to have to share your code for me to have any context of what you're trying to do. Plus button to the left to upload from file, or surround a codeblock with 3 backticks.
GFXcanvas16 canvas = GFXcanvas16(320, 372);
canvas.fillScreen(0x017F);
canvas.drawBitmap(0, 0, door_rfid, 320, 372, WHITE);
tft.drawRGBBitmap(0, 108, canvas.getBuffer(), 320, 372);
im basically just trying to only have to draw once to the screen instead of once for every operation
just like with the Adafruit_SSD1306 library where you can draw into a buffer which you have to push to the screen later
and i guess that is also the purpose of gfxcanvases
Ah, thank you for the help!
Ah, it uses bossa instead of avrdude. Thanks.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xc3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xc3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xc3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xc3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xc3
Problem uploading to board. See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xc3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xc3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xc3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xc3
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xc3
help
fixed but
why it does not work when i plug in wire into pin 0 & 1
Pins 0 and 1 on an Arduino Uno are connected to the serial pins which are used to upload code and print to the serial monitor
ohk
how do i use an 8x8 dot matrix
What kind of 8x8 dot matrix? Some matrices have different interfaces.
Still in question
At first glance the code snippet looks reasonable. What error or problem are you seeing with it?
This
I'm suspicious because it seems to be drawing into the top 108 rows even though you specified a Y offset. Are you able to use other drawing commands normally with this screen? (I'm wondering if the general TFT setup is correct.)
no i didnt show the other rows. everything else works
what could be the problem is that i had to change the data type from char to uint8_t because i used this converter https://javl.github.io/image2cpp/. is that the problem?
just the canvases dont work
Both char and uint8_t are 8-bit data types, so I wouldn't suspect that to cause any issues.
Just to double-check, your door_rfid image is 320x372 originally?
yes
That should produce a bitmap array of 14880 bytes.
how can i tell how big that is?
You can print sizeof(...) to find out how big the compiler thinks it is, or maybe use the line numbers in the source code if the converter outputs 16 bytes per line or something constant.
Or if you drawBitmap directly into the tft and it works, then that would indicate that it's fine.
yeah it does work normally
Another thing to check is whether the canvas allocation actually worked. That would take up 232KB of RAM, so many microcontrollers will not be able to hold it.
ah so it doesnt work on the arduino mega?
Yeah, not a chance. That only has 8KB of RAM total...
ah well i didnt know that thank you
Hello guys, I want to call the functions on top (ily,tekststart,missu) the whole time individualy without having to wait for the analog and led stuff. How do i do this?
One thing that will speed up your code is to move the strip.show() call after the for loop to only call it once instead of for every LED.
I do that to create a wipe effect, so without it it would just be a solid color immidiatly
Ah, gotcha.
Hey for some reason when using the isTouching method of the adafruit touchscreen libary this error comes up
ccZgnUdz.ltrans0.ltrans.o*: In function loop
Error linking for board ATmega2560 (Mega 2560) (Arduino Mega)
DoorOS.ino:429: undefined reference to TouchScreen isTouching()
collect2.exe*: error: ld returned 1 exit status
looks like it's not implemented:
https://github.com/adafruit/Adafruit_TouchScreen/blob/28e6e744982825d679f543b70480d31e457363b3/TouchScreen.h#L59
Hi y'all!
I'm trying to run img2code on my Windows 10 laptop. I installed JAVA but when I type the command, "./gradlew" in the command prompt, nothing happens... well, not in the foreground. It seems something happens very quickly in the background but too fast to see what it is.
The ReadMe files on GitHub and in the Zip are useless - unless one is already a JAVA geek. Thanks!
Where/how are you running gradlew? Can you provide a screenshot?
Adafruit soundboard
Hi sorry to bother you guys again, my code is not working instead of getting 64 I'm getting 256
#include <SerialFlash.h>
#include <SPI.h>
const int cspin = 10;
SerialFlashFile file;
char buffer1[64];
void writedat(){
SerialFlash.begin(cspin);
SerialFlash.create( "dummy.txt", 256);
file = SerialFlash.open("dummy.txt");
//file.write( (uint8_t *)&oneRecord, sizeof(oneRecord) );
//file.write((uint8_t *)&noom, 256);
file.write(buffer1, 256);
}
void readdat(){
Serial.begin(9600);
SerialFlash.begin(cspin);
file = SerialFlash.open("dummy.txt");
Serial.println(file.read(buffer1, 256));
}
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
writedat();
readdat();
}
void loop() {
// put your main code here, to run repeatedly:
}
Can anyone help with me trying to reset Arduino Pro Micro?
I tried to connect rst to the gnd pin but it would never reset
It's driving me crazy
Idk anything about electronics so forgive me but will this work?
Or is this not how you do it
Hello! So today I had an idea in mind to make an LED light up only if you do a certain pattern on the buttons (2-5-1), but it doesnβt quite work. I have tried debugging the code and it seems that only the 2nd button works for some reason
This is the code: https://pastebin.com/Rt8gaKCB
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
After further inspection it seems that the 5th button is not receiving enough power
I fixed it, somehow the 5th button was burnt or something
After replacing it it works
In windows command prompt
Your write and read commands are specifying 256 bytes, so that's what the call is doing. It doesn't know that buffer1 is only 64 bytes long, so it's actually accessing out-of-bounds memory. You're just getting lucky that it's not causing a crash when it does that.
You can use sizeof(buffer1) instead if you want it to automatically calculate the correct size to use the whole array.
sizeof(buffer1)/sizeof(char) <- just to protect against potentially different char sizes, since sizeof returns total numbers of bytes
Well, the read() and write() calls are expecting a number of bytes as a parameter, I think.
ok. that'd work. it's more of when one is expecting "size of array". (it's bitten me before)
The shell of the USB connector is also ground. That is a much bigger target. Also if you get some F-F jumpers it will be easier.
Looking kind of deep into WiFi. ESP8266WebServer has functions like server.handleClient() and server.send() while WiFi101 makes you read and send bits of info at a time (i.e. client.println("HTTP/1.1 200 OK") Is there an include with this functionality for SAMD, specifically M0 WiFi?
@small pumice Doh, just found clues in WiFiWebServer on Github. But advice still appreciated if there are other sources.
This is what I get if I'm in the Java directory
This is the instructions ver batim in the GitHub page:
"Image2Code is a small java utility to convert images into a byte array that can be used as a bitmap in the Adafruit-GFX-library
USER Guide
To Run
Run the command: ./gradlew run to launch the application.
Using the Application
- Click "choose file" button.
- Then copy paste the generated code in your arduino sketch.
Dependencies:
- Java: If you do not have this installed, it can be found at: http://www.java.com/en/download/ if you havn't already done so.
- Gradle: The gradlew will take care of this dependency. Just running any gradlew command will pull down the dependency
#DEV guide:
This sub-project using Gradle to build. To build a runnable jar: ./gradlew jar "
try typing gradlew.bat instead
from inside the Img2Code directory
@solemn cliff - Here is what I get:
let me see what I can find on the Gradle.org site...
Well, I followed the instructions for Windows 10:
Windows 10 and Windows 8
In Search, search for and then select: System (Control Panel)
Click the Advanced system settings link.
Click Environment Variables. In the section System Variables find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
Reopen Command prompt window, and run your java code.
But I got this:
That was to make sure Java is enabled.
That may be too new of a version of Java - or not new enough?
I'm on the latest version, so maybe something in the Java Control Panel?
Hello! I am having trouble with my Adafruit Data Logger Shield. I've got it connected to an Adafruit Metro ESP32-S2 and I've been able to set up the Real Time Clock. My problem is with checking the SD card. The data logger shield tutorial says to use the CardInfo example sketch in the SD library under the ArduinoTestSuite, but my Arduino IDE 1.8.19 does not display the TestSuite. I downloaded the SD library from github and copy/pasted the CardInfo sketch, but I just get the "Sd2Card does not name a type" error. I've tried using the SD_Test example from the Adafruit Metro ESP32-S2 examples, but the Serial Monitor is just blank. Any ideas of how to fix this?
Does anyone have a very large hammer? I've heard those work wonders!
Can this RFID/NFC https://www.adafruit.com/product/4701 read other tags? The guide says that it can write them so that a phone can detect them but nothing about reading them. I was given one of these as a freebie from Adafruit a year or two ago because I spent a certain amount of money.
This RFID tag is really unique: it works with mobile phones just like other RFID tags, but you can reprogram it over I2C. The tag shows up as an ISO/IEC 15693 (13.56MHz) chip which is ...
it's a tag itself, it cannot read or write other tags, you just set its value, and a phone can read it
Oh. I think I was looking through the data sheet and it mentioned reading capabilities
ah it can read from a phone, but I assume not other tags ?
According to the datasheet, one can even use it as an 'I2C to RFID' transfer system to wirelessly send and receive data from mobile devices (you'll need to write a custom app for that kind of project, though).
maybe ST has demo code for that
that seems to describe interactions with a terminal
Hereβs the data sheet https://cdn-learn.adafruit.com/assets/assets/000/093/906/original/st25dv04k.pdf?1596828496
it has a memory that can be read or written to by both I2C or the phone, allowing for bidirectional communication and data transfer
Iβm not planning on using a phone to write it
Iβm planning on having a small tag that it detects and does something based on getting an input
Like an led will turn on when a rfid/nfc tag is nearby
it's a tag not a terminal, that would require completely different electronics
So it canβt sense?
you would need something like one of those:
https://whadda.com/product/arduino-compatible-rfid-read-and-write-module-wpi405/
https://www.sparkfun.com/products/15209
https://www.adafruit.com/product/364
(just a couple trouple of examples)
Hey all, I'm trying to get this rfm9x LoRa module working on an arduino nano following this tutorial https://learn.adafruit.com/adafruit-rfm69hcw-and-rfm96-rfm95-rfm98-lora-packet-padio-breakouts/arduino-wiring
However it's failing to even initialize. The pins are correct to my understanding and the Nano itself works. The wiring goes as follows from rfm9x -> nano:
vin -> 5v
gnd -> gnd
en ->
g0 -> digital 3
sck -> digital 13
miso ->digital 12
mosi -> digital 11
cs -> digital 4
rst -> digital 2
does anyone know where I might start as far as debugging?
have also tried with a mega and no luck
It looks like you're trying to use RFM6x code with an RFM9x board
@north stream thank you, for some reason I thought you could just interchange them. Used their rf9x tx and rx and it seems to be working
can I get the code to make a neopixel blink with millis?
With millis? I think you might need to be a little more descriptive?
Are you trying to bitbang Neopixel data with timers, or is this something else?
I just want to get the neopixel to blink at a certain interval which is specified by millis()
for example 250 millis
I was previously using delay() but I quickly discovered its drawbacks
Ahhhh, I see.
unsigned long previousMS = millis();
unsigned long currentMS = 0;
bool pixelState = false;
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void blinkPixel(int blinkMSec){
currentMS = millis();
if (currentMS - previousMS > blinkMSec) {
previousMS = currentMS;
pixelState = !pixelState;
strip.setPixelColor(0, 0, (255*pixelState), 0);
strip.show();
}
}
@pine bramble this is untested code thrown together in less than 10 minutes, but that should outline the basic framework of a function that controls a single neopixel to blink on and off every blinkMSec milliseconds. Assuming I didn't make any silly errors, you should be able to call blinkPixel(mSec); in your void loop() to switch the neopixel on and off at the specified rate.
blinkWithoutDelay is also a good example - just switch out digitalWrite with the neopixel stuff
Anybody else have any issues getting the Arduino Nano RP2040 connect pass the adafruit circuitpython wifi connect test?
So I have been killing what feels like a lot boards trying to connect I2C touch pads (all different types of board). My latest 15 minutes ago was a Teensy 4.1. Can someone tell me how I made it smoke? Those are 4.7 k ohm resistors, I checked with a multi meter. That code was example code for the touch pad, the only thing I changed was add wire.h since it was a teensy 4.1 rather then the 3.2 that was expected. It powered on fine without issue, and only destroyed itself after I uploaded the code.
@noble oxide what result are you seeing? what NINA firmware is on the board?
Couldn't tell you re: Nina; just put the CP 7.1 install on it
i'll drop the errors here in one sec...
IP lookup adafruit.com: 104.20.38.240 Fetching text from http://wifitest.adafruit.com/testwifi/index.html Traceback (most recent call last): File "code.py", line 59, in <module> File "adafruit_requests.py", line 847, in get File "adafruit_requests.py", line 719, in request File "adafruit_requests.py", line 210, in __init__ File "adafruit_requests.py", line 297, in _readto File "adafruit_requests.py", line 241, in _recv_into TypeError: function takes 2 positional arguments but 3 were given
code is from https://learn.adafruit.com/circuitpython-on-the-arduino-nano-rp2040-connect/install-circuitpython
I believe that's due to a short-lived bug in the ESP32SPI library, what date of bundle are you using for the libraries?
it came with a project bundle but i can try to drag that library out and put another in from the 7.1 library i have on my machine
if that is the cause, you'll want the ESP32SPI library from 6 days or so ago, or the latest on the github library page (not yet in the bundle)
nod
yeah, I think the one you don't want is 3.6.0
so.. latest or 3.5.14
(latest should go into the bundle overnight)
oh thank you
i am yet to familiarize myself with how to download a library directly from github
(noob game strong)
thre's a Releases link, latest will take you here to download: https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI/releases/tag/4.0.0
btw, what's on line 59 of the code (making sure this isn't a detour)?
looks like r = requests.get(TEXT_URL)
it is indeed r = requests.get(TEXT_URL)
You are deserving of the highest of fives. Thanks!
that fixed it?
Yep.
cool
(just a little nugget to put in your back pocket... if you have trouble with any HTTPS sites and the NINA firmware isn't at least 1.4.6 , you'll want to upgrade that firmware as additional root certificates were added)
how does one check the NINA firmware version?
lemme check, I haven't done it in a while in Arduino...
ya don't stress yourself though!
there's an example in the examples folder in Arduino, should be something like this: https://support.arduino.cc/hc/en-us/articles/360013896579-Check-and-update-the-firmware-for-WiFiNINA-and-WiFi101
(upgrading instructions are here: https://docs.arduino.cc/tutorials/nano-rp2040-connect/rp2040-upgrading-nina-firmware)
thanks a ton i appreciate it
(basically WiFi.firmwareVersion();)
i've never run it in arduino just got CP on it
although i did download the arduino uf2 in case i want to work on it outside of Mu / aside from CP
so that may happen either way
esp.firmware_version in CP (assuming esp = adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset, debug=False) blah blah blah)
Hi Hem just wanted to let you know that this piece of code does not work
It was only provided as a basis for constructing an actual sketch, I skipped all the imports and tried to focus on the primary logic for switching the led on and off. If you need other examples, there should be a blinkWithoutDelay example you can reference in the arduino ide examples.
There is no void setup or loop, or any imports in my sample block haha
They're analog input pins, so you can do analogRead() on them. However, you can also use them as digital pins like the others with pinMode(), digitalRead(), and digitalWrite().
alright
#include "SevSeg.h"
SevSeg sevseg;
const int buttonPin = 10; // the pin that the pushbutton is attached to
int buttonState = 0; // current state of the button
int lastButtonState = LOW; // previous state of the button
int buttonPushCounter = 0; // counter for the number of button presses
long counter = 0;
void setup(){
byte numDigits = 1;
byte digitPins[] = {};
byte segmentPins[] = {6, 5, 2 , 3, 4 , 7, 8, 9};
bool resistorsOnSegments = true;
byte hardwareConfig = COMMON_CATHODE;
sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments);
sevseg.setBrightness(90);
pinMode(buttonPin, INPUT_PULLUP);
Serial.begin(9600);
lastButtonState = LOW;
}
void loop(){
buttonState = digitalRead(buttonPin);
if(buttonState == HIGH){
buttonState = LOW;
}
else{
buttonState = HIGH;
}
int i = 0;
while (buttonState == HIGH){
if (i>9){
i = 0;
}
i++;
sevseg.setNumber(i);
delay(1000);
sevseg.refreshDisplay();
}
}```
when i click the button first time it starts but it doesn't stops when i click the button again
I think you can simplify your buttonstate logic. You may also need some debouncing.
whats debouncing
Can you draw a schematic? I can't follow your wiring (my color vision is not great).
Does anyone know if the Adafruit Ethernet Feather wing (https://learn.adafruit.com/adafruit-wiz5500-wiznet-ethernet-featherwing) is compatible with the FeatherS2 https://www.adafruit.com/product/4769? I would like to move from an Arduino Uno that uses an ethernet shield to this. I also need to use 2 pins for a PWM output and 2 for a PIR motion sensor input.
Hmm, it's interesting that the code comments ask for a 470k resistor on R1 for I2C, while the silkscreen says the opposite...
Which board started releasing the magic smoke? was it the Teensy or the other circular guy?
@stuck trout physically and electrically compatible, yes. the ethernet featherwing uses 3V, GND, SPI, and a (configurable) CS pin. (CircuitPython version here: https://gist.github.com/anecdata/cdf0d931d8b2dee21775d34d0df69879)
@safe shell Great! I should be able to use it with Arduino code right? The S2 on its site says it supports Arduino and this board uses the same ethernet library I'm using. So it seems like I might be able to all of my existing code.
I haven't done it, but if the libraries support each board, it should b fine
When a mechanical switch or button is closed, the electrical contacts can physically "bounce" against each other for a few milliseconds before making full contact, so when reading the value at high speed you might see 0000001010111111111 with an extra 0/1 transition or two before it settles down. "Debouncing" handles this in software with a little filtering, for example making sure that the value is the same for 10ms before it's counted as a true button press.
It was the teensy
There is a resistor R1 on the back of the touchpad that I had to remove to switch to i2c. I think it's separate from the pull up resistors
k ty
#include <IRremote.h>
int RECV_PIN = A0;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop() {
// put your main code here, to run repeatedly:
if (irrecv.decode(&results)){
Serial.println(results.value, DEC);
delay(100);
irrecv.resume();
}
}```
whats wrong, im getting no error but when i click button in remote i don't see anything in serial monitor
that is my IR Receiver & im using same pins
also it gets heated up real quick and one pin of ir receiver is slightly bent
This is a bad sign, as IR receivers are normally pretty low power.
Yes, it likely indicates a wiring problem or a broken part.
Or a wiring problem that caused a broken part...
That's kind of a stupid question, isn't it? Does it have a compartment for a battery?
idk its different from the normal remotes i use
Well, look at the back and see if there's a battery door...
Possibly it uses a coin cell instead of cylindrical batteries.
hmmmmm
is my receiver alright?
well i just took the tray out its super weird & i dont think any battery can go innit
Generally it's not possible to tell electrical problems just from looking at a part, unless there are burn marks, heh heh.
oo
Those types of remotes almost always take a coin cell
oh
Iβve seen several of them.
oh
the tray is too big for it if ur talking about the tiny cells
it got no manual
Those remotes almost all take a CR2025 coin cell battery.
Something like these
You can buy them in packs online
wait can i use any remote? and whenever i click with any remote the ir receiver will detect it?
As long as the receiver is plugged in correctly, and that your remote has an IR transmitter in it, yes.
wait yes it takes cr2025 its written small
Almost all remotes do have IR transmitters, unless youβre talking about roku remotes or something like that
i see
Some of the newer roku remotes are Bluetooth or something like that
But yes, 99% of remotes that you Point at the ir receiver should give you an output in the serial monitor, as long as the receiver is wired correctly
I took an ir receiver out of a toy and used it with my Arduino
also my ir receiver has a very small brown mark
Thatβs not very good
oh
I wonder why
cuz it got bent?
It could be either rust on the terminals, or more likely a burn mark
You did say it got quite hot
yes it did
k imma test it with working remote
well it ain't working
and it gets hot like super fast
btw im connecting the ir with jumper wires
Getting confused with the difference between the ESP32 and ESP32-S2β¦ with Arduino is it possible to connect to wifi and then go into a Lower power state but keep the wifi connection?
My project is just a PIR sending an email on trigger
I already have it sending an email just fine .. Iβm just looking to make it last on a battery as long as possible
Light sleep would pause the code β¦ do I want to do a wake up on pin interrupt?
the wifi connection is not kept up during ESP-IDF sleep modes - it requires a lot of power
you can do deep sleep and then reestablish wifi - that is the most power efficient way
ESP32 does not have native USB - the USB connection is a serial converter. There are many other differences too. The ESP nomenclature is confusing
Ahhh .. thanks for the info .. let me add more clarification⦠we have car break ins in my community and was hoping to have the wifi hold for even faster notification
Deep sleep might have to be the answer.. TY
Are you sure you have an IR receiver and not an ir transmitter hooked up to your Arduino
The IR transmitters are just special LEDs, and those can get hot without proper resistors hooked in with them to limit the current.
IR receivers however, can be hooked up to an Arduino with no resistance whatsoever.
Provided you have the proper voltage going into them, I see no reason for your receiver to be getting as hot as it is.
A transmitter would generally just be two pins, I think, so having three is a good sign he does have a receiver.
Hi everyone! Had a question regarding level shifting on a W25Q64 flash chip on a breakout board with an Arduino Nano. I found this tutorial on adafruit https://learn.adafruit.com/trinket-audio-player/loading-sounds that does essentially what I want to do on a similar flash chip (Winbond 25Q80BV instead of W25Q64) but to my understanding based on their datasheets, they're both electrically equivalent. However, I noticed that the DO (MISO) pin (data from flash into the MCU) does not need level shifting. In fact the tutorial states: "Also, note that the data output line back into the Arduino (pin 12, blue wire) connects directly, there are no resistors on this line." My question is - why doesn't DO need the level shifting? In the datasheet the electrical characteristics state that the voltage applied to any pin must be from -0.6 to VCC + 0.4 so I'm a little confused on that. Would it be okay to not add a voltage divider on my flash on the DO pin? Thank you!
If I'm understanding you correctly, the DO line is going from a 3.3V flash into a 5V Nano. Since it's a lower voltage, it's within the VCC range of the Nano, and you wouldn't want to divide it any lower.
Yes! That's correct. The flash is 3.3V and the Nano 5V. I thought all the pins on the flash chip needed to be level shifted based on what I saw on the datasheet. I also thought MISO would be working on 5V as well instead of 3.3V from flash. This is my first time doing level shifting on an SPI device using a voltage divider and not a breakout board with ICs so I got a bit confused. Thank you for your response! I really appreciate it
Does that help?
Is it possible that your device is drawing too much current from the 3.3V pin? 250mA is not a lot.
I checked and the touch pad barely draws any power. Well under 250 mA. It only draws 3 mA
@leaden walrus I'm back with another pins_arduino.h question. ItsyBitsy RP2040 this time.
@leaden walrus There's two WIREs defined. But I don't see two I2C options on the board. I know you told me defining things in that file does not imply their existence. But I'm worried I'm missing something.
Also I don't know how to associate these defines with the appropriate pins. What does the (#u) mean to begin with?
the u suffix just specifies type, the parans are there as part of cpp lore (i forget the nuance why for that)
I don't see anything wrong with your wiring. Did you smell burning? I'd suggest soldering some headers on the board and soldering jumper wires on the touchpad, so you can wire it up more easily
this bit me on the feather rp2040 the other day
How so?
that core doesn't allow remapping, so the GPxx pins are what they are
Right. That I did know.
i.e. in arduino, you'd use the GPxx numbers (bottom silk)
Yah
Or look at the PrettyPins for the GPIOx number if it's not on the board (it is on Itsy)
was actually going to ping you about that on the feather - like add a warning or something to guide. but may be part of larger still-updating-guides-for-arduino effort?
I'm in the middle of adding Arduino templates to RP2040 guides.
I saw the smoke and hear a crackelling
Feather is third. In the arbitrary list I created.
Well fourth. KB2040 is done.
Working on Isty, then QT Py, then Feather.
ok. so the info will get in there eventually.
There's a section that explains using the GP numbers
yeah
Paragraph anyway. Not its own section.
you can generally turn the (24u) syntax into just 24 which then corresponds to GPIO24
Then why are some of the other ones the same number? Are they the same pin? That's what confused me. A lot of pin 31 in there.
there's the two i2c locations
And if that's the case, then the SCL/SDA printed pins are WIRE1 which doesn't make sense.
Oof ok.
So that's accurate.
that's another feature of the core
any SCL1/SDA1 pins are Wire1
no way to make them Wire
Right.... but this is SCL/SDA, shouldn't they be WIRE0
Wire is any SCL0/SDA0 pin
that general mapping is hard wired somewhere lower in the core
feather has the same feature
which is confusing - been lots of forum post about it
fix is always just change code to use Wire1
Well Feather has STEMMA which I thought in some cases was specially SCL1/SDA1, which is what has confused me.
QT Py is different.
Oof.
Ok.
I wonder why it was decided to default to WIRE1.
Not that it matters. That's what it is now.
i think it goes in the other direction
the core was designed so that any use of SCL0/SDA0 pins ends up as Wire and SCL1/SDA1 pins as Wire1
then, for any board, pin choices come down to decisions - like which ones are easy to route to STEMMA, etc.
and (guessing) that can be higher prior than ensuring STEMMA ends up being Wire vs Wire1
Hmm
I guess I assumed that, especially on a board without a STEMMA connector, the silk-labeled SCL/SDA would be WIRE0. Incorrectly so.
yep. and unfortunately a source of confusion.
Bleh.
Alright.
Welp, the guide will explain it.
If I can manage to get it right for the guide π
yep. that'll help. and at least give us something to link to.
Ok. Heading back into guide land. Thanks for your help, @leaden walrus!
Thanks!
Bump... Still can't find any way to get it to work...
Well, I followed the instructions for Windows 10:
Windows 10 and Windows 8
In Search, search for and then select: System (Control Panel)
Click the Advanced system settings link.
Click Environment Variables. In the section System Variables find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
Reopen Command prompt window, and run your java code.
But I got an error.
Hi y'all!
I'm trying to run img2code on my Windows 10 laptop. I installed JAVA but when I type the command, "./gradlew" in the command prompt, nothing happens... well, not in the foreground. It seems something happens very quickly in the background but too fast to see what it is.
The ReadMe files on GitHub and in the Zip are useless - unless one is already a JAVA geek. Thanks!
I should mention it didn't happen immediately it took like three or four minutes before it happened
Could it have been something in the software that broke it?
i don't see how. I can't see your soldering on the bottom, so maybe there are some shorts somewhere. That was why I suggested using headers and jumpers instead, to make the wiring easier to control (and disconnect and check on). If you measure voltages, are things way off?
Like I said it's dead as a door nail
do you no longer see 3.3V on the 3.3V pin?
I have another one soldered and ready to go
if you disconnect it from the touchpad, is it still dead?
Yes still dead
can you see which component burned?
so no 3.3V?
i will be afk for a while in a couple of minutes
This is the good board so nothing's burnt, but I know the thing besides 3.3 volts went
But I don't know if anything else went
take a picture of the other side
if there was a short on the touchpad, it might take the regulator with it, though usually the regulators have short protection. or something got reverse voltage somewhere. burning means there was some high current somewhere
my guess is that ground and 3v got shorted, but I don't know how
maybe put headers on the new board and cut some jumpers and solder to the touchpad, and use a breadboard
ok gotta go
Ok thanks
you may have just fried a trace with the high current
I plugged in the second Teensy 4.1 after testing everything with a multi meter and this one worked..
I am getting 0 RTD resistance from MAX31865. this issue occurs randomly and continuous(if issue occurs is will be gone continues about 20-30 data) about 2% (tested 10000 data). Could you please suggest any reason and solution for this.
Any chance you have a logic analyzer where you could capture the SPI traffic during one of these events?
how do I store the last reading from a sensor in a different variable
like for example
3.67
4.53
I want to save 3.67 in a different variable maybe previousvel
and then the cycle will continue so I get a new value and then 4.53 is saved in previousvel
previousvel = currvel;
currvel = getValue();
Assuming variables are already defined, and getValue() is the placeholder function to acquire a new value
@pine bramble
ok
I did something very similar to this but the values are the same
ok
#include "BMI088.h"
Bmi088Accel accel(Wire,0x18);
/* gyro object */
Bmi088Gyro gyro(Wire,0x68);
void setup() {
// put your setup code here, to run once:
accel.begin();
gyro.begin();
}
float previousvel;
float currvel;
void loop() {
// put your main code here, to run repeatedly:
accel.readSensor();
/* read the gyro */
gyro.readSensor();
previousvel = currvel;
currvel = accel.getAccelZ_mss();
Serial.print("Previous Value: ");
Serial.println(previousvel);
Serial.print("Current Value: ");
Serial.println(currvel);
}```
this is the code