#help-with-arduino
1 messages · Page 55 of 1
PIC side has solution for this you manually clear the interrupt flag but AVR automatically clears so things like that happen
you can disable global interrupts (was it cei()) at the start of function pointer and enable again in the end
If its not absolutely timing specific (like I2C address match) we use global variables (usually boolean) and do what we supposed to do in looping part
with an if or somethign
"when its not doing ISR it retriggers" what exactly do you mean with this?
I provide a function for testing ISR behavior(withut having to configure it)
I doubt that it will be used for stuff like RTOS scheduling, because avr controllers do not support real software interrupt triggering
on the other hand I do not understand why function calls from ISRs would cause weird behavior?
do function calls enable interrupts :O?
If program is not on isr pointer then isr can retrigger
has anyone put a airlift or bluetooth add on to the NeoTrellis M4 ? It looks liek we only really have I2C available easily. I mean, I coudl cram a whole other arduino in there, but that sounds silly. The other option is use two of the non-M4 Neotrellis boards and chain them.
when entering the ISR, cli() is implicitly called, if I'm not mistaken. So an isr should not be triggered again?
a subroutine/function call should not enable interrupts, so I do not quite get what you exactly mean :/
(I'm a beginner, I'd say, maybe I'm missing some concepts there)
this is the weird behavior I meant(atmel studio)
Yeah yeah you're right
I'm thinking again
little thing there is _delay_ms(double __ms) fuction in <util/delay.h> if you define F_CPU in avr-gcc compiler
https://www.nongnu.org/avr-libc/user-manual/group__util__delay.html
hm, I tested the found interrupts that are instantly triggered after being enabled with the atmel studio simulator also triggers.
in that example above you should see some breakpoints for debugging
I didnt start atmel studio
hm k 😮 I did a new example to show that found behavior 😄
I start to think there is a interrupt happening with higher priority like reset
but that shouldn't be possible either they should be disabled
I defined for every of these interrupts the corresponding ISR
all of them are instantly triggered after being enabled
well in the interrupt priority order they should but not repeatedly
you said it triggers repeatedly?
hmmm actually interesting idea do you ever touch with any of the flag bits
well, in the other example they did kind of do a loop
all I did in the other example was
are they being cleared properly?
enable individual interrupt
no, there is nothing being cleared
so that might be the reason why
they should automatically but IDK
external interrupts for example require clearing the pending bit, otherwise it triggers indefinitly again
maybe since its been called manually it might not
enabling the individual interrupt
triggers the interrupt instantly
as seen in the screenshot
triggered interrupt -> calls function pointer -> triggers again cuz not cleared
I would guess
yeah thats what i said in first place 🙂
what about this does it trigger infinitely too? (without manually triggering
ISR(vect) {
Blink(5, 200);
}```
I think the part about them being triggered instantly was unclear to me without the testing just now 😄
the code in the screenshot above does triggered infinitely
ohh thats the point dude cpu dumbs program pointer and all the necessary registers into stack and then go into interrupt pointer after interrupt done, takes registers and program pointer from stack and continue on
so is it fixed or not
my fix would be not to enable interrupts individually if one wants to test the fucntion pointers.
and if the person wants to use the interrupts, they would need to configure the interrupt sources anyway
as well as clear the pending bit
I'm even more confused than start so ill leave at this point too.
thanks
has anyone put a airlift or bluetooth add on to the NeoTrellis M4 ? It looks liek we only really have I2C available easily. I mean, I coudl cram a whole other arduino in there, but that sounds silly. The other option is use two of the non-M4 Neotrellis boards and chain them.
@green sable I found this in adafruit board tourtwo pins that can be used for I2C, ADC, or a UART.
so they are sort of multiplexed (from what i understand) so you should be able to communicate with HC 05 or something like that
Hey, I'm looking to start a project, but am a bit of an Electronics Noob so would like to get a bit of advice before I set off and inevitably blow myself up. So I have a Husky Mini fridge that is connected to the mains (240v). I want to setup an Arduino with LED's on the inside of the fridge connected to the power that is currently connected to the internal light bulb (measured at 240v). The issues I have is what would I need to convert 240v down to LED territory (12v?) and can an Arduino then run off that power, or does it need to be stepped down again? Can that be done with a resistor on the Arduino board? And finally how easy would it be to "waterproof" that enclosure. I feel like because it's in a fridge the heatsink wouldn't be too much of an issue
@restive acorn I'm sure there are any number of small converters that would handle it... I mean small converters for phone charging take mains voltage all the way down to 5v with no issues. These parts are pretty common! Depending on what you want the LED's to do, you coudl even run some "neopixel" style strips right off the same 5v for the arduino.
hey guys hope everyone is safe, do you guys know of a arduino input shield? One that can do 8 24V inputs
@green sable I want to run about 2.5m of LED's
preferably the 144/m RGBW
Do you have any recommendations on converters?
@restive acorn If you want just illumination or static color you don't need arduino
I thought about that, but what's the point in a project if you can't make it do cool stuff!
efficiency? usability? reliability?
function?
hey guys hope everyone is safe, do you guys know of a arduino input shield? One that can do 8 24V inputs
@chrome lion here is your common ground 8 times 24V shield
made by paint squad with collabration with snipping tool 👌
lol ok thanks @cyan jasper
Efficiency? If you mean Power Efficiency, the fridge is on 24/7, I doubt the power intake from a LED strip and an Arduino is going to factor
Usability? LED strips with no Ardunio have on/off, So I'd be adding to the usability. Could have a sensor to tell when the door is open or not to change the lights.
Reliability? Yeah you got me there, definitely less reliable. But I could always revert it back to being static LED's.
Function? FUNction
no no like you didn't want lightbulb because inefficient and LEDs for efficiency etc.
the lightbulb already senses door and switches 220V
The lightbulb is never on at the moment because it's right at the back of "beer" fridge, and incredibly dim anyway
It's not a Kitchen Fridge
well be careful with 240V, it's just maybe a bit dangerous for starter thats why i kind of hesitated but have fun I hope you like electronics
Hi, I'm having trouble with USB communication on my Uno R3. I asked in the forum, but it doesn't seem like anyone has an idea. Here's the link to the forum post: https://forum.arduino.cc/index.php?topic=681447.0. I'd be happy if anyone took a look. All ideas are welcome. Since it's already broken, there's not much to go wrong.
Arduino TX seems to be broken
A quick assessment of the situation is "Yep, it sounds like it's fried, get a new one". 😅
The nice thing about some Arduinos is that the chip is socketed and can be replaced.
stacking 2 12v fans on top of eachother would that give less, equal or more airflow? 😛
Are they blowing the same direction? Are they both running?
@elder hare You may have intended this as a joke question, but it actually is kind of interesting physics. Have you ever noticed that if you block the air intake on a fan, the fan actually spins faster? Similarly if you put a fan under a vacuum it would spin a lot faster, since it isn't doing any work against the air. If you stack two fans, even though you might say "each one moves X CFM, so together they should still move X CFV" in reality, they are each making the other's job easier, which will allow them to spin faster, move more air, and each one will draw a bit less power than it would by itself. It isn't going to be anything close to twice the airflow, and if you had really overpowered fans which didn't get slowed by the air at all, the effect would go away, but for a typical pair of muffin fans, it really will move more air.
Actually it shouldn't increase flow if there is no static pressure. Which means you can push air through finer filter or can get it to do more loops but no difference of volume or speed.
Soon you get into turbine physics
(there are dual axial server fans for 1u servers works just like this because they are really crammed and pushing air is really hard and as side benefit it is more redundant incase of fail)
(they also run different sides with mirrored blades to decrease turbulences)
No such thing as a situation with no static pressure outside of a vacuum. While there may not be a lot in open air, it's still non-zero. In a typical situation where you are ventilating something there will be a pretty significant amount.
(I will agree that in open air it approaches zero, but the usefulness of running a fan is true "open air" is debatable). May need to move this discussion to a bar 😃
(and clearly putting the fans next to each other rather than on top of each other will move more air)
How best to communicate between two esp8266 boards? (not MQTT)
(I will agree that in open air it approaches zero, but the usefulness of running a fan is true "open air" is debatable). May need to move this discussion to a bar 😃
I wasnt disaggrening your point 🙂
How best to communicate between two esp8266 boards? (not MQTT)
@tidal sonnet TCP server?
I kind of want to say wired but probably not a choice right 👀
Well I want to do something Wifi
probably tcp then
(this might not be correct) its like UART but for WiFi. (It is just my implication because you can bind TCP socket into a communication port)
I'm having a bit of trouble with arduino. In my class definition of the header file I have
static constexpr uint8_t NR_MULTIPLEX_BITS = 4;
In my cpp file I put:
constexpr uint8_t Flowerpot::NR_MULTIPLEX_BITS;
But I'm getting redefinition of 'constexpr const uint8_t Flowerpot::NR_MULTIPLEX_BITS'
if I remove it from the cpp file I get an undefined reference to error instead
how should you actually define it`?
oh nvm looks like I actually defined it twice
guys
using adafruit ssd1306 library on an adafruit ssd1306 display i2c
I'm trying to dim the screen using this command
display.ssd1306_command(0x81);
display.ssd1306_command(10);
display.ssd1306_command(0xD9);
display.ssd1306_command(1);
can you tell me what is the maximum value for the 0x81 and for the 0xD9?
what is the default value in the library?
I can't find it inside the adafruit's code
can you help me please?
please quote me if you answer me
@gilded jay For 0x81, 0x00 - 0xff (page 36 https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf)
For 0xD9, page 40 just says "This command is used to set the duration of the pre-charge period. The interval is counted in number of DCLK, where RESET equals 2 DCLKs." and doesn't give a range
@north stream thanks for the answer. But how can I set a value without a range?
I don't know. I suspect "pre-charge duration" is not a value you'd need to change anyway. 0x81 is described as contrast control, which probably isn't the same as brightness either (I'm guessing you'd set the brightness by adjusting the backlight, but I don't know about that display)
@north stream on ssd1306 you have only two values to set the brightness
0x81
And 0xD9. A low 0xD9 helps lowering the brightness, I tested it, but I don't know the maximum value for this setting. Even the default value used by adafruit's library could be ok for me
But I don't see any default value in the adafruit's library
Ah, it's an OLED display, no backlight.
looks like a boolean to 0x81 for contrast is what the Adafruit Arduino library uses for dim
it's either dim (lower contrast) or not, that matches how I see it in my Arduino ssd1306 application
Hi, so I'm trying to use the <SoftwareSerial.h> library with the Feather M4 Express. The same code compiles perfectly on my Arduino Uno but on the Feather I get an error saying: C:\Users\pecah\Documents\Arduino\libraries\SoftwareSerial\src\SoftwareSerial.cpp:45:10: fatal error: util/delay_basic.h: No such file or directory. Any help would be VERY appreciated.
The SoftwareSerial library seems to be AVR-specific rather than cross-architecture. The M4 should have several UARTs, though... any chance you can get away with additional hardware serial ports instead?
That would actually be ideal I think, how would I do that? There seems to be only one pair of TX/RX pins on the Feather?
I can't immediately find the exact tutorial, but this is for a chip with similar SERCOM peripherals: https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports
This also mentions how to patch the util_delay.h error if that's the only thing keeping the SoftwareSerial library from working (though there may be additional issues): https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/adapting-sketches-to-m0#missing-header-files-7-9
It took me a while to get all of the kinks worked out (I left the room with the motor spinning and the wires got coiled around it and broke a lot of things lmao) but in the end the SERCOM pins worked very well, thank you!
Excellent!
So I’m still having issues with my seesaw boards getting corrupted. They’re work fine for a long time then I’ll power it up again and the board won’t be found. I do have one of the seesaw boards on 3’ of wire. Could this have anything to do with intermittent working/corruption?
Hi all, I was trying to have a pattern on my neomatrix that looped until a button was pressed. I have code that kind of works, but the pattern will only play once and then the button will only change the pattern once the previous one has completed. Can anyone help here?
Normally I’d say using an interrupt pin for the button, as that will interrupt the main loop and run whatever function you need, but because of how buttons bounce I’ve heard it’s not great to use them with interrupts. I’ve fixed a similar problem by doing my check for a button press in the middle of the loop that would go to the next part of the pattern, and if the button state changed, break out of the loop with “break”
Ok guys I’ve narrowed my issue down on the seesaw breakout. It seems very strange but maybe it’s obvious to someone out there. I’m running a feather M0. One of the seesaw pins I’m using as a simple on/off so I used my volt meter to watch the signal. I’m also making pin 13 blink on the M0 so I know things are running even if the serial port is closed. Seesaw is powered by 3.3v.
When I watch gpio seesaw pin 9, if I DON’T start the serial console, the pin high voltage sits at 2.82v and stays there even though in the code I toggle it high and low. The led blinks so I know it’s running.
If I open the serial terminal on startup, the light blinks and the pin toggles from 3.3v to 0v as expected.
I’ve tested this many times and it only toggles when the aerial terminal is open. What am I forgetting?
The Adafruit page mentions a pull up resistor May be needed when using i2c. If I don’t have those installed, would that explain why the serial terminal would cause it to work?
I’ll send a screenshot of my test code and a video of my testing
Running the same seesaw but swapping out the M0 with a 32u4 the pin toggles from 0v to 3.2v as expected whether the serial port is open or not.
Therefor there is something different about the m0. Is this a pull-up resistor issue? 🙂
Adafruit learning guide says pulls ups may be required for both M0 and 32u4. Any ideas on why 32u4 works and M0 only works if serial port is open? Sorry for the plethora of posts. Trying to give as much info as I can to try to make it easy for someone to diagnose.
For what it's worth, it doesn't make much sense to me, so I don't have anything useful to offer. But someone's reading your explanation, at least. 😉
Said simply: the seesaw blink example code works with the 32u4 attached no matter what.
If you run the same code using a M0 the example code only works with the serial port open.
At least it wasn’t me wiring something incorrectly. These are the darn nuances that keep me up at night 🙂
Hello Guys
Need a small help
Has anyone interfaced NodeMCU with FauxmoESP
I tried but seems nothing happening
No output from Serial Monitor
No response in Alexa app
Can someone guide me in this process
Thanks and Regards
@pranaovs
Is there a reason why some HX711 modules use a metal shield/cover while others don't?
Probably just noise reduction
Hi everyone, I am very much a NOOB and trying to get my Feather Hazzah to work let alone do anything. Ha ha. After searching the internet on how to connect my Hazzar to the Arduino IDE I found I needed to download a driver which I did from Adafruit. Problem is no matter how I try, I can not get my desk top or my laptop to recognise the drive to show up in Device Manager. So consequently Arduino IDE doesn't allow PORT to work!!! Can anyone HELP !!!!!
@fiery lichen The first thing that comes to mind: you have to decide if you're using the serial port, or not.
Your code works, unmodified, because you are using the serial port.
I'd guess that the code halts because it can't talk to the Serial Monitor, because you didn't open it.
You can make this explicit in the code, but you will need some other way to notify you that the serial port never started. ;)
Does the Hazzah have to be connected to the pc for the driver to show up on the computer as a start point? I'm thinking it shouldn't make any difference. BUT if that is the case maybe I just have a faulty Hazzar???
@somber scarab They're never faulty, pretty much.
The Huzzah uses Silabs CP2104 as the programming interface. That's the driver the host PC talks to the Huzzah target, with.
Since this chip is used in a lot of places, chances are very good the host PC already supports it.
So the problem devolves into recognizing CP2104 on the host PC.
(The host PC has 'no idea' the that the CP2104 is talking to the main chip of the Huzzah, ESP8266).
🛩️
CP2104 Friend:
http://adafru.it/3309
PiUART:
http://adafru.it/3589
They're all the same chip, and use the same method to talk to the host PC.
The CP2104 Friend base page says:
For Linux you won't need a driver. For Windows, it will automatically grab the driver from Windows Update. For Mac OS X you can check out SiLabs driver page for the latest and greatest.
(Silabs link there is a 404 Error)
I don't see any reason why these drivers won't work:
https://www.silabs.com/interface/usb-bridges/classic/device.cp2104
Use Software & Tools tab to access them.
CP210x VCP Mac OSX Driver v5.3.5 is dated 3/2/2020
Windows should self-supervise; Linux already has the driver.
I have managed to get the driver to show on the Device Manager (Thank you) 🙂 but showing an orange triangle but says it has latest updates. Silly question and please excuse me being a complete NOOB. The Arduino Uno doesn't need a power supply for it to work on the Arduino IDE. Does the Hazzar need a separate power supply for it to work on the IDE?
No need to apologize for inexperience (just let us know your skill level so answers can be tailored to what you know already).
As far as I know, just about all USB connectors on target boards power that target (unless there are two of them).
I don't have the Huzzah, but plugging in its USB connector would be all I would expect to have to do to power it.
Would this be the same thing as commenting out all the serial commands and the serial.begin?
It’s just confusing because the led blinks which means it’s running the loop code, but it’s not toggling the pin. The code also is running with the serial is open, but the pin toggled correctly.
32u4 I can load the identical code and it will toggle the seesaw pin whether the serial is open or closed. Something is different about M0 vs 32u4 but I’m not sure what. They both run the code differently
I just tested the M0 with only the seesaw hooked up and all serial commands commented out.
The led blinks on and off saying it’s in the loop, but the voltage sits at zero. I’ll post the updated code.
On the breadboard I pulled out the M0 and dropped in a 32u4 without moving any wires, the 32u4 blinks the led and the seesaw toggles no problem wi th serial off.
@fiery lichen I didn't test this code; it's in a gist and may have syntax errors (no hardware on hand or even the Arduino IDE, lol):
https://gist.github.com/wa1tnr/960cd330e32390fc22d3e5de4944bee8
I spotted an error or two and corrected them. ;)
As a Forth programer I tend to use a lot more simple functions in C++ than you're maybe used to seeing. ;)
Ok compiles. Lemme try
Updated.
I'm doing this all in my head; not tested on hardware or in the IDE. ;)
The protected use version (with the #define statements, #ifdef stuff) .. may need some tweaks to get the desired feedback from D13.
Ok so if I run your code on 32u4 or M0, both require serial port open and the pin 9 toggles
Keep in mind that code bracketed by #ifdef .. #endif isn't even seen by the C compiler.
The C Preprocessor looks for those directives, and strips out the unwanted code.
If I leave serial port closed it won’t toggle
Try the second version.
And change the #define at the beginning for no serial port.
Second version? I see rev 7 on github
#undef USE_SERIAL should follow the #define (swap the two lines).
So you define it, then immediately #undef it ;)
Sorry, I don’t follow. If I want serial off do
Define
Undefine
And if I want it on
Undefine
Define
Correct?
Ok I did define then undefine
The seesaw board didn’t blink so it never initialized
USE_SERIAL means just that.
It has to be defined.
Otherwise the C preprocessor won't know about this symbol, and the #ifdef directives will fail (the code following won't be compiled into the program at all).
#define followed by #undef is exactly the same as an #undef on its own. ;)
The #undef just makes this explicit: the symbol is not defined, even if it was, previously.
You can manually strip out everything to the exact same ends; using the #define or #undef is a convenience feature.
Ok so I went back to my code jusy to be sure things are still working. Code runs, initialized the seesaw and the pin 9 toggles. Now back to your code
Remember that any Serial.println("foo"); requires the Serial Monitor (or equivalent).
Well that’s the thing...
I’ve commented everything out regarding serial commands. This code blinks the led, initializes the seesaw but the pin 9 does not toggle
The i2c address has to be right.
We have the same address 0x4c
So that 0x4c worked in some other use case, right?
Worked on all my code
I'm a bit surprised it's required at all.
But it should of course continue to work.
I have to look at the SeeSaw module example to see how they want to initialize GPIO on the ATSAMD09.
It's the pinMode and that's already good,.
Using serial window for both of these tests using my basic code, if you don’t leave the ELSE command in, the pin will not toggle. With the ELSE left in, it toggles with the serial window open. Not sure if that’s a clue
Video hopefully shows that
but I need the 0x4C because that's the address for this i2c chip
it's not the default
What chip?
You think you have it set to 0x4c ;) would be my guess, there.
Try all four variations. If none succeed, that's important to know.
Try a fifth (entirely fictional) address as well.
removing the address gives ERROR. 0x4C properly starts teh seesaw board
Hmm. ;)
What's different between a 32U4 and a M0 where the 32u4 runs the code whether the serial window is open or not but the m0 runs the exact same code but only toggles the seesaw pin if the serial windwo is open
I admit I'm not super well versed in this stuff, but is it possible it's a compatibility bug with the seesaw and the m0?
Doubless the SeeSaw was tested against the M0 but not against the (much much earlier) 32u4.
People always tell me to move to the faster chips. Seems like the 32U4 always works for me, but I always run into sticky stuff like this on the newer ones. I must be getting old lol
SeeSaw (ATSAMD09) talks via SDA and SCL to the host microcontroller.
Right, the wiring is exactly the same for both boards
Oh I wish I had 32u4 experience, but I was disinterested at the time (I was still on 8051).
Any serial port issue is entirely orthogonal to any i2c issue. ;)
Sounds to me like the 32u4 board support fails over differently than the M0 board support.
Well it fails correctly then 🙂
I would say the M0 protects you from your assumptions. ;)
I ran M0 boards until the M4's came out.
I'm runnning adafruits example code for the digital seesaw pin out and it only works with the serial window open as well.
Feather M0 Express is still a very good go-to board.
I'd love to use it! But it ain't working for me 🙂
The Serial Monitor shouldn't matter as the dialog happens via i2c.
shouldn't, but I can literally A B A B, where if the window is closed it doesn't work, if the window is open, it works, and back again
I understand that, but cause and effect aren't clear.
then we agree 😄
For example, the i2c pins on the microcontroller need to be setup.
that happens in the background in the seesaw library I would think
because all that background stufff is waaaay over my head
ok. Lots of files.
Do one of these files say "m0 doesn't work without the serial port open.....we're working on that! Hold tight!" 🙂
I'd be frustrated,but at least the 32U4 works for my project. Just wish I knew why the M0 doesn't so I can advance my skillz and learn why its acting differently 😄
But it does work. ;)
You just have to use the Serial Monitor.
I would use the M0, accept the tradeoffs, and use the Serial Monitor, with an eye towards not having to use the Serial Monitor. Pick your battles.
I don't think you need to use the Serial Monitor, when the code is corrected.
I just don't know what that correction .. is.
When I want to 'turnkey' a project I usually leave the serial stuff going, but not required.
So I can optionally hook up the USB cable and see the messages, but I don't have to do so.
my project doesn't require serial. The only reason I have the monitor open is because the m0 doesn't toggle the seesaw pins without it
🙂
Right, understood.
well, if anything comes to anyone, let me know. I can use the 32U4 without the serial monitor to make it work, but I feel like I'm in the stone age. But hey, the wheel worked in the stone age right?:)
I think the stone age was wheel-less.
while (!Serial);
while (!serial) keeps it looping waiting for a serial window.....
That waits forever for the Serial Monitor.
right, but thtat's not in any of the code
The loop code is running with the serial closed because the LED is blinking, I set that on and off in the loop. The seesaw toggle is not working in the loop, but it does initialize correclty
The ss.pinMode(foo,bar) needs to run once.
That sets up the pin mode to OUTPUT on the ATSAMD09 SeeSaw module itself. it's an i2c command given to the SeeSaw module from the host micro (32u4 or M0).
correct, that's in my code as well
if(!ss.begin(0x4C)){
That can be used to test for success. It presently tests for failure.
void foo(void) {
if (ss.begin(0x4c)) {
bar();
}
}
@fiery lichen Does it work when you only do the Serial.begin and no Serial.print? Then it's probably something being set by the begin function that the M0 needs for I2C later. I've had the same sort of problem a while ago, can't really remember what board I was using.
The order in which things were setup may make a difference.
https://github.com/wa1tnr/seesaw_m0/blob/master/seesaw_pwm_freq_bb/seesaw_pwm_freq_bb.ino#L42
// setup: Metro M0 Express, 4-wires: SDA SCL 5VDC GND to Seesaw Breakout
#include "Adafruit_seesaw.h"
Adafruit_seesaw ss; // i2c driver
void setup() {
Serial.begin(9600);
while (!Serial) {
delay(44);
}
if(!ss.begin()){ // remember this is i2c - an i2c conversation has just begun
Serial.println("Error");
while(1);
}
else Serial.print("seesaw started ");
delay(400);
}
Translate?
Looks like, if there's no serial terminal, wait 44ms....
if ss.begin, then print seesaw started
It'll just loop with a delay of 44 ms.
buuuuut, I want it to run whne there's no serial
Other than the unusual address 0x4c there just isn't anything interesting going on with that project you have, making this complicated.
The while (!Serial) waits for Serial Monitor to connect, so that you don't miss the first messages printed.
If you omit it, the program assumes a connection has been made, and begins printing to the Serial Monitor.
If the Serial Monitor was never started, in Linux, this isn't an issue. Things will work the same as if it was started, anway (you just don't see the messages).
Your D13 blink and the Pin 9 (ATSAMD09) blink tell you if your program is running, irrespective of serial print statements and the like.
If you omit every single reference to the Serial port, that makes things explicit.
Then your program runs with no reference to the Serial system at all, just i2c.
🌤️
Ok I’ve made it stupidly simple now to try to narrow it down. Here come some images
;)
No seesaw initialization. Led blinks. Good. M0 is working. Next:
Add the seesaw initialization. No blinking so it doesn’t go to the loop
It won’t initialize without some sort of serial command it seems
And with just the Serial.begin before the ss.begin?
Adding the else serial.println(“seeesae solenoid started”) causes it to go into the loop and blink the led on the micro
There could be a broken lib somewhere.
And that’s where I got to at about 2am last night lol
The Serial.println("foo"); may be harmless (it'll print whether you monitor or not).
Right. And that works for the 32u4.
BUT on the M0 the monitor MUST be open or the see saw doesn’t toggle the pin
32u4 the pin toggles
That’s why I’m thinking there’s something broken on the backend. The Adafruit example code doesn’t work unless the serial is open for the M0, it works perfectly if you use a 32u4
Try Serial1 instead of Serial.
So just change to serial1.begin(9600)?
I don't think it has any means of sensing if TX and RX are connected to anything external.
Yeah it sounds like a workaround for now, to help in putting this on the back burner.
Just be consistent .. change all references.
Lemme check
So every single Serial. is replaced by Serial1. in your code. All of them.
That'll cause it to try to talk on the USART.
Serial and Serial1 are two different SERCOM's.
Serial refers to the USB port and Serial1 refers to the USART (the TX/RX pair).
HOLY CRAP ON A CRACKER! IT WORKS!!!
Yes please
You want a screen shot or you want me to copy and paste the code right in here?
Screen shot is ok
But now you still have the Serial connection.... didn't you want to do without it?
I want the program to run without opening a serial terminal window
The only way the seesaw toggles before was if the serial window was open
I couldn’t, say, power the board from usb without a terminal or from a wall adapter
32u4 worked fine with plain old serial instead of serial1.....M0 has something funky going on
But that’s way above my smarts 🙂
Can we all just agree to blame noe and Pedro? :);)
I'm glad you got it working, I'll keep this in mind for my Feathers
In case you guys were wondering why any of this was important......
;)
Wow, that is so cool! 👍
I still have some animatronics ideas that I should turn into projects some day, this gets me excited again!
It’s a labor of love and lots of fun.....except when you hit a serial port road block that makes no sense lol 🙂
Wife asked me “you look distraught and you’re awfully quiet tonight. Did I do something wrong?”
“No. Seesaw I2c won’t communicate the way it should and I don’t know how to fix it....”
wife goes and pours wine
🤣
Unless you want to upgrade to Wife 2.0 it might be time to put the i2c project away for an hour. ;)
Oh I make time for her. Last night was bourbon and 90 day fiancee. Lol. Happy wife happy life
I can't get the Feather STM32F405 to render anything on the 2.4" TFT FeatherWing
I don't think ARDUINO_STM32_FEATHER actually gets defined
STM32F405xx gets defined. Using the graphictest_featherwing in the defines, I added STM32F405xx to the "Anything else!" section
FEATHER_F405 maybe.
https://github.com/adafruit/Arduino_Core_STM32/blob/master/boards.txt#L990
Good catch!
#ifdef FEATHER_F405
#warning FEATHER_F405 was defined
#endif
That construct may work to accurately detect and report defined symbols (at compile time).
Is TX/RX really on Serial3? I can't seem to get my GPS FeatherWing to work.
On which target?
F405
Offhand yeah, probably. Let me look.
That's what the Learn guide says, but it's not working
PORTC_0 D8_NEOPIX
I don't quite have it documented yet. ;)
Looks like TX/RX are PORTB_10/PORTB_11 on the schematic.
Which seems to be mapped to USART3
As far as calling it Serial3.begin(9600); that does seem a stretch. ;)
Let me see what I did. ;)
I have Serial and Serial1 (for the USART).
Haven't worked on this in months, though. That's the branch I have checked out, locally. ;)
I decided to abstract the serial on this particular project.
SERIAL_LOCAL_C is the symbol used.
Basically, my code says the two usual uses of Serial and Serial1 also apply to STM32F405 Express.
(the PORTC_ business is why I initially thought 'yeah, serial 3 sounds good')
Serial is connected to USB, right?
Yeah.
I did find USART3 on schematic, marking the line for RX_D0 (aka PB_11).
174: {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
hello
I have a more of a general electronics question regarding voltage dividing, my setup is that I have a 5v system that runs of its own 12v power source ( motorcycle ) and I want to take a sensor reading that should be in the range of 0v to 5v (estimated) and input that voltage into an analog pin on the Adafruit Clue, the Clue is powered from its own 3.3v lipo power source,
I setup a voltage divider on the 5v (motorcycle side) using a 10k and 15k resistors, then take output between the resistors and plug it into the Analog pin on the Clue. The ground of the voltage divider goes to the ground of the motorcycle, Although I'm not sure that is correct since it appears the ECU has its own 5v internal regulator to power the sensors.
My question is two fold
Firstly the ground from the VD go to the ground used on the sensor or is the motorcycle (-12v Bat) ground just as good?
Secondly the input pin seems to act as though it is floating still although I see it react when I open and close the throttle it is still wildly fluctuating in a similar manner as it does if I disconnect the input to the pin.
Things I've already done to prove the pin is working was to remove the VD setup a Pot the input pin tied to the Clues own +3.3 and -. Measurements here are steady and only fluctuate by a couple of points up or down, not the 100+ I see if the pin is floating. Modifying the Pot generates fairly accurate and repeatable results within the range expected.
Taking a Volt Meter across the motorcycle ground and the sensor output gives me the expected steady and reproducible results output I would expect in the range of 0 to just less than 5v
The proves to me that the pin is fine and the behavior I am seeing is due to my circuit setup between the two different voltage systems.
So I'm missing something perhaps the reference for the ADC cannot operate correctly with the two desperate systems? Or perhaps I need additional components to safely and correctly move the signal between the two.
I cannot seem to get the Feather STM32F405 and the GPS FeatherWing to talk to each other to save my life. The GPS module seems to be stuck getting a fix but with my '840 it seems to get a fix relatively instantly. What am I doing wrong here?
I can push it to github but it's a pretty big project that works just fine on the Feather nRF52840
I'm reading online about it. Can you try posting the particularly relevant pieces of code?
On the Adafruit website in mentions something about not having the GPS attached while uploading, but I don't think that's what you're describing.
Well for the STM32F405 I actually use a TermBlock FeatherWing to upload since I have to jumper B0 to 3v3
@stark mist I get the same results if I use a second lipo battery as the input voltage and ground so I think that is the issue is the ground needs to be common both for the input voltage to the divider and the clue
I'm not sure how to achieve this
@stark mist maybe I do the ADC on the high power side then its just logic level digital transmission on the lowside which is easy to achieve
Yes, but the way nothing really seemed to update on the MCU side (always reported 0 satellites) I was assuming that the MCU wasn't getting the NMEA sentences. I am fiddling with a program that only deals with GPS and TFT for fast, clear output of what the MCU knows. I think it might be working...
you should just be able to dump the bytes from the gps to the debug serial and see the stream of sentences
what api are you using to interpret the sentences?
TinyGPS++ and I did eventually try that about two hours ago or so
so with tinygps if you dont wait for encode to return true before extracting data it will always show you bad results
if ( tgps.encode(inbyte) ) { extractData(); }
Oh really?
That's weird, I've never had a problem except with the STM32F405
'840 doesn't have any issue with it, the Teensy 3.1 from ~6 years ago worked just fine lol
well maybe I'm giving you bad info
I just checked and I'm using standard tinygps not ++
yeah tinygps++ has a different way you have an isUpdated call for the variables
There's .isUpdated() and .isValid() to check if it's encoded enough (and .age() to see how long since a good sentence has been decoded)
my bad
Yeah, it looked like normal NMEA sentences
have you tried validating the checksum manually?
If I get anything at all it would be the same data that the '840 gets and parses without issue
its just an xor crc
1 byte
should tell you if the sentence is malformed or not
what type of serial port are you using the hardware or software?
What's REALLY weird is that the Feather nRF52840 gets 4+ satellites WAY faster than the Feather STM32F405 (which should NOT be MCU dependent)
Hardware
The Feather RX/TX lines
nope it should not the gps backup battery should maintain a fix
so that would be a hardware serial port
I had issues running a gps on a software serial port if the baud was too high
has it ever got a fix?
if you take it outside and leave it a few minutes powered up ?
A couple times... it's been running the entire time we've been talking and only found 2 sats
2 should be enough but I would expect more
With the Feather nRF52840 it'll find 7+ sats in < 30 seconds
You need 3 or 4 to get location
so I was having issues with a gps inside couldnt get a fix or reliable satelites, I took it outside for 5 mins brought it back in and it had 6 to 8 and maintained that
dont think that is your problem though
but worth a try perhaps
or stick your antenna out the window
I have an active antenna on a long cable I sometimes just run outside if it feels like I have signal issue on the gps side
can you plug the gps into a pc via a serial usb connector and use comething like uconnect or what ever manufacturers software to validate ?
I can literally just swap MCUs and get better results lol
I literally did just that and already have 6 sats
that does sound odd unless its some kind of signal interference maybe running the antenna away might help
if you power up the other feather near it what happens then?
I'm not using an external antenna
That's a good question
Doesn't seem to have any effect
both feathers use the same voltage levels?
Yep, both hooked to the same LiPo
are you powering the gps through the regulator on the feathers?
I assume so, it's a FeatherWing
that's very strange then sorry I don't really know what else to suggest other than double checking the checksums on the sentences and making sure it isn't some interference trashing the bits on the wire
both feathers programmed to run the same baud rate port?
Exact same code
Feather nRF52840 Express: https://www.adafruit.com/product/4062 (works great)
Feather STM32F405 Express: https://www.adafruit.com/product/4382 (has issues)
Ultimate GPS FeatherWing: https://www.adafruit.com/product/3133
The Adafruit Feather nRF52840 Express is the new Feather family member with Bluetooth Low Energy and native USB support featuring the nRF52840! It's our take on an ...
ST takes flight in this upcoming Feather board. The new STM32F405 Feather (video) that we designed runs CircuitPython at a blistering 168MHz – our fastest CircuitPython board ever! We ...
at least it has the uFl connector for an external antenna
Yeah
maybe the antenna on the nRF is helping pull down some signal 🤷♂️
its the only thing I can think off
I dont see any thing in their data sheets to suggest the problem you are seeing
I'd definitely try taking it outside for a few minutes and see if it helps or get an active antenna on it
If my Feather M4 was working I'd try that MCU
welp I've not managed to solve either of my problems this evening so far... will keep plugging at them
Not sure where to post this...but if I have an existing circuit board that attaches to an electronic chessboard setup. Whats the best way to work out what it's sending to the circuit board and then redirect that to an arduino to turn read on a pc?
I'm assuming with the Adafruit FTDI friend, I should cut the jumper and make it 5 V logic since I'm using a arduino pro mini 5v, right?
Probably so, yes.
hmm, i think i miss something very obvious:
My script on a trinketM0 sends some debug output on the usb serial with Serial.print(... and does the real work on the hardware serial via Serial1.write (... and Serial1.readBytesUntil(...
Problem: The script only works if USB(Serial) is connected....
Does this ring a bell to anyone?
It could be that the USB serial implementation blocks if it's not connected
So I've been working on a project for university involving an Arduino Nano 33 IoT for the past few days. Simple thing that connects to Wi-Fi (using the WiFiNINA library), then transmits data via MQTT.
I was nearly done, just fiddling with how a string was printing. Then I hit the RST button on the board. Now the thing doesn't seem capable of connecting to Wi-Fi anymore. What's more, it also seems to just be skipping over the first print statement when it boots.
delay(10); //Connect to WiFi specified in credentials.h Serial.println(); Serial.print("Connecting to: "); Serial.println(ssid); WiFi.begin(ssid, password); //Loops while attempting to connect. Prints out dots to show activity. while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); }
I had never had any issue with Wi-Fi connection while I was developing. Now this is happening the day before I'm supposed to record my demo and I'm sort of freaking out. I've tried using example sketches to connect to Wi-Fi after this and they all seem to be unable to connect too. Any ideas for troubleshooting would be immensely helpful.
Example output from this starting:
The "Connecting to: " string is supposed to display at the start and is just skipped over. There's no conditional statement behind it or anything that would prevent it from displaying either.
Might be a delay initializing the serial connection
Makes some sense. I tried adding "delay(5000);" in front of the initial connection and the "Connecting to: " message popped up again.
But I have no idea where that came from.
Some folks use a while !serial loop to wait until it's up
The only thing I changed was adding some additional calculations to generate a timestamp in the main loop, but I reverted that immediately when things began acting up.
A bunch of weird stuff can happen
And the fact that the example sketches stopped working is what freaks me out.
I sort of assumed that I accidentally deleted something in my code and uploaded a WiFi example sketch to verify, but that doesn't work anymore either.
Could be RF interference, power supply glitch, iffy connection, etc
I doubt interference. Although it's a possibility. The signal is strong where I'm testing and the building has a mesh network.
If the local RF environment has changed (moved, metal nearby, etc ) it can change the transmit power and trigger the other things I mentioned
Hrm...
Would a power supply glitch introduce a bizarre delay?
That popped up this morning and shouldn't exist anymore, since I immediately reverted the code.
It could have slightly damaged something
I thought you were already testing the wireless
Sorry, meant the hardware.
Try and figure out if the Nano 33 IoT got damaged somehow.
I'd hop down to a store and buy a replacement to test against... But COVID.
I wish I had stores like that nearby
I don't but I'd be willing to drive 3 hours to make a school project work, lol
But everything's closed and shipping is delayed everywhere.
Yeah, sigh
I think I'll try clearing the Arduino IDE from my computer and re-installing. See if a library got borked or something.
Thanks for the help.
It could be that the USB serial implementation blocks if it's not connected
@north stream Thanks.
No, it finally was a MAX3232 from ebay that was not reliably working on 3v3... now it runs fine on 5V and a 2k2/3k9 divider for the RX Line.
Ah, glad you figured it out, that was a weird one.
hello
need help with attiny 461a
i tried it with arduino as programmer and with a isp programmer
Could you show/describe your connections?
And I assume you can see heartbeat, error, or other led lighting up (what I'm trying to say is your arduino as isp sketch working.)
for the arduino: https://github.com/SpenceKonde/ATTinyCore/blob/master/Programming.md
for the isp programmer: https://www.diamex.de/dxshop/mediafiles//Sonstiges/erfos-avr-isp2.pdf
the blue led is to control the voltage
cant really see the pins
its the angle
(BTW im looking at the arduino not the programmer IDK about the programmer and too lazy to find out)
its the angle
and if LED wasn't there im sure itd look way beter
hmm do you have any other chip to program?
uhm try jiggling the connections
I was thinking its communication issue and lets see if your gear works before messing around with the chip or attiny core
always check the easiest thing before
I personally love AVRdudess as gui for avr
It has like everything but it seems like not the AVRdude issue (eg. chip id)
i test it tomorrow ^^
TBH I dont have any other idea yet. 😐
I lost my passive buzzer, is there any guide to how I could strip down a pair of earbuds and use them instead? I found some super cheap ones laying around that I am ready to disassemble.
!!! I found this, it might work, thnx! I will try https://create.arduino.cc/projecthub/BnTie/hacking-headphones-40a82d
ok, so I hooked up the headphones, I am using them as inputs, I am writing to analog inputs on the arduino board. I have the code set to print to the monitor, for some reason, the results are only interesting when I remove the ground. The results on the right are when I make noise, and the ones on the left are for when I try to be quiet
or, this could just be random nonsense, and I do not have it hooked up right
When you connect the speakers to ground, that makes the voltage 0 so the analog pins read 0
When you don't have anything connected to ground or 5v without pull up/down resistors, your Arduino analog pins detect electrical noise around you
ok, so I hooked up the headphones, I am using them as inputs, I am writing to analog inputs on the arduino board. I have the code set to print to the monitor, for some reason, the results are only interesting when I remove the ground. The results on the right are when I make noise, and the ones on the left are for when I try to be quiet
@nocturne vale
Do you mean you are using them as input or output? Not clear.
Or maybe I'm too sleepy. IDK
I am trying to use them as inputs.
Old 1960's vintage toy two-way radios used their loudspeaker as an audio source as well (as a kind of microphone).
You could hear the tone and cadence of the other person's speaking voice, but intelligibility was low.
They often also had a morse code key, right on the main face of the walkie-talkie. ;)
I had some of the analog inputs mislabeled in the code, but I have been able to reproduce something. I have this high pitched gear "think those cars you push and they keep going" when I wind it up, I can get a bunch of zeros to print, so I am quite sure its doing something. Thnx @pine bramble
;)
ok, that nickname works out better, thnx! I never thought I would use this discord thing, and I was wrong
`Using a speaker for a mic works fine but you need a high impendence speaker for it to work well. 63 ohm intercom station speakers work OK.
Even an 8Ω speaker makes a decent mic: the large area gives it good sensitivity. You can use a transformer to raise the output impedance as well.
Yeah, I am not really sure what is going on, but using that flywheel toy is the only way I can get zero's. Either I am shaking the ground or some frequency the flywheel gear toy thing I have is setting it off at just the right sound. I think it is time to try a better mic thnx.
Hey, does anyone know what loadConfigurationFile() and saveConfigurationFile() do in Arcada?
I'm trying to use ArduinoJson (The better one that you have to install when installing Arcada) in the same sketch asArcada. I learned that usually the library objects are exposed through the Arcada object (instead of calling FatFileSystemObject.exists(filepath) from AdafruitSPIFlash you would call arcada.exists(filepath), if you get what I'm saying.
So does loadConfigurationFile() and saveConfigurationFile() basically wrap up ArduinoJson functions into an Arcada object?
Oh man, that's going to be hard to understand.
Hello! I have a little bit of arduino experience mostly from a hackathon... Now I want to build a small tamagotchi-type app.
I want it to be able to connect to the internet so I was thinking of going with the Arduino Uno Rev2 Wifi
Are there any LCD screens that are easy to hookup and available y'all might suggest? Does the Uno seem okay for something like this?
Sorry I am a really noob
Is there something someone might suggest for audio too? 😮
https://photos.app.goo.gl/Sf3j3AtqmHmQAGSz8 What might be causing this? (its on arduino wifi MKR sth sth and ws2815 leds, with 5V logic converter and neopixel library)
PSU is adequate 10A for 150 chips but still gets better with lower brightness
Did you connect your grounds? The level shifter should do that, but I've had this exact problem and connecting the Arduino ground to the LED ground fixed it.
I’m currently running a metro m0 express, if I want to send bytes over the micro usb serial port to my pc, what is the name of that port for when I define my uart instance?
Is there a better channel to ask this on?
I assume you're programming in CircuitPython? Can you use usb_hid ?
Yes circuit python
Did you connect your grounds? The level shifter should do that, but I've had this exact problem and connecting the Arduino ground to the LED ground fixed it.
did not work any other ideas?
@weak walrus I'd use the ESP8266 or ESP32 for that. Both have extension libraries for the Arduino IDE.
Thank you!
@weak walrus There's a version of the ESP32 with a tiny TFT screen - not sure what your screen size requirements are - but it's called a TTGO T-Display.
@cyan jasper If your connection to the LED's is short, you can try not using the level converter at all. The first LED in the string will regen the data to a 5 volt signal, and 3.3 v is usually enough to get the first LED running. Even if it doesn't work, it won't hurt anything.
hmm you imply logic shifter causing timing delays? worth a try
Not delays.. but might not be working right, or adding noise.. It's a piece of the puzzle, so to speak.
Not sure how the usb_hid library would help. Looking for the name of the USB port for the sending pin and receiving pin arguments in uart.
@cyan jasper If your connection to the LED's is short, you can try not using the level converter at all. The first LED in the string will regen the data to a 5 volt signal, and 3.3 v is usually enough to get the first LED running. Even if it doesn't work, it won't hurt anything.
its even worse
@cyan jasper Ouch.. At this point I'd check voltages, make sure the right pins are selected, the right type of LED selected in the setup... if that all looks good, I'd turn to an oscilloscope, if possible.
scope is not possible yet
we gonna try 12V logic (testing before with smaller strip)
Yeah.. those thing's aren't cheap..
if it goes worse with 3v it should get better with 12v
datasheet says 0.8VDD as absolute maximum
should work
Oh.. I didn't ask before.. it doesn't look like you're running high brightness, but that many LEDs could still pull a small power supply down. A good guesstimate is 70 mW per pixel at max prightness.
12V worked
Oh.. I didn't ask before.. it doesn't look like you're running high brightness, but that many LEDs could still pull a small power supply down. A good guesstimate is 70 mW per pixel at max prightness.
datasheet says lower like 12mA per pixel
But I have both large 12v strings and smaller 5 v strings running at the same time.
LEDs are efficient but at the same time its like they hog all the power its weird
Most times it's the length of the string. Try adding a 5v jumper (Vcc and Ground - not data) to the other end, so both are connected at once.
Say I have an Arduino sketch:
void setup() {
int a = 1;
}
void loop() {
// Can I access the variable `a` here?
}
Since the variable a is defined in setup(), can you access the variable a in loop()?
My guess is no, but please correct me if I'm wrong.
Does Arduino destroy the variable a when setup() exits?
No. Scope of variable is the function.
So a still takes up memory?
I think if you want a to persist you declare it volatile but I am not sure on that point.
Well, I don't want a to persist
If it's not a global (declared outside any function) then other functions (Besides setup();) can't see the variable.
But I don't want a to take up memory
Because I'm actully using an ArduinoJSON StaticJsonDocument
Prove it to yourself by using :
void blink(void) {
for (int i=17; i>0; i--) {
led_on();
led_off();
}
}
void Setup(void) {
for (int i=10; i>0; i--) {
blink();
}
}
Notice the int part in both ;)
One of the reasons we get away with calling so many index variables int i is that their scope is limited.
I get that there scope is limited, but does it get destroyed when the function returns?
I'm worried about memory usage
I think if it's not declared volatile you cannot expect it to persist.
If it is declared volatile I'm also unsure just what happens. ;)
IRL I have never used volatile before
I'm guessing the volatile int has a permanent home in the memory map.
Well, then I should be fine with memory usage
I'm a Forth programmer, so I declare a global array of 8 or 16 integers and that's all the memory I work with, for many applications. ;)
I'm a horrible Arduino programmer, so I declare about a million variables and I still need more 🤷♂️
Plus a few other global ints for holding stuff, like an ersatz stack pointer.
Horrible is more advanced than 'not a' programmer.
That's true
"I'm not a programmer .. I'm a talent scout." "I'm not a programmer .. I'm a tree surgeon."
Okay idk if arduino made changes but avr-gcc compiler natively has same scope for both setup and loop.
Edit: They did changed it setup and loop are different scopes.
void main() {
//setup operations
while(true) {
//loop operations
}
} ```
So scope rules should still apply
so you can try this
void setup() {
Serial.begin(9600);
int k = 8;
{int a = 5;}
Serial.println(a); //compiling this line will give scope error "a" is not declerad into this scope
}
void loop(){
Serial.println(k); //this neither compile I just tried it.
}```
now i have a question does it work like this that's why they have different scopes?
void setup();
void loop();
void main(){
setup();
//maybe some internal support code
while(true){
loop();
}
}```
Or does it have complete new structure for compiler? It doesn't make much sense to edit compiler for this but maybe it's not as much work as I anticipate. 🤔
In the book Arduino Cookbook by Michael Margolis, he says this is how it works:
int main(void) {
init();
setup();
for (;;)
loop();
return 0;
}
So I guess the variables are being destroyed and redefined?
Id assume so
Hey, just wondering
Are you familiar with ArduinoJson?
I have a question
Nope
so you can try this
void setup() { Serial.begin(9600); int k = 8; {int a = 5;} Serial.println(a); //compiling this line will give scope error "a" is not declerad into this scope } void loop(){ Serial.println(k); //this neither compile I just tried it. }```
@cyan jasper wait, you can put {} around statements to make a scope?
Yep
Whoa
That's how I destroy my objects 😅
I should learn about jsons just never been a programer person even slacking off my Esp32 projects because programming
It's not that hard
keyword: not that
If you had experience with Python, then its kind of like a list
more actually of a dictionary
and you can nest objects to make subfields
Id not say I had that kind of experience with python
Mostly algebraic stuff
And once I tried arduino com but didn't finished
It looks like this:
{
"sensor": "GPS"
"time": 12834701989
"data":[
"boo",
23425216
]
}
NOTE: I pulled this from the internet
To get the value of sensor you would write something like this:
json["sensor"] // returns "GPS"
Except it hurts my head doing this stuff
What doesn't kill you makes you tougher
Then you should try Arduino
Or Python
They're both nice
It won't kill you 😉
I have an ESP8266 configured for OTA Upload.
I want to switch from SPIFFS to LittleFS.
Can I do this via OTA?
Can I simply write the same filename with LittleFS over the old SPIFFS one or should I erase the flash first?
If I need to erase the flash first, can I do it via wifi?
Please quote me if you answer me. :)
Thanks
Hello, I work on a Arduino Uno with Windows. My computer can't export any program (same thing for Numworks). Can you help me please ?
do you mean programming with export? what error message is displayed?
I am using an Adafruit Feather nRF52840 Express at the moment. Is there a way to let it "sleep" (to save power) and have it wake up when I move it? (I have a MPU-6050 module available)
at the moment my circuit uses 20 mA in idle
I've been programming a Trinket M0 for a while, and for uploading a sketch, i always have to double-press reset, so the red LED pulses.
Now i wonder if i can upload a different firmware so the trinket is always accepting uploads?
@wind drift Yes, it should be possible to have the IMU provide an interrupt signal when moved, which could wake the nRF52840 from various levels of sleep. The hardware ought to be capable of doing that down at the microamp level. It'll depend on what software libraries / platform you're using for how easy that will be to set up, though.
I use the arduino IDE with that board
Gotcha. I'm not that familiar with the Arduino libraries, I'm afraid. But the capability is theoretically there. 😅
How do i get this display to init?
https://www.robotics.org.za/12864-5V i followed the wiring on this page to the point and nothing. the openglcd diagnostics program keeps failing with a timeout
Display 128x64 White on Blue - 5V
``--------------------------------------------------------------------
Lib Configuration: openGLCD ver: 1.0rc3 build: v1.0rc3
Panel Configuration:ks0108-128x64
Pin Configuration:ks0108-Uno
GLCD:ks0108 DisplayWidth:128 DisplayHeight:64
Chips:2 ChipWidth:64 ChipHeight:64
CSEL1:A0(PORTC0) CSEL2:A1(PORTC1)
RES:A5(PORTC5) RW:A2(PORTC2) DI:A3(PORTC3) EN:A4(PORTC4)
D0:8(PORTB0) D1:9(PORTB1) D2:10(PORTB2) D3:11(PORTB3)
D4:4(PORTD4) D5:5(PORTD5) D6:6(PORTD6) D7:7(PORTD7)
Delays: tDDR:320 tAS:140 tDSW:200 tWH:450 tWL:450
ChipSelects:
CHIP0:(A0,0x1, A1,0x0)
CHIP1:(A0,0x0, A1,0x1)
Data mode:
d0-d3:nibble mode-Non-Atomic
d4-d7:nibble mode-Non-Atomic
Backlight: <Not configured>
Diag Loop: 1
Initializing openGLCD
GLCD initialization Failed: RESET wait Timeout (status code: 2)
Test Count: 0 PASSED 1 FAILED
``
console output
Did you edit glcd_Config.h to match your controller board and LCD?
Vout is is connected to the wiper pin of the pot as well as the Vo pin
I do see that the wiring diagram given on the product page does not match your software configuration. For example, the reset line on the LCD is shown on the product page as connected to A3, but your printout shows RES:A5(PORTC5)
The wiring diagrams in the documentation give two more possibilities.
For even more complication, it looks like the library you're using is 9 years old and not recommended https://playground.arduino.cc/Code/GLCDks0108/
No, strike that, I was looking at the library from the product page, you're using openGLCD, which is the one you want.
here is what i found for the pin setup for the module. looking at the module itself i don't see any chip select pins
Which Arduino pins did you wire CSEL1, CSEL2, and reset to?
Hard to tell from the label too, but looks like you might have a "B" board with BLA and BLK swapped (I think you have it right, however, since the backlight is on)
12864B
The silkscreen your board seems to be PSB and NC where CSEL1 and 2 would be. Weird.
How do I get rid of the flickering in Adafruit_GFX/Adafruit_ILI9341?
I got my CLUE board yesterday, so have been putting everything together for Arduino IDE work. I will also install what ever I need for Circuitpython. Anyway, I can not find Sensor Lab when I go to manage libraries from IDE 1.8.12. What am I missing??
Any guesses on why this button won’t register a high state? When I remove it it predictably gives me alternating high/low
Made a post to not take up so much space: https://forum.arduino.cc/index.php?topic=683128.0
Hello! Noob here. I got a tft LCD screen working, but not a button!
@weak walrus It may be the button is mounted 90 degrees off such that pressing it isn't actually pulling pin 2 high. You can test without the switch by connecting pin 2 (green? wire) to ground and +5, if that works check the switch wiring.
alternately to ground and +5 that is, not both at once
Thanks I'll try that
So that means the green wire (pin2) to the same row (6) as the ground and resistor?
I am not sure what +5 means 😅
OK, the 2 rows on the outside edges supply power, ground and 5 volts (+5), where you have the red and blue wires
if you connect pin 2 directly to +5 or ground, the program should flip screens
when it's not connected (floating) it may toggle by itself
NP
Are there best practices on handling it constantly toggling on its own?
I can get it to stay on 0 but not on 1
in general, never let an input "float", it must be connected to HIGH (+5) or LOW (ground)
can you rotate your push button 90 degrees?
one side of the switch is "A" and one is "B", each side is always shorted together, you need to read across "A" and "B"
Hmm no then it doesnt fit over the gap in the breadboard
to avoid float, use a pull-up or pull-down resistor, or use pinMode(pin, INPUT_PULLUP)
With this I can now reliably get a 0 again but not a 1
how big is the resistor (what value?)
@safe shell, to keep the "logic" simple he's using a pull down resistor, and it works if the input is moved from +5 to grd, seems to be switch wiring or the switch itself
@weak walrus you always get a 0 because pin 2 is connected thru the 10K to ground, which is correct, pin 2 isn't "seeing" +5 when you close the switch
@reef ravine Gotcha, I was a little behind when there was no resistor. Those switches should work in any orientation as long as you connect to opposite corners.
Ah thanks for explaining
@safe shell, thanks didn't want to dig around for one 🙂
I used this to set it up initially: https://www.arduino.cc/en/tutorial/button
Open-source electronic prototyping platform enabling users to create interactive electronic objects.
Which had the Pin2 going to the same leg as the resistor
hmm, in that case move the red wire to a hole next to the resistor
okay
as anecdata said opposite corners connect
Same results with consistent 0
and if you take another jumper and connect the pin 2 wire to the resistor / red wire / switch junction?
This explains how those buttons work: https://learn.adafruit.com/adafruit-arduino-lesson-6-digital-inputs?view=all#push-switches
When I added it to the resistor/rw/switch junction it was just always 0
Now I moved everything around a tiny bit and im back to inconsistent 1 with consistent 0 ha
but if you move the green wire between red and blue it works? ( your original wiring was better)
!! if I move it between those two then yes I can get a 1
but the low state is still 1's and 0's
that feels like progress 😮
the toggling means pin 2 is floating, if you connect green to the resistor it stays low?
hm actually when i pressed it again the consistent 1s didnt come back
ill look
yes
thats correct
it seems to stay low if on the resistor row
(with ground)
and doesnt go high
try removing and reinserting the red wire
no dice
seems like the switch is bad, do you have another?
yep!
I did switch this one out alredy
ill see
with this setup and trying 3 switches it doesnt work
it is possible all three could be borked
ok take another jumper and "short" between red and green
if that works then the switch doesn't
maybe its orange, whatever is connected to +5
It could be that the switch leads are too short to engage with the breadboard contacts.
I think its making contact
maybe not 😮
How do I short it? Put the new wire in the same row as the red and green?
Either end
better, move the red wire to the bottom corner
0 on press means the top and bottom pins on the right are the switch closure
Moving red wire to bottom left leg inconsirent 0/1s, consistent 0s. Moving white wire to same row as red and only 0's
If I remove the white wire I am back to inconsisten 1/0s
Like @north stream I've found sometimes the switch pins (which are designed for a circuit board) don' actually make contact with the breadboard pins
ok with wht removed, move red to the switch / resistor junction
On the other side of the board?
yes so you'll have ground >> resistor >> + 5 and switch, then leave green wire up top
Same- inconsistent 1s
the pins on the switch come with a bend in them, can you make the legs "longer" by straightening the pins with a needle nose plier?
I'l try that
they are as flat as they go but same resuts
I can look for some new ones
OK, you got the display working - that's usually the hard part!
I have this coming tonorrow haha https://www.amazon.com/ELEGOO-Project-Starter-Arduino-Mega2560/dp/B01GEEWIPA
Ya!! I was surprised the button is so hard!!
I've used buttons before!
but dang haha
These are the ones I have https://www.amazon.com/Auleswet-6x6x4-5mm-Momentary-Breadboards-Prototyping/dp/B085DPGLP7
and yours don't have those S bends in the legs?
They used to before I took some pliers 🙂
Ahhh
yeah I always use pliers on them when using a breadboard, they fit great on a PCB
noted!
I guess I'll give it a rest then until the other switches get in tomorrow
Thanks so much for your help at least I learned a ton
OK, good luck, you're n the right track
Hi
can somone please help me
i am making my friend a crazy game controller for his birthday tomorrow
and i need help
i have made a working fight stick but i cant seem to add a wii nunchuck to the mix
Please help
I think the nunchuck is an I2C device, but I don't see you initializing the Wire library anywhere.
so what should i do?
Likely, #include <Wire.h>, and then do Wire.begin() in your setup() function, before nchuk.begin().
You put the include at the top of the file with your other includes, and the begin call in setup() with the other begin calls.
(Although this is of course not guaranteed to work, just something which looks missing.)
still not working
still the same error
could you please have a look at the Ino file?
Oh, you didn't say that it didn't even compile before...
oh sorry
basically i already coded the fight stick but when i tried to add the nunchuck i copied and pasted from another file and its not working
but im so glad that you are helping me
So, this error is unrelated to the Nunchuk, as it's just the USB HID functionality. It looks like the HID_Keyboard library thinks you don't have an Arduino with USB capability, or haven't enabled / included it if you do.
so what should i do
what Arduino do you have
One thing you may need is to put the #include <Keyboard.h> above the #include <HID_Buttons.h> line instead of below it.
thanks heaps that error is fixed
but
i cant thank you guys enough
i have been working on this for weeks
That looks like a bad copy-paste of a section of code that shouldn't be where it is.
Where did it come from?
I'd just delete everything in setup() before the Serial.begin() line, as it doesn't belong there and doesn't seem to be present in either of the files you linked.
you forgot a curly brace at the end to close the function
so
void loop() {
wiiNunchuk();
}
Nunchuk is a type, you cannot declare a function the same name as a type
just change it to lowercase n
do you even have a Wiinunchuk() function...?
alright hold on
hm...
sorry i must be really annoying
i am
ohhh, literally 90% of this code is outside your loop function
lemme just fix this rq and send you the new ino
since it'll be easier than explaining it and you're on a tight deadline
K thanks
That's awesome of you, @visual ferry ... 👍
Agreed
Thanks guys
Ps what should I do to actually learn about coding
Is there a good book on it ?
theres a lot of different resources on it tbh, hard to really suggest one place
I learned from classes in school and a lot of self teaching and reading around, i wouldnt be able to suggest anything tbh
working on it, im doing some reorganization and commenting so you know what I changed
im bored and got nothing else to do, works for me lol
lol
ugh, bit rusty with arduino/C in general, do you know if
if(condition) {
//code
} else {
//code
}
works @cedar mountain
or do I have to have else on a new line
my brain is telling me that it works but i just simple cannot remember for the life of me
else on a new line is probably cleaner anyway
That should be completely fine. C is agnostic to newlines for the most part.
figured
@visual quarry so with your keyboard key press code, your comments say you are wanting to press the function keys (F1 through F12) but the keyboard buttons you are actually pressing are numpad keys
did you want to press function keys or numpad keys
oh sorry i was going to do function but i changed my mind
yeah
almost done then just gimme about 2 mins
ok, here you go, should be good, but lemme know if I messed something up @visual quarry
Don't thank me yet make sure it works first lol
ah i didnt touch that line lemme see...
k
I guess the KeyboardButton declarations are supposed to be outside the Setup loop for a reason lol
should be good now
i mean you can probably create the references and declare in the setup loop later but im too lazy to do that rn
anyway test this one out @visual quarry
3
if you press the verify button it shows the errors
Eep no its not
@visual quarry i dont have the nunchuk library you have so it wont for me
at the top of the file, where all the #defines are
remove #define KEY_NUMPAD_0 0xEA
still not working
add #define KEY_NUMPAD_4 0xE4 right underneath #define KEY_ARROW_RIGHT 0xD7
oh
i wasnt done :P
sorry
no worries
eyyy, glad to hear it!
thankyou so much mate
does everything you expect it to do?
whats it doing
nothing
it used to press keys 4 to 9 and use the direction buttons
but it wont do anything now
k
ok, try this
i removed the defines and replaced them with the hex codes right in the function calls instead
still nothing for the fightsticl
oh shoot woops
can you uncomment //nchuk.printDebug();, run it, and open up the serial monitor and tell me if you're getting anything?
the code wont continue into the Loop function until you have the nunchuk connected lol
sory lol i feel stupid
nah ur good
ok well ill connect tomorrow and ill get back to you
ok, works for me
thanks again i owe u mate
eh its whatever lol
goodnight mate

i have a prob.... my HC-SR04 ultrasonic sensor alwase sends back -1.. and i can't seem to find why
(using wemos D1 r2 bord and the sensor is powered in 3.3v )
Hello, I work on a Arduino Uno with Windows. My computer can't export any program (same thing for Numworks). Can you help me please ?
The message is "exit status 1"
@slow nebula The HC-SR04 needs 5V to work properly
yhea, that was what my friend was saying 5 mins ago
rip my project
You can use a level converter to communicate with the sensor. You only need 5V to power the sensor and for the converter. There is a 5V pin on the board, right?
my friend proposed me to use this, do you thing it can work @pine bramble ?
welp, nvm changing it 
this is the correct
This looks right, 2K/1K will do as well.
I always use level converter boards like this one https://www.adafruit.com/product/757
welp, i tried and it worked, then stopped 
sorry for bothering you ^^ and thanks a lot for the help, this was my first project, learning more things every time ^^
Hello all, I have really strange issue. I have diy LED lamp with arduino controll via USB. I changed power supply and can't no more connect to arduino via USB. If disconnect power supply everything works fine, also when I connect old power supply everything works fine. Current on arduino VIN is 5V on both supplies. Any ideas why this is happening?
@slow nebula No problem, ask anything anytime, there is always someone willing to help here
Seems like an issue with the new supply, sure enough. Could be an interference issue or a ground loop issue, I suppose.
Sounds like first psu was mains earth referenced other is floating ground
Hello all, I'm making a project where I'd like to reuse some elements from the Arduino Nano board.
Being the lazy dude I am, I was looking for a schematic to copypaste from. I did find an eagle schematic, but it must be for an old version of Eagle, because it generates and error when I try to open.
Any of you guys know of a schematic/project compatible with the current version of Autodesk Eagle?
Even if it's older version eagle should be able to import it