#help-with-arduino
1 messages · Page 73 of 1
alright, was hoping there was an other way..
so there is no way to convert a male to male wire into a male to female wire?
The other way is easier, but if you have any female to female wires, you can put them end to end. You can also just replace the internal wires, but it's tricky and you have to have the properly terminated wires available. https://www.adafruit.com/product/3633
I've got some male jumper wires here. It looks like it's possible to snip off the pin and then stick another pin inside it. The pin isn't really a pin but it's bent, and the gap between the two sides becomes larger the closer the pin is to the wire.
I don't have any female to female no, then I think it's better to buy a female to male or female to female pack
@lone ferry Yeah I tried that too, was experimenting with it for a bit but I couldn't manage to do it
For temporary solutions, a crocodile clip wire can work. 🙂
@sweet sleet It was 2am local when you came back on. As IoTPanic was saying you can't use the hardware serial to talk to the "green board" (those pins are used by PC<>Node comms and are fixed). See the image here, https://forum.arduino.cc/index.php?topic=605324.msg4108046#msg4108046, you will use the hardware serial for USB to the PC (GPIO 1 & 3) and setup a "software serial" (GPIO 4 & 5) for comms thru the levelshifter to the green board. The diagram isn't exactly what you are doing but it illustrates the idea. All is not lost, it'll just take some more coding to setup the second serial port. Welcome to software debugging 😉
Serial Communication between Arduino and NodeMCU
#include <SoftwareSerial.h>
@sweet sleet You need ESP8266 SoftwareSerial, not the standard Arduino one, chores to do, be on and off today...
Silly question, but what language does the Arduino use?
It uses what they call wiring, which is C++ with a framework
Ok then
"You don't need level shifters because, even if the ESP8266 runs at 3.3V, its IO ports are 5V tolerant."
"In case you decide to transmit binary data please also consider the two devices use a different architecture: Arduino is 8bit, ESP8266 is 32bit, meaning they have different word size (the minimum allocation unit size)."
hmmm. i am sending binary
i'm a bit discouraged at the moment
I wouldn't use 5v on any ESP8266 input pins unless the board specifically has level shifters on RX. Data sheet says max is VDD + 0.3v (VDD typ. 3.3v, max 3.6v).
It might work, but risky at best.
i am now shifting rx and tx
although i may be using the wrong pins
😦
i need help with the software now i believe. anyone willing to look at this with me?
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.
i need to figure out how to communicate with this PIC board
and what i should expect from it.
Did your USB-serial device ever show up?
Well i see nothing on the monitor
So no :/
but my logic analyzer did show that i was using the correct TX/RX pins
from the nodemcu
i am thinking that my 'serial write' command is wrong
the PIC shows these examples in the source code
Woot! Ordered huge pile of bit from Adafruit: more M4s, DACs, OLED displays.... more project supplies!
@obtuse spruce nice! @sweet sleet youre sending 7 bits not 8
Binary is from right to left, so your value is shifted
@sweet sleet - write(1110011) does not do what you think! What you want is write(0b1110011)
And that, yes 😜
😯
write(1110011) sends the number 1110011, while 0b1110011 is a binary representation
do i need to set a debug port?
and right now i'm testing this on the d1 main controller not the esp with the level shifter
Can anyone help with a project I am working on?
Background:
I am building a remote power switch for my PC
Parts:
-https://www.microcenter.com/product/615098/inland-esp-01s-usb-to-esp8266-wireless-adapter-module
-https://www.amazon.com/gp/product/B00HJ6AE72/ref=ppx_yo_dt_b_asin_title_o05_s01?ie=UTF8&psc=1
-https://www.amazon.com/gp/product/B07TFHZNVP/ref=ppx_yo_dt_b_asin_title_o06_s01?ie=UTF8&psc=1
I am using these parts for the build
This is the code: https://paste.ofcode.org/k8RJdFbtuZVLBdmyATZszZ
Looks good, are you building this on a breadboard @stone dirge? And from what I have seen, many people use Wake on LAN which most computers have but I see what you're doing that that will work aswell
I am using a solderless breadboard for testing and soldering breadboard for final product
Got it, yeah it should work, Ive seen this exact setup just not with Adafruit IO, which that should work fine
The problem I am having is that when I have the optocouple connected to the GPIO 0 pin, there is no wifi signal (i.e. the blue signal led does not flash, and the emitter/collector does not switch on)
any thoughts on why this is?
Ive tested the circuit with a simple led and it works fine
Its not you its the pin, trap for young players https://www.forward.com.au/pfod/ESP8266/GPIOpins/index.html
Try another GPIO, and read the link I sent, IO0 is for programming
From what I see, that needs to be pulled up too, might want to use 15
which pin is 15? lol
Late preface: I am new to arduinos and coding
I am using esp-01
Okay, this will explain what Im talking about, scroll down to the best pins to use section of the page https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/
I'm thinking I will get a pro mini running at 5v since the person who made these PICs has used them and has told me it works
@stuck coral ok thank you for your help, I will read up on what you showed me rn
@stone dirge no problem, feel free to come back if you need more help
will do, I will let you know if i figure it out
quick question, should i be powering the esp-01 with 3.3v or 5v?
3.3V
ok cool
Correct me if I am wrong, but it looks like the esp8266-01 doesn't have a pin gpio 15
Ah yes, I never use ESP01s. You have 0, 1, 2, and 3. Could use IO3, but be warned on boot it will output a high signal for a moment
how do i not get sparked or shocked by touching the board when plugging in lol
rubber gloves... lol jk I have no idea
Idk what you're really asking @sweet sleet which board
Well its not high voltage AC that can travel through your body
i cannot seem to flash it when it's plugged in
Yeah, I tried telling you you wouldnt be able to earlier
unplug every time
The way you have it wired, yes
should i always plug in ground first
Eh, just plug power in last, doesnt matter too much
if i plug power in first is that bad
Not really, just in general its good to do power last because there are cases where that is a yes
Good habit to have
this is the board my friend used that apparently he was successful with
I am aware of the board, but from what I see the hardware isnt the issue
he buys these because it is cheap, have native usb onboard and plug right into a breadboard
:/
Yeah but its a old ATMEGA32 and Im not a fan, you can use it if you'd like, but your current board will work if you use it right
it'll take a month to get here
so i'd definitely prefer to just use my current hardware
Okay, first thing you need to do is create a software serial port, and connect the green board you have to it
Then you can put code on the ESP and either control it with the ESP, or have it bridge the serial the USB is using with the software serial
This is what me and I think madbodger were saying last night
okay i'll try my best
@stuck coral if i am using gpio 3, should i change my code?
Serial.println("HIGH");
else
Serial.println("LOW");```
should i swap the highs and lows?
Nope
Might want to add in setup bringing the line though just for a good known state
... if you have a sec, would you explain that or give me an example lol
Hey, I have a question: do my components have lead solder on them? I was wondering if it was zinc or lead, and I've heard it's been banned, but I just wanted to check.
@stone dirge within setup(), after you use pinMode(PIN_NAME, OUTPUT); add in a digitalWrite(PIN_NAME, LOW);
ok i see thank you
@cunning reef you will need to give us more info on that one
Okay, I have an Arduino Mega2560 (not Arduino brand) that I recently got for my birthday
And idk what you mean by being banned, I dont know anywhere were leaded solder is banned
If its a china knock off it probably has leaded solder, just done melt it and lick it
@sweet sleet you also need your hardware serial port to be in there
Yeah, I think it's a China knock-off. It's from a brand called "Agoal"
Good, I always include a message at the start though just to make sure everything booted right, like Serial.println(" === Booting ==="); or something
Yeah, there you go, I would after you send any command, use the following which will print the output of the green board to your hardware serial-
if (s.available()) { // If anything comes in Serial1 (pins 0 & 1)
Serial.write(s.read()); // read it and send it out Serial (USB)
}
And that would assume you dont want USB, and you have the logic converter
I think ed told you its still a good idea to include the converter
The RoHS compliance guide says that any amount of lead over 1000 ppm is illegal.
Yes, I explained to you that the ESP outputs serial at 115200 when you boot @sweet sleet
i'm really trying to understand so i'm sorry. but which is pin 0 and 1? i still have tx as gpio1 and rx as gpio3
got it.
Try changing the serial speed in the monitor to 115200 and the hardware serial speed to 115200, you can leave the software serial as 9600.
i don't see the == booting == text
The RoHS compliance guide says that any amount of lead over 1000 ppm is illegal.
@cunning reef where does it say illigal, RoHS is a compliance not a law
Did you change the serial speed in the code to match?
oops
hey there, i have a noob question, what is the correct syntax to pass a for loop variable in this example?
for (int i=0; i<5; i++){
float voltage = pzem[i].voltage(); client.publish("/topic/pzem[i]",String(voltage).c_str());
}
in mqtt explorer i can see it created topic called /topic/pzem[i] instead of /topic/pzem1 - /topic/pzem5
thanx for suggestions
Press the reset button, with the monitor still up @sweet sleet what do you see then?
gibberish
"s$�$ܞ⸮⸮l⸮|⸮$⸮p⸮r⸮⸮⸮s⸮B⸮b⸮⸮Nn⸮�lNn⸮⸮⸮"p⸮⸮#d rdp⸮N⸮⸮l⸮⸮"o⸮|⸮⸮⸮b⸮|⸮N⸮l⸮⸮l⸮no$Nr⸮⸮⸮ocd {⸮⸮⸮"l`⸮"⸮⸮d⸮l{⸮ ⸮⸮N⸮���"
@bold island because you have in the function call to post to the topic "/topic/pzem[i]",
Hm, what if you unplug the logic converter @sweet sleet ?
And which pins are you using for software serial?
@stuck coral yes i know the quotes is the issue, but dont know hot to use variable in topic for client publish
lol I was gonna ask you another question, but it seems you have your hands full. I'll ask later
@bold island https://pubsubclient.knolleary.net/api#publish
The quotes isnt an issue, you are defining a string
You are misunderstanding C as a language
@stuck coral i didn't even have it plugged in to anything. just the usb to nodemcu
@stuck coral yes i am beginner with C
@sweet sleet you defined the software serial on the hardware pins? That is probably the issue
i think gpio1 and gpio3 are the hardware pins
so you are saying i need to define it as other ones.
like gpio5 and gpio4 or something
Correct, you want to create two serial ports, one in hardware going to USB, and another to your other board
@bold island You are looking for this https://www.tutorialspoint.com/c_standard_library/c_function_sprintf.htm
C library function - sprintf() - The C library function int sprintf(char *str, const char *format, ...) sends formatted output to a string pointed to, by str.
That will let you populate a number into a string in a formatted mannor
@stuck coral thanx let me see...
anyone on who can help me getting two CD Drive stepper motors working on an UNO with a HW-130 shield using Universal G-Code Sender?
note to self to make these the serial ports (gpio15 - rx & gpio13 - tx)
I wouldnt use 15, it will fail boot if pulled high, try 12
oof
ESPs are a pain, heres a guide, I have been needing this link a lot today https://randomnerdtutorials.com/esp8266-pinout-reference-gpios/
@granite sequoia That's an oddly specific request. I'm unfamiliar with the HW-130 shield and G-Code sender (strange combination, seems like). Do you mean the spindle motor or the head positioning motor?
Ah, the AdaFruit Motor Shield. That's easier for me to recognize than HW-130.
That's the shield. its an uno shield that will work with 5v bipolar stepper motors
Well you configure in code which is which, hence software serial
Open-source electronic prototyping platform enabling users to create interactive electronic objects.
Wow, I struggled with that copy paste
Read the link I just sent, you will find the answer
okay reading it
The SoftwareSerial constructor takes the receive pin first, and the transmit pin second (in case that was what you were asking)
I was trying to help show him how to find the answer himself but thank you @north stream 😜
my question is say my rxPin= 2
what pin is that referring to on the pinout board
gpio1?
3 = gpio3?
If you dont see a 2, it is not exposed on your board
2 is used for programming anyways
You dont want to use it
for example if i want to use gpio12 as tx. is that "6"?
No, its 12
gpio13 = 13?
ooohhh ok
so i will do SoftwareSerial mySerial(13, 12);
and my software rx = gpio13, software tx = gpio12
@stuck coral not that it seems a little quieter, could i ask you another question?
Sure
So I have my optocouple now using pin 3 on the esp-01, but as soon as I power the whole setup, the pin pulls high and stays high. Even after adding digitalWrite(LED_PIN, LOW); to my setup
am i doing something wrong?
Do you set the pin as an output first?
not likely, as i don't know what that means nor how to do it
yes this is the code ```void setup() {
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW);```
Okay, you said you were using a breadboard?
yes
How are you fitting the ESP02 on that?
Got it, are you testing if its high or low with a multimeter?
no, i have an led connected to the other side of the optocoupler
Oh, do you have a multimeter?
yes
Would you mind removing the wire to the optocoupler, and testing the IO line with a multimeter?
We also dont know if its booting, if you attach a wire that prevents it from booting it will stay high
its high
Okay, does it stay if you remove all lines but GND and power?
do you mean does the pin 3 still stay high when i remove all cables but vcc and gnd?
Yes
rl�d⸮⸮⸮⸮l⸮|⸮⸮d⸮c|⸮⸮⸮⸮r⸮c⸮b⸮Nn⸮�dNn⸮⸮⸮cp⸮cl rdp⸮n⸮⸮l⸮⸮⸮bN⸮o⸮$⸮⸮⸮b⸮Nn⸮$⸮⸮�d ⸮nol
n{⸮⸮⸮ocd r⸮⸮oc$⸮"⸮⸮$⸮lr⸮`⸮⸮o⸮ === Booting ===
hi
hi
this is on 115200 baud
There you go @sweet sleet ! I guess the debug info on boot isnt 115200 for the 8266, it is for the ESP32
so nothing's coming in on the rx software serial pins
Are you sending a command via software serial?
yes
Code?
so the only other cable connected was the ch_pd, after disconnecting that, the gpio 3 did not pull high anymore
The s.Write() is still only seven bits, not eight so its shifted @sweet sleet its not the command you want to send
@stone dirge that means it wasnt able to boot because you were using a pin used for uploading. Those ESP01s are... somethin
So I shouldn't use gpio 3?
do i have to hold flash when flashing
@stone dirge what are you using 3 for? Im having a hard time remembering if that was the opto pin
@sweet sleet might have to press it
You suggested pin 15, but the esp01 doesn't have that, so you said pin 3 might work.
Ah yes, no its a different pin causing the issue, what other pins were you using?
@stuck coral i'm getting random 's' now printed
The pins i was using was vcc, gnc, ch_pd
Correct, since you now no longer have a serial connection with three devices on it
Than the s is from the green board
🇸
@stone dirge so you have VCC and GND going from the breadboard right? and For now you have 3 unconnected and now its going low right?
@stuck coral sorry. i made a mistake and wrote to the hardware serial which is why the s was printing
it's gone now
@stuck coral yes
@stone dirge if you connect that to the opto, does it stay low?
Let me try after I eat dinner, I'll let you know
yes it goes low, but weirdly enough, when i put my hand close to the circuit, the led turns on. when i move my hand away, it turns off lol
so confused
Part number for opto isolator?
Im not sure why your hand would be coupling to that circuit
Oh you must have a floating reset pin
So when the ESP boots because of a reset the pin goes high
goes back to pulling high all the time
i forgot to mention
when i turn on my circuit from off without the opto inserted and then inserting it after the fact, everything works great
meaning my original setup, on pin 0
Yeah, youre having the stupid boot issues, I hate the ESP8266
everything is responsive
i see
yeah it seems really touchy
have you heard of anyway around having to unplug and plugging on boot?
Its because every pin on the ESP01 is a pin that does something for the boot process, I never recommend using ESP01s
yeah, that makes sense. I bought it before i did any research. going back, i wouldn't buy it again
that being said do you have a recommendation on a better wifi module?
The ESP32 is wayy better, it still has some pins that do this but on every ESP32 board I have seen most of the pins are exposed that are just general IO. I like to recommend the Adafruit ESP32 feather if you want WiFi
ok good to know
welp, unless you can think of anything else on the matter, thank you for the help.
You're welcome, could troubleshoot more but those modules are such a pain in my existence and if I used a ESP8266 IC I wouldnt have anything but the programming circuit connected to the pins you have available to you
I'm replacing my ESP8266 HUZZAH breakouts with ESP32 HUZZAH breakouts.
Because, yah, ESP32 is a lot less trouble.
good to know, thanks
@stuck coral i checked sprintf but cant make it run, can u please tell me what i doing wrong? thanx
https://pastebin.com/raw/HwgUepXD
@stuck coral
Showed My friend a pic and he says
Looks like the pic isn't powered, where's your external 5v supply? (the 5v pin on the module doesn't supply 5v unless you connect 5v externally)
So i guess i need to externally power
Correct, I told you that the first time we spoke
Did you never connect power to the green board @sweet sleet ?
@bold island You are using it incorrectly, you should use it like this - sprintf(topic, "pzem[%d]/voltage", i); within the for loop
Though I would like to note, it is smarter to use pzem/ID/voltage in MQTT so you can use wildcards easier
5V, if the boards doesnt draw much you can connect the USB pin on that ESP to the 5V pin on the green board
Looks like on the nodeMCU USB is labeled Vin
@stuck coral its working thanx a lot for pointing me the right direction
Yes, that is the power from the USB which is 5v, the level shifter shifts logic, is isnt for regulating voltage. But the 5V from the USB is what you want to feed into 5V in the green board so you dont need anything between them
So instead of me currwntly using the 5v red wire
I will plug it directly from vin to where it is now on the green board
You still need that wire for the level shifter
Hmmmmm
I see a second 5V pin on that green board, am I right?
I think that’s for 5v out to the next green board
There are 3 green boards
Supposed to be like this
The 12v is for powering the mechanics of the display
Did you get rid of the level shifter?
No I’m testing it now
Because the d1 controller wasnt working so I’m using the esp with the level shifter
But just plugging into one of them for testing
If you have only one, then connect that other 5V line to the Vin
The 5V lines will just be connected
Unless that is some really niche board with isolation but I doubt it.
Otherwise it would be marked
Like this
I also have this
5v usb power supply
But then how do i read from the serial monitor?
Or is the computer usb 5v sufficient
Computer USB is probably OK, what does the green board do?
they are counter displays
Oh very cool, do you know how much a digit draws for power?
very little power
Just use the computers USB
okay
ok cool. plugged it into usb 3
i'm still not getting any debug msgs
it should be powered now
the 12v i am ignoring on the green board
but i have the gnd plugged in thru the level shifter.
5v plugged in thru lvl shifter
and then another 5v directly from the esp vin
Oh okay, than that will draw very little nevermind I thought the coils were on 5V you can throw that on any USB. And correct, you are supplying power from the Feather to the board that you have from USB, 5v. Than you supply 3.3V on the low logic level side, so it knows what voltage to use on the 3.3V side. The 5V from the board than goes to the level shifter, so the level shifter knows what voltage to use on the 5V side. One both sides you have a ground, which are shorted together, so that the ground on the ESP is the same ground as on the level shifter, and the board. Than you have the RX and TX on their respected sides for communication at the voltages you fed on the LV/HV pins
there should be a red light on the green board when it's powered sufficiently
so it seems it's just not
i may need a separate supply, but have the logic go thru this shifter?
sorry i could be wrong
Well you have your RX/TX for each on either side. And let me see how you wired it
Nice, so that does not work?
maybe it is a power issue...
maybe the rx pins don't work??
the maker of the board sent me that
(the 5v pin on the module doesn't supply 5v unless you connect 5v externally)
i don't know if he's being overly cautious
Yeah, he means you need to connect it to power, which you did, via the USB power
Do you have a multimeter?
No. Should i get one?
If you plan with working with electronics more than this one time, yes
Is this one ok
AstroAI Digital Multimeter with Ohm Volt Amp and Diode Voltage Tester Meter (Dual Fused for Anti-Burn) https://smile.amazon.com/dp/B01ISAMUA6/ref=cm_sw_r_cp_api_i_DOitFbJNPW1BP
It will probably get the job done for a while, for that price dont be sticking it into wall sockets but itll work alright
Buy AstroAI Digital Multimeter, TRMS 4000 Counts Volt Meter (Manual and Auto Ranging); Measures Voltage Tester, Current, Resistance, Continuity, Frequency; Tests Diodes, Temperature (Red): Ground Resistance Meters - Amazon.com ✓ FREE DELIVERY possible on eligible purchases
You get what you pay for with multimeters, and that second one is autoranging which is nice
Oscilloscope is a graphing instrument depicting signals that change with time.
Oh i just realized i have a friend who is an electrician
He may have an oscilloscope
Electricians don't own oscilloscopes. ;)
haha.
They know more about electrical safety that electronic techs typically do.
I couldn't rewire the house without consulting one, and even then.
iunno rewiring a house is fairly simple in compairison to microcontroller stuff... just make sure ya turn the breakers off first
More power is more dangerous
Troubleshooting is so difficult for a noob
Thrown into a new world of confusion
Good community here though. Thanks for the help
@stuck coral the light on the board is on! i think it's properly powered
Hi, does anyone have an idea how to best diagnose a defective sensor? I've recently bought 4 Sensirion SHT31 and I cannot get them to work at all, despite not having any trouble with a SHT 20 in exactly the same shell. I've tried with different cables, used 2 different Arduino MKR 1010, 4 different ESP32-S2 Saola in any combination with the sensors but I've been continuously unable to produce a reading. Connecting the SHT 31 to the Arduino MKR actually prevents the board from being recognized by my PC, which leads me to suspect that the wiring might be faulty, but I have no idea how I would go about testing that without risking breaking the sensor or board.
i made a mistake. GPIO13 is my RX (black), GPIO13 is TX (white wire).
SoftwareSerial s(13,12); //my code
https://www.arduino.cc/en/Reference/SoftwareSerialConstructor
So black needs to go into tx in the module and white to rx. now my serial monitor is just printing gibberish
Open-source electronic prototyping platform enabling users to create interactive electronic objects.
i am reading 2 values from 19 sensors and pushing to mqtt, but i dont know why messages count in mqtt explorer are not same, seems like not all messages delivered.
example: sensor 1 - 2013 messages, sensor2 - 1794; none of these values can be divided by 19, it starts to be off almost immediately. Anyone got idea what it can be ?
I built these Adafruit Kaleidoscope eyes (https://learn.adafruit.com/kaleidoscope-eyes-neopixel-led-goggles-trinket-gemma/overview)a couple of years back. I have since lost the code I have on the trinket currently. I think I customized
the code to some extent. I want to try to modify it a bit but I don't want to lose what is currently on the trinket. How do I download the code that is currently on my trinket?
@brazen dew
PA30 == SWC
PA31 == SWD
ref.
Schematic Diagram: Trinket M0
https://learn.adafruit.com/assets/45723
Unfortunately that's way above me as I don't know how to read schematics. Is there a way using the arduino software to just download what's on the trinket instead of uploading to the trinket?
Can't find the physical locations for those two pads, on a brief glance.
Oh, wait. Here they are:
https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/pinouts#secret-swd-pads-2910533-5
You use SWD physical interface (similar to JTAG but only two wires) to talk to the target on a hardware level, bypassing the USB interface entirely.
Presumably, you can lift the binary image off the target's flashROM.
It should be noted that I'm using the Trinket Mini and not the M0
Even that doesn't quite generate the assembler source code, but it can give a window into what's happening.
I don't know the Trinket Mini, but I'm guessing it's AVR based.
I don't know anything about AVRs at this level. ;)
Well thanks for your help! I appreciate your time.
Atmel ATtiny85.
The question is: what is the JTAG/C2/SWD-work-alike interface to that chip. ;)
When a flashROM based microcontroller is made at the factory, it's uninitialized to any running code.
These electrical interfaces I mentioned are usually the first thing used to talk to a new chip off the assembly line.
Where I was going with this:
a) You saved the binary image to disk, and can find it again
b) That at least gives you something to compare with.
or,
c) You are willing to disassemble the binary image to learn from it.
objdump is used to map source code to a binary image.
It requires the source code, to make use of it.
Ok, well you definitely gave me some things to look into. I was hoping the answer was a quick "download this software and it will pull the source code off the chip".. as I'm not super technical, but this is a good project.
Thank you again for your help
You're welcome. For what it's worth:
I tend to store identifying marks in the binary image that allow me to identify that particular program version, uniquely.
Definitely a good idea.
I also sometimes physically store an inexpensive USB thumb drive, with all code and documentation, with the project.
Usually inside the case that holds it, if there's room.
I'm normally good at backing things up, and I had it backed up on a 2TB external drive.. but a crazy ex decided to throw it.. 😢
;) those crazy ex's.
The worst.. lol
github is a good tool here, also.
It's been reliable enough for me that I don't bother with the USB thumb drive, in practice, anymore.
The hard part: making a small change and failing to annotate it.
Also, I rely too much on my (human) memory/recollection, which is a bad habit. ;)
The J-Link EDU is the way to go, for first try at lifting code (binary only) off a target.
(also provides live debugging so it's a big win, the rare times a novice will try to use it)
Works on the majority of targets you'll work with.
Hardest part of that system is physically interconnecting to the pads on the target board, as they are rarely brought out to thru-hole connections on the edge of the target board.
Usually just pads in the middle of the board (usually the the back of the board, away from component side of the board).
The STM32F4x Discovery board (from st.com) is USD $20, has the same MCU family as the Adafruit equivalent.
It has an on-board ST-LINK program (separate MCU!) that will do these binary dumps in a pleasant user interface.
Nothing else to buy; USD $20, but (of course) it's an STM32 MCU.
I think you can bypass the ST-LINK and go for a DFU interface, as well, by setting jumpers on that board.
(also runs CircuitPython)
@austere valve @sweet sleet @bold island each asked questions in recent scrollback. ;)
I'll check these things out
Questions were wrt
a Sensirion SHT31 sensor not responding in MKR 1010 and ESP32-S2 environments,
Serial Monitor printing gibberish (SoftwareSerialConstructor),
and
2 values from 19 sensors pushed to MQTT, where messages sent and messages delivered (in count) were unequal.
In general, upload code and schematics and physical photographs of the implementations, to get better answers. I prefer github for code repositories, but some 'pastebin' type sites can be more convenient for quick questions, if there's no github repository yet.
Also basics like part numbers, software dev environment (Usually Arduino IDE, for this channel) and short, meaningful test results from experiments performed. ;)
Mention the communications protocol used, such as i2c and SPI if they apply.
https://git-scm.com/book/en/v2
Good git reference book.
Note that uploading a respository to github can be very simple. The vast majority of code found on github has no revision history at all. ;)
Example of pointing to an exact line in the code, on github:
https://github.com/wa1tnr/m0_terminal_uart/blob/stm407dsc-cc-blk-/terminal.cpp#L18
i am reading 2 values from 19 sensors and pushing to mqtt, but i dont know why messages count in mqtt explorer are not same, seems like not all messages delivered.
example: sensor 1 - 2013 messages, sensor2 - 1794; none of these values can be divided by 19, it starts to be off almost immediately. Anyone got idea what it can be ?
@bold island i am running HA on i7 via xpenology. Once i switched to external mqtt ( on the same host eclipe mpsquito via docker) i have no more lost messages. Is the mqtt installed via HA less powerfull than the one outside HA ?
@bold island Wild guess: #help-with-wippersnapper-and-adafruitio channel participants would be in a better position to answer that question.
@pine bramble maybe
Also your pastebin in that channel has expired.
@stable forge
https://github.com/adafruit/ArduinoCore-samd/blob/master/variants/feather_m4/variant.cpp#L92
I think that is supposed to reference PA25 not PA27.
(checked in CircuitPython and Feather M4 Express schematic)
@pine bramble could you file an issue? Thanks.
@stable forge all set.
https://github.com/adafruit/ArduinoCore-samd/issues/260
Has anyone been in the situation where you updated someone’s Arduino library, but they don’t check GitHub very often. So you’re not sure if you submit a pull request to their library or just submit your own updated library to the library manager?
You should submit the PR, if everyone submitted variations to the lib manager there would be chaos
If someone would like the fixed version, they can download the fork
I would change the name of the library so it wouldn’t conflict in the library manager.
And it’s not that their library is broken. The one I have just has a more useful (at least for me) variation.
Arduino is beginner friendly, so having multiple of the same library but different forks is unhelpful to people who may not totally understand, you can submit it if you want but I recommend PR
That makes sense. I usually spend hours comparing libraries to make sure I’m using the most useful variant or implementation, so I can see your point there.
I am using an Arduino Leonardo to have hotkeys for OBS but they dont work
I have it press Ctrl + Alt + Shift + F7 to change a slide but when i press the button on the leonardo when the OBS window is not focused it doesnt work
But when the OBS window is focused it works fine
Sounds like an OBS issue, since the Leonardo is sending the right key stroke
https://www.youtube.com/watch?v=QS1rGdFrBd4
im following this tutorial To setup lcd with arduino and the problem is im getting this some kind of noise
Arduino - connect lcd without potentiometer | no pot / Resistor | Full Tutorial | KesPra ✔
Program written In comment.
(Can not write in description)
Material Requir...
Sometimes it does get it right
So does anybody have any idea why it's doing this and How i can get rid of it
Seems like a bad or missing connection
i have doubled or even trippled check every connection also in that tutorial he is saying to connect the Anode(A) pin to digital pin ~9 which doesn't work for me so i connected it to 5v
The anode pin is just for the backlight, I was thinking maybe EN or RS or DC wasn't hooked up properly and causing it to occasionally miss commands or data.
need help getting canbus data. i have an uno r3 with a canbus shield, connected to can h and can l to device. i installed mcp can library already, and using an example sketch to receive can, i edited the baudrate to the correct one and then uploaded- now what do i do? is there a saved file somewhere? serial monitor shows all unrecognized characters
EN and Rs are connected fine with Digital pin no 11 and digital pin no 12
E = D11 and Rs = d12
@digital olive could I have a pastebin of your code?
@digital olive could I have a pastebin of your code?
@stuck coral sorry how do i paste bin
so the issue might be that the hardware, i know it's 250 and my crystal is 16mhz however i have a can h can l grnd and 5v pinout
i only have the can h and l connected to the source, im wondering if it needs to be grounded to the source
You need a common ground, yes
i can't find specific info on my canbus shield, it's inland, aka microcenter
A can transceiver has a maximum common mode voltage. If the common mode voltage of the differential CAN signals exceeds the maximum, then the transceiver will not be able to recognize the bits. In practice, this means that the grounds of CAN nodes have to be connected (although a small voltage differences between grounds can be tolerated).
However some CAN systems dont need a common ground due to isolation
In a perfect world you dont, but in most cases you do
ok, do i need to utilize the 5v pole
Wdym by utilize?
connected it to anything from the shield
No..? If both devices on either side of the wirs are already powered you do not need to run positive voltage from one to the other
right ok
Sorry for the ..? but I was still a bit confused
alright i have everything connected, wehen i run that sketch then go into serial monitor it says failed
Means the micro and your can shield cant communicate
that sketch was sent to me from a dev, however if i run the example sketch from the library for can receive, it enters config mode successfully
but i need extended id's with that sketch
Without modification?
only modifying the baudrate
I see in the examples they use a CS of 10, while the code you gave me uses pin 53
Are you talking about the serial baud? That makes no difference with the CAN shield, what are you using in hardware for a SPI chip select?
You chip select is wrong, thats why you cant talk to the CAN shield
ok
MCP_CAN CAN0(53); // Set CS to pin 53 on Arduino Mega 2650 your UNO doesnt have a pin 53
If I had to guess, replacing 53 with 10 will fix it
yeah i discussed the mega vs uno r3 discrepancy with the person who sent me the code but not helping
If you change MCP_CAN CAN0(53); to MCP_CAN CAN0(10); does your sketch start working?
Awesome
Are you running the exact code you sent me? Minus the change I told you to make?
exact code, 53 changed to 10
Try changing the serial monitor from 250000 to 115200
Okay, if at the start of loop() you add
Serial.println("Test");
delay(1000);
before your if statement, what prints out?
it says what i previously posted and test test test over and over again
Great, so the code is working as it should, your if statement isnt becomming true
You can remove what I had you add
if(!digitalRead(CAN0_INT)) this isnt becomming true
hmm
Do you know which pin the IRQ is on your shield?
Do you have any documentation for it?
standby
okay so i ran an example again with the serial baud rate down and this is what i got
Yep, the example doesnt use the IRQ right? I'll be back at my desk in a sec
Oh it does #define CAN0_INT 2
Change your IRQ pin to 2
Line 18 which is currently #define CAN0_INT 11 should be #define CAN0_INT 2
There you go, you just had the connections to the shield wrong, easy fix
i changed that and then had to hit the reset button and turn on the battery immediately while in serial mon
Hm, not sure. If you press reset mow on the Arduino, then reopen the monitor does it work or no?
doesnt even matter now because this is all i needed
Okay, great
this battery pack does not indicate green fully charged until delta mv is 100 or less between cells
been on the charger for a week already
wanted to know how far off it was
Hm, is it an old battery?
no its a refurbished one which received updated firmware in order to prevent imbalanced cells from getting way out of wack over time, thus creating a long initial charge to get them aligned
can literally take 2 weeks
From what I know about batteries, that doesnt sound right
Some battery managers switch in an impedance across one cell while charging the others at very low current (like 5mA). With a big pack, this could take days.
Capacity, not voltage
297wh, 5.7ah
Oh dang, okay, well Im looking at the battery board and yeah nevermind if its super slow it would take 7.91 days
From bodgers 5mA figure
And looking at the itty bitty current resistors they are using for balancing I would believe 5mA
yeah thats what ive been told, 5ma
Weird the board looks super over engineered as far as a processor and stuff, but I see very few legit power components
thank you so much man for your time, very valuable
You're welcome, glad to help
since the co went out of business, people are reverse engineering everything in order to troubleshoot problems themselves, this includes battery bms, ESC, and remote firmwares, 3 different firmwares with features
Oh thats right, I forgot they went out of business, dang
believe it or not, venutech.ca has successfully been able to flash firmwares, somehow, the files are not publicly available as Lime scooter bought the company and all encryption codes went with them
so we only had limited access to the IC's and ability to change firmwares up until last week https://venutech.ca/projects/boosted-board
Venutech's Boosted Board Reverse engineering and Repair
i thought the firmware was physically on the chip
It looks like a bog standard micro, so it probably is. But there should be a debug interface
If you dont lock the chip, you may not be able to read the exisiting firmware, but you could wipe it and upload your own if you got access
the access is the issue
what i heard was all encryption key
those keys are with lime and/or nondisclosure legalities
The encryption key is not the same as locking the chips memory
so im not sure how he got in, maye created debugging software?
You still might be able to totally erase it, but thats a big if. And there is some made already by the company who made the chip
on another note, how difficult would it be to adapt the 1602A LCD to the uno/shield to read those parameters i showed
Assuming you had enough pins, not very, which you probably do
would be cool to make a boxed unit out of this to plug into other batteries to check voltages like the sketch ran
With 2G going away, does anyone have any recommendations for hobbyists level call and text integration? Maybe LTE-M and NB-IoT?
@honest obsidian i just snagged a sim7600G which is working on tmobile with VoLTE
Sweet! Gotta link you can share?
4G/3G/2G/GSM/GPRS/GNSS HAT for Raspberry Pi, Based on SIM7600G-H
i was able to get it on amazon
but im not sure if the nbiot stuff is working on tmobile
as i know they have 'certified' devices and this isnt one of them
but i have working voice, sms, and data
so... ¯_(ツ)_/¯
trying to extend the class for the demo code they sent with that module
but im pretty new to arduino and c++ so its not going well
Nice. Is the project on GitHub by chance?
the demo code? no, its on the wiki page though
i would love it if ada made a new fona module with the sim7600g
@broken depot just saw you asked about SIM7600 awhile back, and i just got one and am using tmobile
how would i create a class for this module that lets me pass the serial port to the constructor?
i know the basics of creating the class and constructor but am not sure what or how to pass a serial port
the demo code is hard coded to serial and i want to use serial1, or 2, etc
Hi! am new to this. Anybody can help me? I don't know why the top motor doesn't work
https://www.tinkercad.com/things/jwE6WRH5cvp
thanks!
@left grotto - if that drawing is how you wired it, then the chip in the middle of the breadboard is wired to +Vcc and +Vcc! One of those two connections should be to GND
But assuming that you've wired it correctly - in your code, it looks like it will pulse the motors just once for a very very short time for each button press.
You turn them on, but then immediatly loop runs again and will turn them off (because the command from the IR controller has already been read.... and even if you are holding down the button and the controller is sending the command again and again, as far as the processor is concerned there is an eternity between each of those transmissions - and loop will run many many times while it waits - each time falling through to calling directionControl0 turning the motors off.
thanks! Am triying. How i said am really new to this and it ts difficult to me realizing simple things
my bigger problem is that i didn't know how to control the motor's velocity because i wanted them to be slow
so i started just trying things
Can someone help me understand the function of the DTR pin on a USB-TTL device, and the significance of putting a 0.1uF capacitor between the reset pin and DTR, from the perspective of uploading code via optiboot?
@left grotto the usual way to control motor velocity is using PWM: you connect the motor to one of PWM - capable pins (usually labeled with ~ on the board) and use analogWrite() function - see e.g. https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/overview
@midnight mulch DTR ("data terminal ready") is a serial communications signal that Arduino boards co-opt to use as a "reset" signal. In order to make the signal into a pulse, it's coupled with a capacitor. It's a bit of a hack, but it has become the usual approach.
What's the best way to send data wirelessly to a computer?
I've seen a few resources on how to send POST requests but I wasn't sure if that was the best method.
@mellow flax Depends on whether the device that is sending the data is anywhere near the computer.
@midnight mulch DTR ("data terminal ready") is a serial communications signal that Arduino boards co-opt to use as a "reset" signal. In order to make the signal into a pulse, it's coupled with a capacitor. It's a bit of a hack, but it has become the usual approach.
@north stream
A reset pulse involves taking the reset pin to ground and back doesn't it? Because the default is a 10k pull-up to VCC? What exactly does the capacitor do here? I'd imagine you charge it up with a positive signal, thus repelling the electrons on the other end of the capacitor (which is also pulled to 10k), and when you ground the capacitor on one end, you attract the electrons on the other end briefly until an equilibrium is reached?
Sorry I'm an electronics/physics/chemistry noob.
The 10k pull-up gives the reset pin a default state (not reset). When the DTR line goes from low to high, that low to high signal couples through the capacitor to make a positive going pulse that doesn't really do much, it discharges through the pull-up resistor and the chip's protection diode. When the DTR line goes from high to low, it makes a negative-going pulse that resets the chip, and then the capacitor discharges through the pull-up resistor.
The width of the pulse depends on the value of the capacitor and the value of the pull-up resistor.
How exactly is the pulse generated? Is it similar to the mechanism I suggested?
Yes, the pulse is generated by setting the DTR line low (then high again a little while later)
sorry I phrased that wrong
I was wondering if that is the best way to send data over a network
Still depends on what you're trying to do 😉
That's one of those "it depends" questions. You can use UDP for fast stuff where dropped packets are okay, TCP for guaranteed delivery, etc.
can someone help me with connecting to roboclaw motor controllers to the arduino?
Im useing the softwareSerial object thing to connect the roboclaws, but I cant take encoder outputs from both at the same time
like if I take outputs on one, then the other doesn't work.
like heres the code, where only roboclaw2 gives encoder outputs
That may be a limitation of having multiple high speed software serial ports in operation at once
is there a way around that tho
It depends...
uhh like what do I need to do to get it to work...
What are you actually trying to accomplish?
like take the encoder outputs of 3 motors
Why do you want to take the encoder outputs? What are you going to do with them?
to make the motors run to an accurate position
I think the Roboclaw controller can do that for you
do I use that SpeedAccelDeccelPositionM1 function
cuz I never got it to work even with one roboclaw :/
but I still want to have the info for where the motors are at
That's going to be tricky, you may need to either have a second processor, or use one with more than one hardware serial port.
Yes, the pulse is generated by setting the DTR line low (then high again a little while later)
@north stream
And I suppose the bigger the capacitor the bigger the pulse? How does the resistor relate to the pulse? Does a bigger resistance mean it takes electrons longer to go from the source to the reset pin?
@deep tapir I think the easiest option would be to get a MCU with several hardware serial ports. E.g. SAMD21- based such as Adafruit Feather M0; you can add more hardware Serials to it as described here: https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports/creating-a-new-serial
Basically the bigger the capacitor and bigger the resistor, the wider the pulse, so you can use those to adjust the amount of time the pulse lasts.
Aah sweet! Also, is it just me or does the optiboot bootloader not work when using 3.3v VCC on the USB to TTL device while uploading? Tried this on 6 different Atmega8A chips and an Atmega328, with a CP2102. Only the upload has issues. They power on just fine and run whatever has been burnt to them when using the 3.3v Vcc. I also noticed that a 10k pull-up on the reset pin was needed to upload code (without it the code wouldn't upload), but the chips themselves would run fine with just the internal pull-up.
@vivid rock is there any way to plug an encoder directly into a digital pin of an arduino or sth
cuz I only need to run 3 motors, so like I can use 2 with the roboclaw and 1 with the arduino
This is a really good encoder library for just such use: https://www.pjrc.com/teensy/td_libs_Encoder.html
ok thanks!
I was wondering if that is the best way to send data over a network
Still depends on what you're trying to do 😉
just trying to send temp and soil moisture data every minute
I've already made a HTTP server in go for receiving POST requests
probably just going to go with that unless there is a big reason not to
That should be fine for that use case.
@left grotto the usual way to control motor velocity is using PWM: you connect the motor to one of PWM - capable pins (usually labeled with ~ on the board) and use analogWrite() function - see e.g. https://learn.adafruit.com/adafruit-arduino-lesson-13-dc-motors/overview
@vivid rock and how can do the motor rotate in both ways with this?
Hi I am a 100% noob and have never done anything with arduino but i would like to do this please help Im doing this
https://www.youtube.com/watch?v=TRnu2_TI9Vk on a HiLetgo 1PC ESP8266
I don't work with anyone. Beware of Scammers Please Contact Only through My Email mesh.drone@gmail.com
You can Donate to Cleric for his hard work now
(Donate Button On Bottom of page)
https://github.com/Cleric-K/vJoySerialFeeder
Arduino Nano V3
https://www.banggood.com/ATm...
@reef ravine when your around i tried the capacitors they made a difference but still not interference free so I bumped them to the 25uf ones and it was way better with noise still. Is the 100nf capacitors bigger than the 25uf ones?
100nF is 0.1uF. Nano versus micro.
Whats pf then?
@fallen canyon Check this out http://www.scientistcindy.com/uploads/8/5/1/2/85124478/published/meter_4.jpg
Ok so pf is less than uf
Might have to double the capacitors with the 25uf ones
@stuck coral thanks for that chart
It works! Thank you all for the help
@stuck coral funny how some of these prefixes are only used in very special situations. I've never seen hectometer outside of dictionary, but hectoliter is rather usual in wine industry...
so daisy chaining the capacitors didnt work... im guessing that isnt possible
er well possible but wont work
so a 10uf capacitor which i mistook for a 25 takes out approx half the noise on the curcut
@deep tapir There are two ways to install the encoder library. One is to run the Teensyduino installer, which will install it for you (along with all the Teensy libraries and support). The other is to clone the git repository, and then install it with the Library manager as if it were a zip library.
I guess a third way is to just clone it into your arduino/libraries directory.
@fallen canyon Did you try 10 or 100nF?
no, nano farads
havent tried nF
ok, .1uF didn't help?
1 uf did a tiny bit
but it was way mor noticable with 10 uF\
cut the noise in half from what i could tell
is the shield of the CAT5 tied to ground?
is it cat5 or just 8 conductor wire?
Cat 5 needs a shield if I remember right, usually its that plastic with the metallic coating
it says cat5e cable but could be just 8 wire since it was alot cheaper to buy 100 feet of this than a 25' cat5 cable premade
hmmm, CAT5 does include shielding
as a test it may pay lol
going to 10uF or more means it isn't the solution
this is in the loom right?
yup but i tried doing it with the other cat5 and was getting a bit of intertference still
the one thats not connected
but its much better tha the one in the loom
so when i use the foil should i be grounding that?
yes on the micro's end
maybe wrap some stripped copper wire around the foil to make the connection
ok ill try that out tomorrow... if i gotta go full redneck with ducktape and aluminium foil ill do what i gotta do
some actual shielded cable would be better, just saying...
lol thats a 45 minute trip to town to get something im not 100% sure is gonna work lol and then there is also the rewiring factor
true, but real CAT5 uses twisted pairs and shielding, it's gotta be better. The foil test may prove the point
I'm not convinced shielding is the issue here, but finding out would require some test equipment or A/B experiments.
so far if the wires are not in the loom with power and stepper drive signals the problem is much reduced
also without powering the stepper drivers there is no interference
how many limit switches are you using?
8
so each input, through the cable, to a reed switch, to ground and using INPUT_PULLUP?
where is ground?
ground is a 16 gauge wire in the same loom running back to the board
i could common ground the trailer but i was trying to keep this whole system seperated
so that i dont have any feedback issues from A/C somehow
if you pull just ground out of the loom does it get better?
without any switches tripped would that make a difference?
it seems the stepper pulses are causing noise that is getting to the inputs (toggling them, when they should only be high or low) whether any or all switches are tripped
yeah thats pretty accurate there
something else that could be tried is using just INPUT and adding lower value pullups externally, maybe 10K or 4.7K , the internal ones might be up to 50K
cuz even unplugged from the limit switch line and plugged into the other line and thrown out the window it still trips them... the onloy thing i dont understand is it doesnt happen when the cat5e male end is not plugged in and i have the short run of cat5
thats almost the entire setup there and the cat5 has been moved away from the stepper driver on the left from where i had it before
i brought it down centered to try and give mor room from the stepper drivers
where were you putting the caps? in the terminal block?
yup right in the screw down conntectors then running a female pin to male pin wire to a breadboard that ghas the wires to the cat5 on it
maybe my shielding needs to be for the board
from those closest drivers
hmm, the caps need to be as close as possible to the input pin
thats the closest i can get
if you move the arduino does that help?
havent tried that yet
its nested in a noise generator lol
il try it tomorrow tho im on a shor lead from the way i have it wired
haha yup
if i have to rewire the entire thing im alright with it but i definatly want to test it to make sure thats gonna fix it first lol
Can anyone help with adafruit io? I have a momentary switch which when pressed sends "1" and when released sends "0". On the adafruit webpage on my pc, the switch works perfectly, but when using the same switch, on the same webpage, on my phone pressing it will send "1" and will not send "0" when released. Do you know why this would be?
so it works on the PC browser but not on the phone?
refresh the page on the phone?
now when pressing it on my phone, it sporadically sends either 1 then 0, 0 then 1, and sometimes just 1
but flawless on the PC?
yes
sounds like a question for #help-with-wippersnapper-and-adafruitio
so weird, i'm assuming has something to do with the phones digitizer
nice job on the nrf power switch btw
@fallen canyon I thought you had a breadboard, you could try putting the caps in the terminal block directly, hanging them on wires isn't a great way to reduce noise
and the external pullup resistors could be mounted the same way
yes just pinMode(x, INPUT)
a pullup is needed, the internal ones are "weak" pullups, a stronger pullup should reduce the noise
so the issue i had with them only being inputs is they fluctuate from high to low
when in testing mode anyways
you do need a pullup or the input "floats" and can randomly toggle
ok, let us know (grab an oscilloscope if you can 🙂 )
lol i dont have acces to one right now
thought about turning an old iphone into one
once i make that into a deck and it slides in and out and stops where its supposed to i can do my electrical and have light so i can work... but by then testing will be done on this lol
yeah a few steps to reduce the noise, move the arduino might help. are the stepper drive outs routed away from the limit inputs?
i have one of the outs next to one of the inputs. havents figured out which input it is but one has significantly less noise than the rest... the capacitors make it almost work perfectly
try the lower value external pullups with the .1uF caps, might be enough
and if you can route the whole cats 5 jack and wires straight out over the USB, away from as many other wires as possible
looks like they are tie wrapped in with drive signals
o removed the ties and its routed different as of today
ok
i deffinatly got work to do more testing though
ill try the resistors and capacitors first
then if that doesnt take care of it ill do sheilding
as short as possible on the leads for both
and if that doesnt do it ill move the arduino or maybe set different pins for things and see if that helps
i doubt its a pin issue
i stil need to figure out the whole having one almost .working perfctly and see what pins they are
electrically all the inputs are very similar
see if i can figure out what the difference is there
ill be super happy if throwing a resistor in the run and the capacitor solves it
for test can you enable only one input? then you only need to make that input quiet, then do the same thing on the others
i can do that for sure
i can actually do that anyways since nothing moves without them working right
not sure i follow that, while travelling all would be open (inputs HIGH)
Well since the drivers are all disabled with the noise then i can just mess with one circuit till it works right. Then from there copy that design
The only thing now is how to make my input stay high with the external pullup
if the drivers aren't running the switches all work correctly no?
That’s correct
just checking, getting late lol
Lol are you on the east coast?
yes in the hills west of NYC
Yeah its late for you then for sure
I noticed alot of people here are on the east coast
maybe b/c Adafruit is a NYC based company
Could be that
Either way dont let me type your eyes off. I appreciate the help and all the different troubleshooting tips
no problem, its a cool project and it should be doable, noise is tricky to track down with "just a wet finger" 😉
in industrial systems sensors are usually on a current loop or RS485 system just for this reason
Well if i need to get another piece for this puzzle i can
But the project is gonna be 30-40 grand as it is so i was trying to keep all costs lower to do more cool stuff elsewhere
hopefully lowering the input impedance from 50K to ~5K helps
We will find out tomorrow 🙂
Hello ppl.. im trying to put a string into EEPROM using EEPROM.put(Address, String);
Im haivng issues trying to use strings longer than 8 bytes.. it just garbles the string in the EEPROM.
Thinking i should use EEPROM.write instead of Put.
@reef ravine On certain weather days I can see the tops of thunderheads over Poughkeepsie (from about 50 miles ENE of there).
so im working in Visual Studio (PlatformIO) and i currently have my code with ESP32 (when you make a project you have to select the board your working wit) but i want to try my code on a ESP8266, how can i copy/duplicate the project in VS PlatformIO to work with ESP8266? anyone know? 🙂
@main jay Looks like you're right: put() is designed to write stuff like ints and floats.
I solved it @north stream Thanks! 🙂 its more secure to just do a EEPROM.write instead 🙂 that way i know i get the exact data where i want it.
How do you Arduino C/C++ folks do multithreading?
Asking from the perspective of an ARM core with >= 20k RAM.
Don't think the puny 2k RAM of an Atmega8A has space for these sort of primitives.
A typical Arduino pattern is to have one main loop using millis() with a state machine, plus various interrupts, rather than real multi-threading.
Well... I'd like something that's got a message passing vibe. And mutexes.
Outside of Arduino, FreeRTOS is common for ARM systems.
Is there a FreeRTOS for the SAMD21 and the SAM3X8E? Got a Xiao and a Due to monkey with.
Almost certainly for the D21. Don't know about the 3X, but likely. They have a list of all the architecture ports.
But some C based super light scheduler would be nice to have for platforms like the STM8 and Atmega8A.
What's the typical IDE setup for FreeRTOS like? A VSCode plugin or something like that? Be nice if you could do ctrl+click to go to definitions, have global reference lookups, and quick refactors, in an opensource IDE.
Whatever you like. FreeRTOS is just some extra C source files, so it'll work with any toolchain targeting your chip.
They have example projects for a number of them.
Yeah but what's the convention like if you want the full IDE experience?
I'm not sure there is a convention. It runs on dozens of chip architectures, so they try to be agnostic about that.
Maybe see what the SAM example projects use?
I'm not sure there is a convention. It runs on dozens of chip architectures, so they try to be agnostic about that.
@cedar mountain
I meant from an IDE perspective.
It's nice to have a little digital grunt that does half the work for you.
I'm just saying it's apples and oranges, like asking "Well if I buy a Ferrari, what house is conventional to park it in?" FreeRTOS is a library you bring into whatever development toolchain you like, it's not an all-in-one ecosystem like Arduino.
Aah okay. So I guess I should be looking for a C toolchain then.
Hey can someone help me with something, I want to make an Arduino shock alarm clock and I have a tutorial but I can't understand it
There are a number of embedded ARM IDEs out there. Keil, various Eclipse-based ones, etc. I just use command-line myself, so can't really recommend one.
Aah okay. I tried googling awesome-arm but ended up with a bunch of workout videos 😂
@midnight mulch once a friend of mine tried finding out how you insert images in LaTeX documents. Unfortunately google search for "image latex" returned somehting else
Okay so common sense tells me I should stick to searching for extensions for popular actively developed opensource IDEs. IntelliJ's C/C++ stuff isn't opensource. That leaves NetBeans, Qt Creator, VS Code, and Eclipse. I'll Google around to see which of the four has the best FreeRTOS plugin.
Platform.IO and Eclipse CDT seem the most promising. I guess I'll monkey around with both and see!
I found platform.io extremely clunky a couple of months ago when I tried it. Maybe I'll start with Eclipse. Been years since I used it and I'm curious.
Eclipse is a bit clunky but useable, in my opinion.
This is less Arduino and more embedded, but is it possible to use a timer (or two) on SAMD5x to handle a rotary encoder? They have a PDEC peripheral but it shares pins with USB so not an option unfortunately.
@reef ravine so i was trying the input theory on the pins on my arduino with an external pullup and it still floats when not activated. is there a way to declare it normally high in the code other than declaring it as a pullup?
@kind onyx I never used PDEC, but why do you need a timer? all you need for getting position from quadrature encoder is two interrupt-enabled pins
There are some nice optimized encoder libraries, don't know if one of them supports the SAMD5x.
@fallen canyon Still at work but if the external pullup is wired from Vcc to the input pin it isn't floating... Switch open should be Vcc (5v or very nearly so), reed switch closed 0V
@reef ravine i got it . Had to read up on proper wiring for an external pullup. The capacitors killed the signal from the reed switches but i got it working good ended up taking a 10r pullup resistor and no capacitor and everything is working with no stutter and stops perfectly
10 ohms?
Thank you for the troubleshooting the noisy thing has been a challenge and a half lol and yes 10 ohms
Well it works for what i need. Is there any issues with that .5A?
times 4 (for full in or full out) is 2A! A 1K doesn't work as well?
the arduino regulator is only rated for .5A (500mA)
Nope 1k skips
And by skips i mean the motor might turn once every ten seconds for half a second
what about a 1K pullup with a .1 or .01uF?
at a minimum you can't use the arduino to supply the +5 for the pullups at 10 ohms
Can try a .01 the .1 doesnt let any signal happen
you mean it never goes low if a .1uF is between the pin and ground?
Yup
something sounds wrong
I dunno it just flat wouldnt sense any signal even if i go to the other end of the cap and then directly to ground
So for whatever reason the .1 wouldnt work. Hadnt tried the .01
the signal doesn't go through the cap, the cap goes from the pin to ground, "shorting" AC, but not a DC signal
maybe the cap doesn't help but it shouldn't be stopping the signal
It wont go low tho
makes no sense, the reed switch is a direct short to ground
which is why I'm wondering, do you have the cap in series with the switch?
So my wiring goes 5v to the resistor to a rail on the breadboard then to the pin. I took the cap and threw in on that rail with the other end on another rail and then on that rail i put the wire for the switch. Ill take a pic in a sec and send it
should be
+5 >> 1K >> pin, pin >> .1uF >> ground, then attach reed switch to pin
so like this, but place the .1uF between pin and ground
here R1 is the pullup, button is the reed switch
Yeah thats how its wired like the schematic and the cap is between the button and the resistor connection
no, between pin and ground, if cap is in series with button it'll never go low
Ok so my wiring is the reason for it not working so the cap would go from green wire to ground?
Right after coming off the pin?
if you ignore everything else, from the pin to ground (dunno what the green wire is lol)
oh the green in pic
In your schematic
right from pin to ground, as close to pin as possible
The cap is its own small energy storage unit right?
the idea being that AC noise will be shorted by cap but DC from switch is unaffected
Ahh ok so that makes more sense
Ill have to go wire that up here in a few. Whats the lowest impedence resistor i could do with the arduino powering the system?
I'd go no lower than 1K, without being able to see exactly what noise is being induced it's hard to say what value is best
@1K the switch will draw 5mA
Ok ill go back to the 1k ones then and try it out. With the cap in place correctly wired it may just work with that
i'm hoping that between a lower input impedance (1K vs 50K) and a small amount of filtering of AC noise (the .1uF) it should at least be a big improvement
Well i will be able to tell ya in about ten minutes lol
lol
@reef ravine your awesome. It works flawlessly with the 1k and t he cap wired correctly
cool, to save a few millis it may work at 4.7K or even 10K as well, but at least at 1K you won't burn your fingers 🙂
Or your reed switches
Lol
Ive broken a few already
Had them set a tad low in the tube and slid it into them... busted three clean off
glass is like that
And im not worried about the amount of time for shutoff lol i am almost sure its over the 1/8” magnet for 10seconds or more
the cap slows the signal only a very little, no problem. if you are curious google "low pass filter"
basically when the switch closes it "drains" the charge on the cap, but with a small value and very low resistance the cap discharges quickly
Yeah I understand what your saying and it makes total sense i kinda followed before the explanation but that makes it 100# clear.
I took circutry about 15 years ago so I understand some things and the rest i forgot
But putting earplugs on my arduino is great and helps me relearn some things and methods
i'm glad it's working well now, and you saved a bunch of aluminum foil 🙂
well if i had to use toilet paper i would have just bought shielded cat5e lol
Ironically, that might have even made things worse.
with the shielded maybe you can loose the separate #16 ground wire
meh its already wired
the 16ga was part of the trailer wiring harness that i didnt use since they double wire one pin on the flat 4 for the brake and running lights
and since it's working with reasonable values - "if it ain't broke don't fix it"
Are there any kinda bluetooth hid "just connect switches (and power ofc)" platform or modules anyone know of?
I planning a arduino lab bench power supply it must be variable around 0-35v anyone can help me?
Which part? The bulk supply? The voltage regulator? Arduino control?
arduino controlled 0-35v digital power supply
I can probably help, and there are several existing projects out there with good information (I think Elektor Magazine had a nice design a couple of years back)
can anyone help me on video game controllers pls ?
What you need
http://www.11st.co.kr/products/2705294484?trTypeCd=21&trCtgrNo=585021
can i use it with arduinos yellow tires?
(don't say about grammar pls :D)
(i am not good at english)
quick super question here! Tomorrow a friend of me and my GF is having a birthday party @ our place! she's a l.e.s.b.i.a.n and wanted a pride themed birthday party! and i have this 16x16 matrix up and running and i can run the rainbow pattern easy! but i thought it would be cool to show a heart with the rainbow colors (scrolling rainbow) inside the heart! is this possible and how?
You want only the pixels in the heart to be drawn? Everything outside the heart is black (or some other color)?
And you already have the rainbow pattern running by itself, or do you still have to do that?
i have a rainbow pattern running
void Rainbow() {
for (byte row = 0; row < NUM_ROWS; row++) {
for (byte col = 0; col < NUM_COLS; col++) {
int delta = abs(NUM_ROWS - row * 2) + abs(NUM_COLS - col * 2);
leds[row * NUM_COLS + col] = CHSV(delta * 4 + counter, 255, 255);
}
}
counter++;
}
OK great. Now what you need to do is define an array heart that is 16x16 values where a 0 means background and a 1 means heart.
Then in the line leds[row * NUM_COLS + col] = CHSV(delta * 4 + counter, 255, 255); you change this to leds[row * NUM_COLS + col] = CHSV(delta * 4 + counter, 255, 255) * heart[row * NUM_COLS + col];
In other words, the heart array is a "mask" for the image.
Where heart is 1 it lets the color through; where it is 0, it uses black.
@lone ferry what's wrong here
main.cpp
https://pastebin.com/zEQqXqA3
MyFastLEDMatrix.h
https://pastebin.com/zEQqXqA3
nothing is coming up on my matrix :S (i switched from ESP32 to ESP8266) i only have 1 ESP32 and that's for another project so i switched
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.
@elder hare It worked with just the rainbow pattern, yes?
Also, you pasted the same link twice.
yes it worked tested befor i switched
wops... i'll fix
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.
there
OK, so the issue isn't with drawing the heart shape but that you now are running on the ESP8266 and nothing draws anymore?
Good because I nothing about the ESP8266 😄
xD
What was it?
i work in VS (PlatformIO) and i have yet to find a way to easy convert 1 project from one board to another so i need to make a new project and then copy the code over! i forgot 1 very important lines in setup
FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
Ah OK!
now back to your solution above 🙂 gonna make that array now
Just make it bytes: byte heart[16*16] = { 0, 0, 1, 1, ... };
now to draw a heart with my skills in 1's xD
Wanna know how I would do this? I would do it in a text editor: put ................ on 16 lines. Then draw the heart with Xs. Then use Find&Replace to replace . with 0, and X with 1, . 😄
haha nice ;P i'll try that
oh man, i wanted to be clever and boost a small solar cell's voltage by using a boost converter circuit but instead of a mosfet or transistor, i flip my attiny's pin to output/input at a high rate to charge/discharge the inductor but i think theres capacitance or something when i switch from input to output
@lone ferry uploading now 😄 hope it works ^^
it's beautiful ❤️ 😄
thank you so much!
Upload a pic 🙂
Nice! If you're really ambitious you could also make the heart itself animate 😉
like a heartbeat 😮
Yes, for example.
To do this you would make multiple heart arrays and switch between them every couple of seconds.
that should not be difficult
No, you already have all the pieces for it.
Hehe. Problem is you need to rasterize that, which can get complicated.
yea the party is tomorrow! this works for now 🙂
only one thing i wanna change tho
void Rainbow() {
for (byte row = 0; row < NUM_ROWS; row++) {
for (byte col = 0; col < NUM_COLS; col++) {
int delta = abs(NUM_ROWS - row * 2) + abs(NUM_COLS - col * 2);
leds[row * NUM_COLS + col] = CHSV(delta * 4 + counter, 255, 255) * heart[row * NUM_COLS + col];
}
}
counter++;
}
the rainbow color comes from the outside and fades into center! i want it to go from left to right
Looks like you need to change delta for that. Maybe int delta = col;
this
int delta = abs(NUM_ROWS - row * 2) + abs(NUM_COLS - col * 2);
To
int delta = col;
Yes, maybe 🙂
hmmm it's a ZigZag Matrix so each second line is flipped
int delta = (abs(NUM_ROWS2) + abs(NUM_COLS 2))-(abs(NUM_ROWS - row * 2) + abs(NUM_COLS - col * 2));
might be a convoluted way to do it, but may work
NUM_ROWS2 should be NUM_ROWS2 and NUM_COLS 2 should be NUM_COLS2
not sure why it messed up when i copypasted lol
but why the 2 behind?