#help-with-arduino
1 messages Β· Page 38 of 1
Laser cutter and other makerspace equip uses the printer interface to receive jobs
So it might be able to work via cups
But yeah not ideal as it's another system for me to maintain π
If cups queueing is a possibility, you can make a front-end queue with auto-hold, and define which computers can touch the web interface to release jobs to the real device. I've had that running on a large-format printer for at least 10 years, maybe 15 at this point.
Good idea, we'll see what happens! For now I'm going to test this hack upon a hack and see if I can trick this microcontroller
Will report back π
I've got a bunch of octoprint servers to deploy anyways so if it comes to it I'll just deploy a cups server too haha
Thanks for the idea
The part that smells bad to me is putting a mechanical switch on an digital i/o. Yeah, USB is supposedly plug-and-play, but this approach feels brittle.
It's analogous to plugging/unplugging a speaker while the volume is up, in my mind.
That's why the USB switch board is being used instead of a simple relay
Well if it doesn't work we can just unplug it and we're back to where we are now lol. If the cups server went down though there might be more to do on software to fix it. I've been using a similar switch manually for a couple months daily with no issues.
Yeah my end goal is to design a circuit to do this directly. And then I'd need to ensure I'm doing things properly. In general this is kind of complicated but it should work
So I could use a nice, optoelectronically isolated solid-state switch in a pretty cabinet, instead of a relay. Hmm.
The Serial.available function needed for the 32-bit boards?
https://www.arduino.cc/reference/en/language/functions/communication/serial/available/
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.
Any reason you don't want to use Serial.available(), @humble anchor ?
@north kelp Hmm nevermind, I now understand the function of it
hi all, so i've recently received an esp32 arduino i bought during a flash sale on aliexpress, and im having trouble getting the tft_espi lib to work with it
https://www.aliexpress.com/item/33048962331.html?spm=a2g0s.9042311.0.0.17164c4dbbJh63 purchased from here
points to using https://github.com/Xinyuan-LilyGO/TTGO-T-Display?spm=a2g0o.detail.1000023.9.796d9ca74TE8x9 config here to interface with the display, and despite following the instructions it seems to still not do anything -- anyone have any ideas?
Smarter Shopping, Better Living! Aliexpress.com
What happens when you run the sample code in the TTGO-T-Display library, @cursive knot ?
/home/nurse/TTGO-T-Display/TTGO-T-Display.ino: In function 'void button_init()':
TTGO-T-Display:50:30: error: no matching function for call to 'Button2::Button2()'
pBtns = new Button2 [args];
^
In file included from /home/nurse/TTGO-T-Display/TTGO-T-Display.ino:5:0:
/home/nurse/Arduino/libraries/LennartHennigs-Button2-4105e70/src/Button2.h:55:5: note: candidate: Button2::Button2(byte, byte, unsigned int)
Button2(byte attachTo, byte buttonMode = INPUT_PULLUP, unsigned int debounceTimeout = DEBOUNCE_MS);
^
/home/nurse/Arduino/libraries/LennartHennigs-Button2-4105e70/src/Button2.h:55:5: note: candidate expects 3 arguments, 0 provided
/home/nurse/Arduino/libraries/LennartHennigs-Button2-4105e70/src/Button2.h:29:7: note: candidate: constexpr Button2::Button2(const Button2&)
class Button2 {
^
/home/nurse/Arduino/libraries/LennartHennigs-Button2-4105e70/src/Button2.h:29:7: note: candidate expects 1 argument, 0 provided
/home/nurse/Arduino/libraries/LennartHennigs-Button2-4105e70/src/Button2.h:29:7: note: candidate: constexpr Button2::Button2(Button2&&)
/home/nurse/Arduino/libraries/LennartHennigs-Button2-4105e70/src/Button2.h:29:7: note: candidate expects 1 argument, 0 provided
/home/nurse/TTGO-T-Display/TTGO-T-Display.ino: In lambda function:
TTGO-T-Display:62:26: error: 'TFT_DISPOFF' was not declared in this scope
tft.writecommand(TFT_DISPOFF);
^
TTGO-T-Display:63:26: error: 'TFT_SLPIN' was not declared in this scope
tft.writecommand(TFT_SLPIN);
^
Multiple libraries were found for "TFT_eSPI.h"
Used: /home/nurse/Arduino/libraries/TFT_eSPI
Not used: /opt/arduino-1.8.9/libraries/TFT_eSPI
Multiple libraries were found for "WiFi.h"
Used: /home/nurse/.arduino15/packages/esp32/hardware/esp32/1.0.2/libraries/WiFi
Not used: /opt/arduino-1.8.9/libraries/WiFi
exit status 1
no matching function for call to 'Button2::Button2()'
appears to complain about Button2
which is installed
removing all the button stuff and it does seem to power on now
OH
TFT_eSPI tft = TFT_eSPI(135, 240); // Invoke custom library
new Button2 [args]; doesn't look like a proper constructor.
Sample code should hopefully work. At least it should compile.
Maybe file an issue at https://github.com/Xinyuan-LilyGO/TTGO-T-Display
I'd expect at least parentheses around [args].
hmm, trying to intiailize the library with that doesn't seem to work but whatever they did in that project made it power on
i'll give it some closer reading and file an issue if i can't get it working
Also, Arduino tends not to use new.
memory inefficient?
We tend to do things like Button powerButton(6);, which creates an instance of Button called powerButton, on pin 6 in this hypothetical constructor example.
so it appears theres a manual control for the backlight pin
I think that line is trying to create an array of Button2 objects. I'd comment it out.
Secondly, I'd try changing this line:
Button2 *pBtns = nullptr;
to
Button2 pBtns[2];
TTGO-T-Display:25:16: error: no matching function for call to 'Button2::Button2()' Button2 pBtns[4]; @north kelp
seems to still spew errors,
yes, ive tried with just two buttons as well
just set it to four as kind of a desperate prod to get it to do something
Maybe simplify the sketch so that it doesn't store the buttons in an array of pBtns
Just use a separate variable for each button.
Is the board an ESP32 and an ST7789V display?
check the above
its a nonstandard display
has you import a custom profile of sorts f or the tft espi lib
hello
i'd have gotten a proper one with standard hardware but the flash sale for $1/free shipping wasn't a bad idea, wanted to see if i could get a dollars worth out of it
Hmmm. I'd file an issue on the sample code you've been provided, and in the meantime, poke around to find other ESP32+ST7789V libraries/examples.
i wouldnt mind just ordering one that's a known model and have less headcahes
I'm sure you can get a dollar's worth out of it, with some effort.
any suggestions for ones with included lcds in the mean time?
i just got here and i have some questions for the project I've been working on
Welcome, @urban robin
thx
I've been working this project for a while and i'm kinda stuck
can you help me out with this
That's what we're here for.
Cool. What's an issue you're dealing with?
@north kelp @north stream @barren scaffold so I ended up not being able to use the trick I found, but my friend told me he was able to get it working using itself, as long as it's mapped properly. So this effectively tricks the switch into thinking there are two devices plugged in and allows me to have one device plugged in and effectively switch it on/off. Thanks again for the ideas π
ok so the first problem is that i have been trying to find a way to pause the program when a certain gesture is made and resume when the same gesture is made
but not matter what i try i cant seem to get the desired result
How are you detecting gestures? Bend sensors?
ya
What do you want to have happen when the program isn't paused?
i made a number of different gestures that execute certain commands when do
meant to say done
Instead of pausing, I'd just have the gesture change the state of a variable. That way the program can continue running, which it has to in order to detect gestures.
what do you mean
something like:
if (gesture1) {
if (paused == TRUE) {
paused = FALSE;
} else {
paused = TRUE;
}
}
then later,
// check if we're not paused
if (!paused) {
blinkMyLED();
}
oh ok thx
Have you run the tutorial at:
https://learn.adafruit.com/force-sensitive-resistor-fsr
That one is for force-sensitive resistors, but it also applies to bend/flex sensors.
oh ya i actual have one of those
i was trying to make the pressure sensor into a kind of on/off button
for the glove i mean
like stop the voidloop when done
sorry meant to say when pressed
The void() loop never stops.
Instead, I would use something like a paused variable inside that loop, as I showed above.
ya ok
Up at the top of the code, I'd declare a global variable, paused:
bool paused = FALSE;
this right suppose to be inside void setupright
Then, each time through the loop, I'd look at paused, and if it's TRUE, I'd do nothing.
Actually, that variable declaration would be before setup().
ok cool
That way, it's global, and available inside any of your functions.
i do have one other question though
Go on. Yes?
ive been trying to make this glove Bluetooth for the longest but no dice
What device do you want to pair it with?
my pc
Which BLE board are you using?
Which bluetooth module are you using, then?
I don't know how to get a Classic Bluetooth device, like the HC-05, to talk to a PC.
what module would you recommend
I'd search the https://learn.adafruit.com for Bluefruit for example projects and boards.
Specifically, you'll want Bluetooth LE modules for the most cross-platform compatibility (iOS, Android, Mac, PC).
I've only connected my Bluefruit LE projects to an iPhone.
ok thank you
Does your PC support Bluetooth LE?
Yes.
That board is all in one: Arduino compatible, with built-in Bluetooth LE.
It's also got about 100x the RAM of an Arduino Pro Micro.
can it send keyboard comands because ive run into that problem in the past
You also may need this for your PC, if your PC doesn't have native Bluetooth LE:
https://www.adafruit.com/product/2269
This project demonstrates sending keys to an iPad:
https://learn.adafruit.com/atarifruit-2600-joystick/overview
Some PCs don't have built-in Bluetooth LE support.
dont worry i already have one
Cool.
@north kelp got it working :) turns out i actually had a duplicate library installed, of all things that could have been going wrong
thanks so much you solve every problem i had
@urban robin One thing I suggest all the time is to try to get each component working separately, with separate Arduino sketches, before you build one big project.
thx i will
Think I might have run into a problem with the Capacitive Touchscreen library https://www.adafruit.com/product/1947 . I had it working with code running on the UNO without issue. I then moved to the YUN, which required me to jumper the 3 pads and cut the other 3 pads for SPI/ICSP. The display works correctly when just the display is connected to the YUN (with no additional connections). When I add an input to a digital pin (beam break sensor) the program fails to run (still uploads). As soon as I remove the beam break sensor inputs, it runs correctly. It also works if I don't include ts.begin(); . I had the beam break sensors on pins 2 and 3.
@sinful saffron Are you using a digital pin that isn't otherwise used by the shield? I'd check the schematic of the shield; specifically the capacitive version, to figure out which pins are available for your break beam sensor:
https://learn.adafruit.com/adafruit-2-8-tft-touch-shield-v2/downloads
Can you make the break beam sensor work on the Yun without the touchscreen shield?
yeah, the beam break sensors work as long as I only do tft.begin() and not additionally ts.begin()
The display uses digital pins 13-9. Touchscreen controller requires I2C pins SDA and SCL. microSD pin requires digital #4. That means you can use digital pins 2, 3, 5, 6, 7, 8 and analog 0-5. Pin 4 is available if not using the microSD
I had it fully working on the UNO also (before having to cut and solder the 3 pads)
Can someone please assist me in SQW alarms for the DS3231? (oeserle helped me start it the other day, but i have a few questions)
I think SQW is the square wave output but the pin might double duty as the alarm output
How many i2c devices can I have on 1 board
in theory 127 per bus. Realistically much less because of address conflicts and eventually noise from all of the wiring. Some boards can drive multiple busses.
If you want to have a bunch of devices with the same address you can use something like this:
https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout @simple horizon
Not technically what you asked for but it might be interesting to know!
@north stream regarding how to code it :)
It's basically a matter of writing numbers in registers to set the alarm time and enable it.
I want to have a trinket m0 have 3 i2c "slaves" and 1 uart
Is that possible?
They shouldn't have the same addresses
@north stream im looking for an example.
I'm on my phone right now so I don't have any examples hand but can answer questions
I'm guessing you can have an i2c bus and a part. May have to use soft i2c
Does any one know anything about VL53L0X Time of Flight sensors?
These guys https://www.adafruit.com/product/3317
The VL53L0X is aΒ Time of FlightΒ distance sensor like no other you've used! The sensor contains a very tiny invisible laser source, and a matching sensor. The VL53L0X can detect ...
I'm using them in a test lab setup and I'm getting weirdly inaccurate readings. I have 3 sensors, an lcd, and the adafruit data logging shield plugged into an arduino mega. I've ruled out the sensors interacting with each other and I'm shining them on a piece of reflective tape as the manufacturer recommends idk what's causing them to be off. I'll post my code if someone wants to see it.
The inaccuracies are no more than 1 inch off but they're supposed to be much much tighter than that.
@carmine sun Can you share a sharp photo of your wiring?
How are you setting the I2C addresses of your sensors?
My wiring isn't terribly pretty in a picture so gimme a sec and I'll make a diagram, as far as addresses go I'm using the method described in the adafruit guide above. With sequence of shutdowns to the appropriate pins and the line " lox.begin(insert address here)
I checked that the adresses are being set correctly with the i2c scanner provided on the arduino website and they were all what I set them to and the data logger and lcd screen were different entirely
30, 31, and 32 are what I set the sensors to be
What's the range of distance you're aiming at?
βMy wiring isn't terribly pretty in a picture soβ¦β
I get it, no one's is, but it helps me a lot to diagnose. That and source code.
You mention reflective tape. Like mirrored Mylar?
More like the shiney stuff they put on ducting in your house
What about aiming at non-shiny, white or gray? That's what I read being tested in the datasheet.
(Also, are you getting reasonable measurements with a single sensor, using the example code?)
I did sheets of printer paper and cardboard boxes
also when I was building it the sample code ran fine but then again I didn't put a ruler up next to it to see
You say "weirdly inaccurate"; can you quantify that?
Related issue in the Forums:
https://forums.adafruit.com/viewtopic.php?f=8&t=154212&p=760718&hilit=Adafruit_VL53L0X#p760718
yeah I was expecting that level of variance, mine is more in the range of a half inch or more
(I'm converting to inches in my code by doing mm/25.4)
the other products I'm using are:
https://bit.ly/2IsceN5
https://bit.ly/2KSnmYo
This new Adafruit shield makes it easy to use a 16x2 Character LCD. We really like the Blue & White 16x2 LCDs we stock in the shop. Unfortunately, these LCDs do require quite a few ...
Your code looks decent, and compiles fine.
yeah it works the results just float weridly all over the place
If you point a sensor at a surface 100mm away, what readings do you get?
sorry, I work in inches here's the file from placing a static blue notebook in front of all three sensors at about 3inches
all reading slightly different values ranging from 3.1 to 3.7 inches even though they were just resting on the table
that's +/- 13mm ish
are there at least some other strategies I could use to get more accurate data other than smoothing by taking an average reading?
oh, maybe I'm just nuts
I am, too!
aren't we all
is there anything I can do to get more accurate data?
in code I mean
Checkingβ¦
also, super thanks for the help I really appreciate it
From the datasheet. High accuracy mode might be an option, if supported by the Adafruit library. But even then, it's +/- 3%, which is +/- 36mm at 1.2m distance, if my calculations are right.
I'd also try turning on the sensor library's debugging, like this, and see if there are any silent errors happening:
if (!lox1.begin(LOX1_ADDRESS, true)) {
But other than that, the variance you're seeing looks within spec for that sensor. What range of accuracy would you be happy with, @carmine sun ?
Is this a case where you need to take the average of multiple readings?
Sorry I had to drive somewhere @north kelp I'll definitely try that when I get back to my set up tomorrow, I'd like to get an accuracy of around 2.5mm or 0.1 inches
and yes, I already take an average of 10 readings taken at 1 ms intervals and averaged for each sensor
I figured, you seem pretty on top of it, but I know I've overlooked "obvious" stuff before so I figured it didn't hurt to ask
at the very least someone else reading along might realize "oh, hey, that's a thing to do with sensors"
no problem, thanks for checking, every little bit helps
Hey guys, I need some guidance on reading a GPIO pin from a high voltage source
This is the device whose relay (specifically relais 2) will be opening or keeping closed a relay which I plan to read on an Arduino
the "maximum rating" for said relay is 250v at 10a, but the Arduino GPIO probably won't be able to interpret this signal directly. How can I ensure I can read this on the Arduino's GPIO pin safely?
There's probably a more efficient way, but the solution that immediately comes to mind is a simple voltage divider circuit to scale it down
If nothing else it lets you move on with prototyping with parts you probably already have, while you're searching out the optimal solution
good to know! can you tell I'm new to electronics?
Try our easy to use Voltage Divider Calculator. Enter any three known values and press Calculate to solve for the other.
Also with a big voltage like this is it possible to use just one of these circuits?
No biggie!
I honestly don't know how well voltage dividers scale, but I assume the resistor will go poof in a dramatic way if it does. Please don't take my word on high voltage safety, though
cool stuff, should be simple enough. I'll just measure the voltage with a multimeter and plug the numbers in here π
lol yeah just some smoke probably
I'll test before plugging into the arduino lol
This looks relevant lhttps://www.evilmadscientist.com/2012/basics-power-dissipation-and-electronic-components/
Tbh half of expertise these days is knowing just enough to figure out the right Google keywords. Don't feel bad, you'll get there someday too!
We love teaching here
And even if a voltage divider doesn't turn out to be the right tool for this job, it will teach you a few very important things that are vital for many projects
awesome! yeah I had a question here earlier this week about another part of this project
sweeeeeet π
got a lot of good ideas
lol
hoping to get a good grasp on electronics soon enough. everything with it seems like logic puzzles
Ohm's Law is super important in general, so playing with voltage dividers will be educational
I mean, you're not wrong?
The scope of the puzzles just gets bigger
yeah currently I'm pretty boggled when I see schematics
Ok I gotta go to bed, but I hope this gives you a place to start! The experts on here will probably give you some better guidelines on working with mains power when they see this convo
thanks for the power dissipation article btw! seems perfect for me.
cool cool! have a good night
Glad it helped!
One other thing, I'd recommend using an opto-isolator (https://en.wikipedia.org/wiki/Opto-isolator) just to be safe, you could feed the voltage divider output into the opto-isolator and then read the output of that.
Good idea! I learned a lot from this. One thing I was wondering for when I initially measure the relay's output voltage is if most multimeters can handle 1000V or 1kV? Then after I measure I can just get a component rated for the initial output voltage.
uhhh... aren't you working with mains power? I assumed you'd be under like 250 volts or somtehing
I'm scared of working with 1kV and you probably should be too
that said, your multimeter should be able to tell you... and I suspect multimeters are rated for mains power. your multimeter should tell you what its limits are, either in the manual or if you google it
your multimeter probably also has different modes for different voltage ranges - if your meter can switch into a range that's above the voltage you expect, you'll be good
oh, you actually want the range with the wiggly line if you're working with AC power, not the solid + dotted line
your multmeter should have both
gotcha, thanks!
Anyone know why I would be getting such a wide range of values on an analog read from a beam break sensor that is set for high and not changing?
#define beambreakin A3
const int beambreakinled = 4;
int beambreakinstate;
#include <Bridge.h>
#include <BridgeServer.h>
#include <BridgeClient.h>
void setup() {
Bridge.begin();
pinMode(beambreakinled, OUTPUT);
pinMode(beambreakin, INPUT);
digitalWrite(beambreakinled, HIGH);
}
void loop() {
beambreakinstate = analogRead(beambreakin);
Console.println(beambreakinstate);
delay(100);
}
getting 0 all the way up to around 1023
not sure if this is the correct answer, but one thing I needed to do when I was getting a range of values was to ensure there's a resistor to pull up any voltage between reads.
so whichever pin you're reading from should have a resistor there to take care of any remaining voltage that would otherwise change the output of your read
Thanks for the help, I've been moving pins all around and didn't even think to check that (was previously working on digital pins but had to move some to analog pins since I ran out hah).
so I'm in America and haven't found any octocouplers/isolators that are "110V". If I feed 110V through this 220V one will it still come out as 5V on the other side? I have a general idea of how the isolator works, but I'm not sure in this context what it's doing. https://www.ebay.com/itm/5Pcs-1-Bit-Ac-220V-Optocoupler-Isolation-Module-Testing-Board-Adaptive-For-Plc-h/132711128303?epid=0&hash=item1ee6331cef:g:8Q4AAOSwWe9bUXJX
it emits light which is picked up on the other end by a sensor, which in turn sends either 3.3 - 5v or 0v (depending on the design)
not sure how it gets 5v to the other side of the circuit, and also if it does this continuously (e.g. I will be driving this from a relay, while the relay is on will I be able to read 5V on each iteration of my loop() for arduino?
@sinful saffron the analog pins can be read with digitalRead() or analogRead() as needed π
for some reason I had to add INPUT_PULLUP on the analog pin but not the digital pin for it to function the same
not a big deal other than having to add it though
I'm not 100% sure if it would accept 110V, I've never bought them as a 'package', I usually just pick them up from DigiKey. and since most are designed for DC input, it complicates things slightly. So honestly, I would give that module a try because otherwise you're going to have a little bit more circuit design ahead of you before you get a good clean logic signal.
Oh I think I'm plugging DC into this. I'll give it a test :)
Not completely sure though! The voltage is coming from another relay. I think first I'll measure what's actually coming from it and then test accordingly
It says it adapts to 24VDC so it may well work with 110VAC
@sinful saffron that makes sense. Originally your input circuit was just floating at whatever stray voltage was induced by the environment, minus a tiny amount sipped off by the reading circuitry. Your beam break sensor is probably just a photo resistor tied to ground in a voltage divider setup. Without the pullup trying to pull the voltage to 5V or 3.3V you won't have a consistent "high" voltage reference to see how much the photoresistor is letting through.
Any project that can help me learn more about arduino?
lots of projects here https://learn.adafruit.com/search?q=arduino
instructables is also good
but my best recommendation is to find a project you actually want to make, that you're motivated to make π
@harsh wedge thank you very much
@pine bramble, I recently purchased a FunShield. It has been... Fun. It's a great all-in-one shield for playing with code on the Arduino Uno https://www.tindie.com/products/MakersBox/funshield-kit-for-arduino/
@tribal briar thanks
How did you set it? Some examples I've seen use the time the code was compiled instead of the current time
Ya it uses the computer time but that time is correct
Hello anyone I have this https://www.adafruit.com/product/1141 shield on my adafruit metro (an uno clone) and I'm running the rtc example sketches and the clock just isn't ticking. It still prints time to the serial output but it never changes
any ideas why? I have the button battery and SD card inserted
Is the coin cell inserted properly
Some clock chips have a "start" function that has to be executed to start the clock.
Can someone help me with capacitors? I make something like this and when I connect it to 5v from USB my diode not work. But when I remove capacitors it works good. What can be the problem? This is 2x 2.7v capacitor so it both have 5.4v.
Check the resistance of the capacitors @errant geode.
Also maybe remove the led and resistor. Disconnect the power and measure the voltage on the caps
@humble anchor Voaltage is 1.5v. So I must charge this capacitors to 100% to get 5.4v? And why my diode not working with capacitors? Does capacitors "eat" all energy?
They shouldn't, maybe try some other capacitors? @errant geode
Maybe try adding a small resistor between the caps and ground @errant geode
If the capacitors are hooked up backwards, they'll consume a lot of current (and get damaged in the process).
If your supply doesn't have enough current, it will take a while to charge the capacitors (I'm guessing those are DLC capacitors of some sort, if so they have a significant amount of storage and your USB may be shutting down due to overcurrent).
I add 150R resistor and now diode work, wehn i connect power supply. After about 15 seconds voltage changes from 1.56 to 1.64 so i guess i must charge it to about 3v?
anyone familiar with bash scripting here?
seems like stack overflow, askubuntu and linux exchange are all down for maintenance at the same time lol
I just tried out arduino-cli and I'm writing a few upload scripts for remotely deploying code to an arduino attached to my pi
Anyone available by chance?
I got my problem sorted out! Thanks! If anyone wants to know more about headless deployment of arduino code I would be happy to share
@chrome kayak what's up?
Sounds interesting, @pulsar charm
@errant geode Sounds like you just needed to limit the current to charge the (large) capacitors.
yeah we are living in interesting times
platformio just turned open source this month so I really wanted to give a go at doing a proper CI/deploy pipeline for my hobby arduino codes
for anyone wanting to have a go at compiling/uploading your arduino code via CLI, here's the link I found most useful https://itp.nyu.edu/physcomp/resources/using-the-arduino-command-line-interface/
@north stream I charged capacitors to about 4v and try again, now the diode works good. And when i connect power supply both capacitors are charging and diode working.
Nice!
@errant geode good capacitors can pull an insanely high current, the 5V powersupply probably can't handle that and detects a short.
The large current can also lead to a really high voltage spike
It can lead to a voltage sag, but I'm not sure how it would lead to a spike (usually voltage spikes come from inductors).
A good capacitor has such low impedance that large currents flow, causing 'self-inductance' as they call it
It probably won't happen that much with electrolytic capacitors though
What would be a good way to rewrite this bit of my code:
delay(250);
digitalWrite(LED_BUILTIN,LOW);
delay(250);
digitalWrite(LED_BUILTIN,HIGH);
delay(250);
digitalWrite(LED_BUILTIN,LOW);
delay(250);
digitalWrite(LED_BUILTIN,HIGH);
delay(250);
digitalWrite(LED_BUILTIN,LOW);
digitalWrite(LED_BUILTIN,HIGH);```
For context, I am making a built-in LED flash a specific pattern to signify its performing a specific function
I'm having issues with my nRF52832
`
Bluefruit 52 HW Info
MAC Address: C1:20:D:98:F7:6C
Device ID : E6F3A9D697060ECB
MCU Variant: nRF52832 0x41414530
Memory : Flash = 512 KB, RAM = 64 KB
BSP Library : 0.11.1
Bootloader : s132 6.1.1
Serial No : 25337566193874728406
`
it will not load "StandaerdFirmataBLE"
`
C:\Users\HeX\Documents\Arduino\libraries\Servo\src\nrf52\Servo.cpp: In member function 'void Servo::writeMicroseconds(int)':
C:\Users\HeX\Documents\Arduino\libraries\Servo\src\nrf52\Servo.cpp:92:12: error: 'g_APinDescription' was not declared in this scope
instance=(g_APinDescription[pin].ulPWMChannel & 0xF0)/16;
^~~~~~~~~~~~~~~~~
C:\Users\HeX\Documents\Arduino\libraries\Servo\src\nrf52\Servo.cpp: In member function 'int Servo::readMicroseconds()':
C:\Users\HeX\Documents\Arduino\libraries\Servo\src\nrf52\Servo.cpp:123:12: error: 'g_APinDescription' was not declared in this scope
instance=(g_APinDescription[pin].ulPWMChannel & 0xF0)/16;
^~~~~~~~~~~~~~~~~
Multiple libraries were found for "Servo.h"
Used: C:\Users\HeX\Documents\Arduino\libraries\Servo
Not used: C:\Users\HeX\Documents\ArduinoData\packages\adafruit\hardware\nrf52\0.11.1\libraries\Servo
Not used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\libraries\Servo
exit status 1
Error compiling for board Adafruit Bluefruit Feather nRF52832.
`
i deleted the dir it was looking in and copied over adafruit's and now its working
it was just a lib issue dargh i should have read the error
Looking for βadafruit_TFTLCD.h. For a 3.5 TFT shield (demo sketch). Did find some reference on Github but. Itβs not clear how to down load it.
Tried the βManage libraryβ in the IDE but it could not find it in its listing.
@fierce ridge you can use an array and a loop
bool sequenceName[] = { 1, 0 ,1, 0, 1, 0,1};
for (int i = 0; i<=6; i++){
digitalWrite(LED_BUILTIN, sequenceName[i] );
delay(250);
}
Just make sure the i<=6 is actually the size of the array -1
Update....found and got Adafruit_TFTLCD.h installed. The info header in the sketch says that this library needs to be configured for either the breakout board or the shield. I have the shield model. How do I make those config changes in the h file?
@humble anchor thank you!
headdesks anyone here good with a USB Host shield 2.0 clone, I'm trying to make a serial echo sketch with an FTDI Serial converter to the USB Host Shield
which means I'm trying to figure out how to read and write to the FTDI device's class
Ok.....advanced to being able to edit the h file......now I need to get it moved to the right place in the ide. Not seeing and sub folders in the main Arduino program file tree.
May have to restart the IDE to find stuff in subfolders.
Let me get this straight: you want to use a USB host shield (clone?) to talk to a USB to serial chip, to implement a serial echo sketch? This seems like going around the block to get next door (there are easier ways to get a serial port), but that probably just means I'm missing something.
basically I'm not sure how to get info from and to the device using cdcftdi.h
the device is a mixing console controller for a video switcher, I don't have options to change it's serial output from it's FTDI serial converter
Ah, you're stuck with the FTDI and you just want to talk to it.
I already own the USB Host Shield and a Leonardo
yep
hilariously I'm also using an XBee S2 pair set to AT mode to hook the setup to the switcher as it's the most convenient TTL Serial to USB device I have, and I just want to have my Leonardo set up to monitor the traffic between the control surface and the switcher
That's a great hack!
end result... I want to be able to emulate the control surface to get the status of cameras, standby, online
basically making tally lights for our studio
Yeah, makes sense, just need to get over some hurdles to manage it.
I'm the engineering volunteer at a public access TV station, we're one of the few in my state to have an actual studio
yeah, the big hurdle's just... how do I hook the control surface into the arduino stack in something that'd let me send it's data to Serial1, send Serial1 to it, and have both the USB Host serial and Serial1 sent to Serial so I can log it and work out the protocol
when I'm done working out the protocol, I could probably use any of my serial providing microcontrollers to do the emulation, because if I understand it right, the software just pings all the serial ports for what they are, and listens for handshakes from the control surfaces, even have a playback control for a time to test this before I hook my stack into the actual mixer
all this just so I can add a little light on the cameras to go green when the director's got that camera on the ready, and red when that camera's the one being recorded
Makes sense. I've been known to use two serial ports to monitor protocol (one for transmit, one for receive) and combine the data for analysis.
yeah, just wish I knew how to work with the FTDI libraries
Alas, I've never used them.
no problem, hopefully someone here has worked with it
I think right now the FTDI is getting loopback messages, as when I work with the playback control I'm borrowing lights up when I push certain buttons (this isn't a model for the device I'll be working with, as this is an older design)
kinda wish I could just do a USB redirect to make the setup as I need it, then I could just use the XBees and a computer
@random burrow You can also use a teensy 3.6
with an usb host cable https://www.pjrc.com/store/cable_usb_host_t36.html
At least that is my recommendation over a USB shield
It is not 5V tolerant, that is a major downside
I have the current hardware on hand, switching to a teensy would require additional hardware
I do want to upgrade from my 2 Teensy 3.1 boards but that's not in the current budget
hell, I have an Edison, if I could get that working the right way, I'd be fine with using that
hm...
hey, i want to DMA a sequence of bits put of three of my pins and have come tot no avail as to how to make it work. i found this: https://forum.arduino.cc/index.php?topic=347125.0 but whenever i try to use it i get a /Documents/Arduino/sketch_jul31b/sketch_jul31b.ino: In function 'void dma_duty_init()': sketch_jul31b:81:9: error: 'struct Pm' has no member named 'AHBMASK' arudino error. Does anyone know how to do this?
ZERO example: PWM + DMA, timer-capture event + DMA
Hello! I hope someone can help super quick. I have a 8x8 neopixel grid that works with circuitpython but not arduino code on a Feather m4 Express.
Caveat: I have an external 5V supply that works in Circuitpython but not Arduino unless I hook the power of the grid to the USB power out on the feather. Can anyone let me know why?
Wow writing this out gave me an idea. Power supply was outputting 5.5V but USB out on feather was output 5.2V so I switched to an external battery pack to privdes 5.1V and it worked. Thank you for letting me write that out!
FYI the patterns being played via circuitpython and arduino weren't the same. The circuitpython code was a rainbow effect and the arduino was a low brightness all white. ws2811's. Bye!
has anyone messed around with the hardware debugging for 2560 based chips?
I just got a mega, and I'm trying to find the cheapest way to get into the jtag hardware debugging
i thought I was going to be able to do it just with the board and a dream, but I see now that is wrong
@agile whale I didnt even know you could control neopixels with the m4 express. Doesn't it require 5V data input?
@agile whale You did connect the ground of both?
I'm suspicious of something like this since it's 1/10th the cost of everything else https://www.amazon.com/WINGONEER-ATMEGA16A-Emulator-Programmer-Debugger/dp/B0725QJ2KW/ref=sr_1_3?keywords=avr+debugger&qid=1564604319&s=electronics&sr=1-3
@winter furnace maybe it is just an programmer not really a debugger
I was hoping I could find a way to use another arduino or an stm32 or something as the jtag debugger, but I'm not turning much up
@winter furnace Like this? https://hackaday.com/2018/02/07/debugging-an-arduino-with-an-arduino/
yeah, but the actual jtag on chip debugging on the 2560 and not the 328's debugwire
i messed around with that a bit, but it was very limited
i'd like for it to work with atmel studio or whatever
Have you tried a FT2232 board?
I have one I had originally bought to go with this mega for debugging, but now I can't remember what exactly I was going to do with it
Hmm that won't work with atmel studio
originally I had thought I could use the FT232 to pull off the debug data from the JTAG, but now I look into it more I realize it's going to need something to process it as it comes off the chip
it is not quite as simple as I had hoped
The FT2232 is way more advanced than the FT232
ah, then no. I only have the 232
From the datasheet: "Multi-Protocol Synchronous Serial Engine (MPSSE) to simplify synchronous serial protocol (USB to JTAG, USB to I2C,USB to SPI) design."
hmm, and like $15 from amazon
thank you for the lead!
I'll have a look into this one
oh, really?
like the altera ones?
the only thing that's stopped me from buying one to mess around with is the altera programming cable is like $130
I've always wanted to mess around with one
sounding better and better
Altera? Those are really cheap, maybe not for the really expensive ones
You even have the arduino mkr vidor 4000
I see them for sale for like $5 occasionally https://www.banggood.com/ALTERA-FPGA-CycloneII-EP2C5T144-Minimum-System-Board-Development-Board-p-1223888.html?rmmds=search&cur_warehouse=CN
Online Shopping at Banggood.comοΌ
but the altera usb blaster is hard to come by
Inside is something like an stm32F1
could the ft2232 theoretically do the job though?
oh, bummer. the one I was looking at on amazon was not actually a FT2232
I can't find it for altera
Maybe try FT2232D
Online Shopping at Banggood.comοΌ
yeah that is the one I am eyeing now
trying to find one with prime shipping on amazon :p
that one sounds pretty promising
If have used that one on their Lichee Tang, FPGA development board
Uses a really weird FPGA brand. Anlogic
They dont have a english webpage yet kind of weird
can any of the 232 variants handle jtag?
the only one I see on amazon that says it is this: https://www.amazon.com/KOOBOOK-FT232H-High-Speed-Multifunction-Module/dp/B07T9CPMHT/ref=sr_1_9?keywords=usb+jtag&qid=1564608129&refinements=p_85%3A2470955011&rnid=2470954011&rps=1&s=gateway&sr=8-9
hmm, adafruit mentions it too
hmm, looks like the 232H is a variant of the 2232
@winter furnace https://electronics.stackexchange.com/questions/56127/is-the-ft232h-a-single-channel-version-of-the-ft2232h
Seems like you are right, adafruit even sells one
this is close, and uses the chip
but doesn't mention debugging
seems like it will work with openocd, but I'm not quite sure if that will integrate with atmel studio
Companies like that usually don't support other devices like that
i was hoping openocd offered some kind of compatibility layer that would work with visual micro or something, but I'm not exactly clear on what it is
I found the library's documentation! https://felis.github.io/USB_Host_Shield_2.0/class_f_t_d_i.html now if I understood half of it
I think it will, since it works with gdb
alright, I am going to go for it
alright, I purchased the adafruit breakout from amazon
should be here friday
the other one was $5 cheaper but had 3 day shipping instead of 2 π
I'll let you know how far I get with it
@winter furnace Ok great!
hmm, the more I look at other 232H based usb->jtag adapters though, the more it looks like they have a bunch of other parts as well
this mentions openocd, but is short on specifics
i cancelled it; not totally sure it's gonna work for me
this project looks interesting; I think I'm going to explore it first
seems like it might be able to run on my stm32
this actually looks perfect
source for my blog (** view at https://satoshinm.github.io/blog/ **)
back to square 1
still not totally sure if I can just use an ft232H directly
it seems like the atmel-ice does a bit more stuff aand interpretation than that would
I'm not sure where exactly the proprietary parts of the protocol are relevant
cheapest I can find the atmel ICE seems to be $90 :/
Why do you want to use an atmega 2560? @winter furnace
Hi, all I'm getting an error and I can't figure out why! The error is "cannot convert 'float*' to 'float' in return. Here's my code:
void calibrateCheck() {
// creates a boolean to determine if the user wants to run a calibration
bool pass;
// prompts the user to calibrate
lcd.setCursor(0, 1);
lcd.print(F("Press SELECT to"));
lcd.setCursor(1, 1);
lcd.print(F("Calibrate or... "));
delay(1500);
lcdClear();
lcd.setCursor(0, 1);
lcd.print(F(" Press LEFT to "));
lcd.setCursor(1, 1);
lcd.print(F("Skip Calibration"));
delay(1500);
// uses button prompts to determine the user's choice
for (int i = 0; i = 1; i += i) {
if (buttons & BUTTON_SELECT) {
i += 1;
bool pass = true;
}
if (buttons & BUTTON_LEFT) {
bool pass = false;
i += 1;
}
}
if (pass) {
lcdClear();
lcd.print(F("New Calibration "));
delay(1000);
float offsets = calibrations();
return offsets;
}
else {
lcdClear();
lcd.print(F("Uncalibrated Run"));
delay(1000);
}
}
float calibrations() {
// set number of distances to calibrate at
int caliPoints = 3;
// create variables for calibration distance to calibrate at
float dist1 = 3.00;
float dist2 = 10.00;
float dist3 = 18.00;
float dists[caliPoints] = {dist1, dist2, dist3};
float offsets[] = {};
for (int i = 0; i < (caliPoints - 1); i += 1) {
float caliDist = dists[i];
lcdClear();
lcd.setCursor(0, 1);
lcd.print(F("Place sensors at"));
lcd.setCursor(1, 1);
lcd.print(String(dists[i]) + " to surface");
delay(1500);
lcdClear();
lcd.setCursor(0, 1);
lcd.print(String(dists[i]) + " to surface");
lcd.setCursor(1, 1);
lcd.print(F(" Then press UP "));
for (int p = 0; p = 1; p += p ) {
if (buttons & BUTTON_UP) {
offsets[i] = calibrate(caliDist);
p += 1;
}
}
}
return offsets;
}
float calibrate(float calDistance) {
float offset = 1.0;
return offset;
} ```
What's the proper way to return an array, or is the problem trying to input the float into the calibrate function?
one note; after the three back ticks (`) add ino
i.e.
float calibrate(float calDistance) {
float offset = 1.0;
return offset;
} ```
er not ino, but cpp
okay
sorry, the first 3
okay okay
one thing, you could pass the array in the function and not have to return anything
so
I need to get the offsets to my main code
void calibrate(float calDistance, float *offset) {
offset[0] = 1.0;
}
wait what? so that just edits the array with out using return?
another alternative is to make offset global
yeah
any pointer / array is automatically updated
np
You can change any global variable inside any function without a return
That's why they are global
O wait nvm
@humble anchor I picked one up because I wanted to be able to use a debugger to debug my arduino projects before I move them to nanos
I had a lot of trouble with reading a serial protocol recently, and it would have helped a ton to have on chip debugging while I was working it out
is there a serial communication between arduinos
I've recently had to split my code between two unos out of practical concerns and now I'm wondering if there is a way to share some bits of data between them O_O
well, there's uart and i2c
@winter furnace I know what you mean. I had to debug the signal between a computer and an Arduino.
I used a program that can capture the communication of a COM port
Between what was the serial communication?
Adafruit also says that UART can be flakey
https://learn.adafruit.com/adding-a-wifi-co-processor-to-circuitpython-esp8266-esp32?view=all#esp8266-or-esp32
it was the signal off of some dro scales. the format on mine was different than anything I found documented
no scope and all I had to go off of was this woefully inadequate raspberry pi logic analyzer
the clock pulses are about 4us long, so it was kind of pushing the timing on the arduino
took me awhile to realize that I couldn't even fit a left shift in when I was reading it because I was missing transitions
the protocol ended up being fairly simple in the end though, just clock and data
the data is 2 23-bit signed integers, and the second one has all its bits inverted. the value is in 10240ths of an inch, the first is absolute position and the second is relative position
the 1.4v logic was stepped up with some transistors, so those traces are inverted
4ns is pretty insane, that is 250mhz
Owww, that is not that long
i think it was pretty close to the edge of what you could do with a 328p
it runs stable, but there was no room for anything else at all when it's reading
Depends on how often it sends a signal
took me awhile to figure out what my problem was without any real debugging tools, because nothing could go in the loop of course
The 328p does have a 64byte serial buffer
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.
the signal is very badly formed and is usually mangled/missing bits or clock transitions
I'll have a look and see if it can help
I have 3 of them to read simultaneously
but I think the mega has 4 serial ports
maybe they can do something for me
the clock is high for somewhere between 4 and 8 us, then low for somewhere between 4 and 8 us. that was as close as I could tell from the arduino
I think the cycle is just over 10, so probably 5ish
UART doesn't have a clock so where does the clock signal come from?
it just comes off the caliper
there is one data line and one clock line
the signal level is ~1.4v (just button cell voltage) and the signal is pretty poorly formed
it's not a real protocol or anything
it's one of these with some lines tapped off of the board
Aah
very glitchy
it's capacitive so it doesn't really like being bolted to the table of my mill π
workable though
wigs out if the mill stalls and the power surges though
the signal is generated just by connecting the button cell to the clock/data lines
so the next step is probably to figure out a better power supply scheme to get rid of level variation as the battery dies
they donβt last for long currently
I usually just use these really cheap buck converters
Iβve tried a couple of things, but it scrambles the data
Since the signal is generated by just connecting the supply voltage to the pins it ends up too noisy or something
Page 2: How to make a capacitor in the shape of an LR44 or SR44 battery. Reduces malfunctions when using an external power source to power a portable device or tool such as a digital caliper.
this guy has an interesting solution
The whole setup seems to be very sensitive to the length of my wires and random stray capacitance
Iβm considering reading the signal closer to the caliper and boosting it before I sent it out, but weβll see how I go with my current plan once I get the third caliper added
What are you going to use it for?
DRO for the mill
Iβve got two down, still need to find an 8β scale and mill the brackets for the Y; itβs the hardest because it has to sit against the draft angle of the casting
The scale is along the back under the shop towel
I don't know much about mills to be honest
The electronics part shouldnβt be affected by the mill, but since the scales are capacitive and the casting is a giant ground plane (and the fact thatβs itβs a crappy 4/5 horsepower brushed DC motor that stalls out a lot), it wreaks havoc on the electronics around it
Might try the stm32 and see if it can run it more comfortably
I don't know how high quality XYZ benches work
But they don't use techniques like that
the highest end ones use glass scales with a quadrature encoding
magnetic scales are common
this capacitive scheme is also fairly common
they usually come in a unit like this: https://littlemachineshop.com/products/product_view.php?ProductID=5012&category=-1536942993
DRO Packages 5012 12" travel stainless steel scale; Stackable display unit; Mounting arm; Displays in inches or mm; Resolution: 0.01mm/0.0005"
Accura...
my setup is repeatable to about half of a thousandth of an inch, which is more than good enough for my toy mini mill
and better than I thought I could get originally. so I'm pretty happy with it
I mean like really high quality, not the stuff they use for milling
Mechatronics: How does the inverse piezo effect work for nano positioning applications? What kind of different piezo drives and piezo motors are available? P...
ah
yeah the mill doesn't need anything that fancy
are those open loop?
these are just for measuring; they can't actually move anything
Aah, it doesn't mill automatically?
I wish π
I stand there cranking
out of the box it only has graduations on the handwheels for measuring
which are plenty accurate, but with 60-70 thou of backlash it does my head in trying to stay accurate
it is only a baby mill
Itβs the thing on the right of the bench
Yeah handwheels arent great for measuring
can still work to half a thou with them
16tpi leadscrews though, so I've got 62.5 divisions on the X and 60 divisions on the Z. easy to mix them up
To adjust or to read out?
both
you spin the handwheel and count how many divisions you turned on a graduated collar
I have the following code
void vu1(int data) {
uint8_t * pixels = strip_ledbar.getPixels();
uint8_t i = 0;
for(int i=0; i<data; i++) {
pixels[i*3+1] = 255;
}
strip_ledbar.show();
Serial.println(data);
}
It's a esp8266 arduino ide code.
I am sending a value of 0 -15 via UDP
I am trying to make a VU meter out of my neopixels
But I can't figure out how to do it. Any help ?
@shadow bronze oh yeah there's i2c... that's a good reminder lol
so far I've only used it for slave devices
i've used one to make the arduino a slave for a pi once
I just did some reading
they both look equally viable!
any upsides/downsides for i2c vs UART that I should be aware of?
i2c is very fast compared to uart; and with i2c as low = 1 vs uart, you don't have a voltage issue (uno = 5volt uart vs pi 3.3)
oh
that's unfortunate
I wouldn't have any problems putting an i2c display at the end of the day still yeah?
just daisy chain them
yeah; you can have like 256 (in theory) i2c devices
hehe
would probably be using a PLC by then
@pine bramble You have to be a bit more specific
hey could I rubber duck my code with someone here
its a really short snippet of code truncating a float to 2 decimal places.
for some mystifying reasons, I'm not getting my intended output
return round(value * 100) / 100;
}```
so 51.1234 is supposed to become 51.12
It works on a C++ compiler (I tried it on replit)
but I'm getting 51.00 for the arduino compiler --- does anyone have an explanation why?
bah I solved it by changing it to:
float round_2dp(float value) {
return (round)(value * 100) / 100;
}
this is one weird operator precedence going on
what is round from? Arduino's might differ from another compiler.
yeah its arduino's
I've read that Arduino's does weird stuff
fell victim today
luckily my unit tests caught it
What type of board are you using? @pulsar charm
its a regular uno
aah well, I rarely use an uno
has anyone gotten the gameduino 3 video2 example working with sound and their own video
mine just wont play, its h.264. 480x272 and my pc plays it just fine (not the built in player, VLC)
Try a different video compression format
i tried a few
All avi?
ya
Maybe ask their forum
their forums are completely dead
i am trying to email the creator, last time i was able to and he was very kind about it
he probably understands that the forums are dead
Got the FT232H in today
Donβt think itβs going to work cleanly right off the bat, but it should be interesting to see what it can do for me
time for fun with drivers π
Have fun'
isn't a 10x25 pack of pin headers 1.25 or something?
Iβve got plenty. Just seemed odd that it came with a random number
.1" pitch?
for whatever reason the only thing thatβs always right in my banggood orders is the exact number of pin headers
might be the wrong chip, but they always seem to nail that
Ofcourse 2.54mm @shadow bronze
sorry; 34+ years living in the US adversely affected me
I mean it is 0.1 inch and probably the original definition
I just think that americans shouldn't use Watts and Joules as well
the US does use the metric system however, 2 liter bottles of soda for example
and perhaps the only example
They use watts
i'm sure 1 watt is something like 8/17th of something else though
Watts is kg * meter^2/seconds^3
(i haven't been in the US in 13 years so forgive me if i don't know something new)
I dont they use something else than Watt for electrical equipment
But don't tell them that it contains meters and kilograms because they'll change it!
What do you suggest instead of the watt?
let me just bust out my 75 ft lbs/second lightbulb π€
Although using some metric stuff makes it even more inconsistent and typical US
Even their date notation is weird
counterpoint: it is perfect
Iβm a dual citizen, and whenever I have to fill out passport forms at the Australian embassy, the forms are covered in warnings that they shred all forms that use the US style date format with prejudice π€£
i dread having to use dates anywhere from the first to the twelfth
@winter furnace I bet the US government wished they did that as well xD
Because of Chelsea Manning
Hi there im new to arduino and was wondering if anyone could help me with running a dc motor with arduino
What did manning do with dates?
@lapis basin ideally you wouldnβt draw the power through the board
youβd have a separate power supply and switch it with a transistor or a relay or a mosfet or something
ok thank you ill try that
If you suck any appreciable amount of power through the gpio pins it will just die
Hi everyone!
I'm trying to use VSCode as an IDE (I downloaded the Arduino extension). Whenever I try to upload my program, I get this: Failed to connect to ESP8266: Timed out waiting for packet header
@past token I tried the arduino extension too and it it didn't work very well. Now I use platformIO for VSCode and it works great.
@wraith current After doing some research, I either have to use the older bootloader or update the bootloader on this nano
i'll look into platformIO if this doesn't work
uploading to the nano works on the arduino IDE, but not the vscode ide
π€
the arduino IDE is configured to the atmega328p processor (not the older version too)
i wonder if VSCode is thinking it's the older version
I GOT IT TO WORK! π
Changed the processor type to the ATmega328P
oh sorry I didn't catch this
yeah you could use platformio, or arduino-cli
for platformio you need to read documentation on the boards
The VSCode Arduino extension doesn't work anymore if you're running on Mac because I think the new Mojave OS changed their fs.readline version
If you're using a platformio.ini file, by running platformio init here are my config files for the old nano:
[env:nanoatmega328]
platform = atmelavr
framework = arduino
board = nanoatmega328
upload_port = /dev/cu.wchusbserial*
im on a windows machine, but i did intend to use vscode for arduino on my mac as well
but thanks for pointing that out
i'll be sure to use platformio on mac instead
if anyone wants help using vim instead of the arduino IDE let me know π
lol
pfffttt, vim is too bloated. i manually flip the transistor states on the processor
At least he is not talking about emacs
I think emacs & vim are over kill. Nano or Atom are really good at editing source code.
i use vim because i can keep my hands on home row and not have to hunt for cursor keys; i know vim to where i can edit tons faster than any other editor; but that's just me. not saying it's the best for everyone
I don't really like most editors
For quick and easy stuff I like Kate on linux and notepad++ on windows
They are really similar
and spyder for data analysis
Hi, I recently got a feather ESP32 to experiment with some IOT and followed the steps on the Espressif github but dont know what to do with the CP2104 USB driver on the documents page for the board and dont see the Adafruit EPS32 FEATHER board in my arduino libraries. Any quides more in depth or addition help?
anyone have an idea why my brand new hallowing board won't show up on the ports of my arduino ide
the light is flashing yellow
I also installed the drivers'
did you install the new board in the board manager
go to https://learn.adafruit.com/adafruit-hallowing/setup and click arduino IDE
@mighty elbow
Just received Neotrellis M4 Express board yesterday. I would like to use Arduino IDE..... Installed libraries except QSPI because there is not in the Arduino library manager list which I assumed no longer need QSPI. So far, the process I am following all right. The most trap is usb port.. I get this message "No device found on cu.Bluetooth-Incoming-Port
An error occurred while uploading the sketch" The Board was set as Adafruit Trellis M4 (SAMD51). Oh, I am using Mac OS majave... Any idea how I can solve the issue?
@shadow bronze any tips? I've grown very frustrated with the arduino IDE and I was planning to switch
@shadow bronze what are your thoughts on remapping esc?
I've been using kj as esc for a few years now
I love it
you have to select the right serial port. It sounds like it defaulted to a useless default bluetooth thing
Anyone familiar with c++ OO code here
snagged a frustrating bug I've been trying to solve for hours, its relating to pointer reference to objects nested within classes
bah solved
I rubber ducked it with someone and it turned out I put a setup function into the main loop
Remapping esc? Por que?
is it possible for a wireless input for a stopwatch, aka, a wireless button to start a stopwatch, and how would i do it?
i'm a beginner so it would be nice if you could give me step by step instructions or a link to a guide
@tawdry garnet do you want to hack a stopwatch?
i guess yea
make my own stopwatch
but
be able to make a wireless input
instead of a traditional button on breadboard
You will have to chance the code for making it stopwatch
Try to get that past the TSA
Hey guys, I'm really new into this whole arduino/circuits thingy, but wanna spice up and upcoming 3d print of mine(power glove similar to the Ironman gloves) with some LEDs. From what I can gather from different youtube videos regarding the topic, it seems like a very good idea to go with a Trinket 5v, Neopixel Flora's for the top of the glove and an Neopixel Jewel in the middle of the glove. My biggest issue right now is figuring out how I should go about powering it.
As I understand it, each Neopixel driver takes 60 mAh at max output, and I think I'm endiing up with around 17 drivers total. I would love to power it simply with the USB from the Trinket, but I guess it's not feasable?
Hey. Is there any cheap expander with minimum 6 analog pins? And working on spi if possible.
Update:::: Port is successful! All I need to reset on the back of the Neotrellis M4.. Press twice rapidly then see purple led then red led then lastly green. On computer shows different name of USB port. First was show " CircuitPy" then reset and it shows "TRELM4BOOT" On the Arduino IDE shows two different port which I am using "dev/cu.usbmodem14101. It is working now.
The next problem is that sensortest is not working "Ooops, no ADXL343 detected ... Check your wiring!" I was like I just struggled with port then now this. no no no no. The board itself is a beauty. Coding and all of that stuff drives me nut.
@errant geode 6 analog in and outputs?
If you need inputs and they don't need to be fast
You can use an MCP3008 or ADS1115
@winged pawn NeoPixels drive themselves so you don't need 17*3 20ma pins, just one, and feed the NeoPixel chain with the same power source as the feather.
I think a trinket can handle it if you don't get super fancy with the animations. You can pull the USB power directly from the "USB" pin
nvm
GREAT NEWS! ADXL343 is working. No defect. Whew! I found in the Adafruit forum for that similar issue. The code was old and needs to be replaced code. Here the link:https://forums.adafruit.com/viewtopic.php?f=25&t=146604&p=754854&hilit=ADXL343#p754854. Thought it would help anyone who is brand new learning to the Neotrellis M4 Express. Here some tips: studying codes and comparing old and new codes, be sure you get all of libraries to be installed. Some libraries don't provide (eg. QSPI by Adafruit) because it doesn't need or replace to a different uhhh programs/names- so far I installed SdFat-Adafruit Fork for QSPI according to Github by Adafruit (https://github.com/adafruit/Adafruit_QSPI). Well, that is all I wanted to share my experience struggle with newbie NeoTrellis M4, thought it has been fun when finally I understand how and why and what caused. Thanks Adafruit for making a beautiful boards. Happy hackings to you all forks.
@pine bramble have you tried circuitpython on that board? I found it to be very intuitive myself. And my son loves the drumsequencer
@burnt island thanks for the input π YEah I get the daisy chaining, I was just wondering if the USB pin would provide enough power for it to drive them or if I need to buy another power solution π
@winged pawn The usb pin will supply power directly from the USB jack so as long as you have a big enough battery you'll have enough power.
awesome. I will be ordering the parts soonish and I think that trying it out on a breadboard would be the best idea π This is my first time trying out all this stuff
luckily I got some C++ experience for the coding part
Hi, I recently got a feather ESP32 to experiment with some IOT and followed the steps on the Espressif github but dont know what to do with the CP2104 USB driver on the documents page for the board and dont see the Adafruit EPS32 FEATHER board in my arduino libraries. Any quides more in depth or addition help?
the cp2104 is a USB to serial driver. Just install it on your computer. If you're in the arduino IDE you need to install board support for esp boards.
@candid wren
any tips to make the library sow up?
@shadow bronze just furthering on the i2c discussion
I've read online that there might be a 4 byte limit to i2c communication between boards
with a default of 1 byte if not specified
but then some articles refer to the limit as 32 byte
I'm just wondering about this to theorise the kind of data I can actually send
I'm a web developer by trade and all I can think of are JSONs π
@candid wren Why are you looking for esp32 feather board in your libraries?
That doesn't really make sense
Are you talking about board manager?
https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/ @candid wren
If you have windows 10, the driver should automatically be downloaded and installed
i'm hoping someone in here can help me.... I've been everywhere in regards to arduino forums
So like, my arduino uno r3 isn't showing up in device manager, not showing up in ubuntu, or OSX. π€· I was running a simple motor driver sketch when all of a sudden windows sent me a notification that "unknown device" was plugged in. After that I decided to unplug the arduino, uninstall all of my serial ports, and plug the arduino back in. Now I'm getting absolutely nothing on any computer or OS.
Hmm, do you see anything on USB? Is there traffic in the system log?
honestly I haven't dug too deep into any logs or such
let me see if i can find anything
You can also use things like lsusb or the Mac system description tool to see if it sees anything, but I'm guessing it doesn't even enumerate, which means you probably have to look at lower level diagnostics.
Ah, good to know.
I wonder if a spike damaged the USB-serial chip.
Does it run the sketch again if you hook it to power?
I may need to try that
i know that it was still running
i was writing a new sketch
the motors were spinning, and doing everything as programmed
when i realized that I couldn't upload that sketch anymore to the com port
i unplugged/replugged all of the basic stuff
and now i'm here
so like, really freaking weird
Yeah, there are two basic chips on an Arduino: the main CPU (that runs the sketches) and the USB-serial interface (that lets it communicate with the host computer). It's starting to sound like that interface chip was damaged but the CPU is still working.
which chip is it that does that
is it the ATMEGA328P
or
16U2?
the 16u2 does the processing right?
@dusk raft The processor is the atmega328p
rip
I'm assuming that a replacement of the chip that handles USB would be difficult to replace
Yeah, the 328P is the main CPU and the 16U2 is the USB interface. Annoyingly, the 328P is (in some cases) the easy to replace one.
i wonder if maybe i did something wrong when I uploaded that sketch, because it was right after i uploaded the motor driver sketch
I can't think of a software way you could damage it, so I'm thinking motors are inductive loads and might have caused some sort of voltage spike.
It is possible to reflash the 16U2 if it doesn't have hardware damage, but I think you'd need to solder on some pins and have/make a device programmer.
not worth it tbh
already have another uno r3 on the way
was hoping to fix this one but I guess I'll use it as spare parts
π€·
it is possible that I may have overloaded something
and again, I do believe I accidentally bought a uno r3 clone the first time so that also could be another problem
bought a legit one this time...
I wonder if it's possible to directly program the 328P processor on my Arduino Nano with assembly language
Atmel has their own IDE called Atmel Studio that allows you to directly program their processors
Doesn't the clones run on CH340G
I accidentally connected 12V to a GPIO today
thankfully my autographed arduino recovered
@dusk raft On that note, you should alway turn off power or disconnected serial when you're deal with servo motor drivers
one of my macbook usb ports had a similar incident when flashing code to a mega clone (it was recycled from an old RAMPS board)
when I was connected to a servo motor controller
thankfully the macbook's usb fuse is resettable via a SMC reset
but it did trigger a scare!
honestly I'm not even sure at this point what happened
I think its related
could be
actually most likely is
but
I think all I had running was
a relay and a small electric motor
DC?
hehe yeah motors have inductive loads
and probably a diode
I'm assuming that was the problem lmao
yeah
oh well
I ordered a new arduino and it'll be here tomorrow so
yeah get an original
they recover amazingly well
I hope....
As I said, I did accidentally connect 12V to it today
I didn't want to pay $70 for next day shipping from arduino.cc
so i bought it off amazon, but it seems to be authentic
if not
π€·
how much did you pay for it
You can tell instantly off the foot of the itailian peninsula (just google, there are literally guides on how to tell fakes)
i think that is around the same price as a new uno r3
yeah
If it is fake but works I'm fine. I'll probably order one off arduino.cc soon as well anyways I just didn't want to wait a whole week to get it lol
fair enough, welcome to making too!
sorry to hear about your loss
it'll be the first of many
honestly
I'm in the IT field
and I've never fried something with circuitry in it π
this is the first thing I've ever fried
also, this is the one that I bought off of amazon
you mean you've never tried toggling that curious little switch on power supplies?
hahahahaha
well, maybe once or twice
actually, I lied
I once hotswapped an IDE hard drive
and it arc'd and fried the HD
so I lied sorry
just for good measure, do turn off devices too when soldering
Oh yeah...
It'll probably halve your casualty rate
I'm not going to be soldering any time soon anyways
lmfao
I'm definitely not as confident with electrical engineering as much as I am with servers and computers π
I wonder if there are any microcontrollers that come with warranties
In my personal experience, Particle has replaced boards that've failed on me
try arduino-cli board list
and see what do you get
you would probably need to reflash firmware to it if you somehow manage to get its usb adapter to start talking to your computer again
right now its probably destined to the scrap pile
I've had your issue with a Particle photon that was failing on me
windows reported an unknown device and the usb chip was getting extremely hot
You could probably still operate it with a USB-serial cable replacing the interface chip.
No, leave the 16U2 in place and connect the RX and TX leads from the serial adapter to I/O pins 0 and 1
That's what the 16U2 does: sends and receives asynchronous serial data on those I/O leads, so you're basically replacing the functionality with an external one, like many Arduino boards without their own USB interfaces.
hmm
so
a USB serial cable
can you link me to one of those?
is there like a special one that i'd need?
or maybe it is something that I'd need to custom fabricate? lol
Hey so Iβm moving over to arduino for my thermal printer
But Iβm having an issue
I have it hooked up to an uno
And I have the printtest sketch uploaded
Itβs not printing
If I feed the paper through manually I see that the thermal part is working
Itβs just not cranking out the paper
Hereβs the setup
the light blinks green
@mighty elbow
I think the thermal printer requires a power supply with at least 2A iirc
how are you powering the printer
I think I am going to try this
"loading the ArduinoISP sketch, connect it to the ICSP header near the USB port, and see if you can burn the factory firmware back on the 16U2. IDE includes avrdude that you run to do that, and also the firmware hex file is in a subdirectory of the installation. If it loads without error that would be a good sign. If the board is not getting hot when plugged in that is also a good sign."
if that doesn't work (obviously it won't) I'll make one of those cables you were talking about
@pulsar charm I'm using a 5V supply
@dusk raft try googling usb-TTL cable
Which it says at least 5 V
do you know how many amps can it supply?
hold on let me checkl
it would mention on the label
You probably need a juicier power supply
try this, if you got a switching power supply
test it out with it first
if it still doesn't print when you supply it with more amps, you should look forwards your code and wiring
@mighty elbow You will also need a 5 to 9VDC regulated power supply, that can provide 1.5A or more during the high-current print - our 5V 2A power supply will work very nicely. ~~~ off the product page
I was thinking a serial cable like https://www.adafruit.com/product/70
This one's a little cheaper https://www.sparkfun.com/products/12977
Is there any wierd trickery when using if statements with bytes?
Seems some byte checks only work with = and others only work with ==.
= is assignment == is comparison. can you give an example.
The only way I can imagine= in an if statement (not ==) is as a shorthand for "set this variable to a value. If that value is non-zero, do the following" -- if (a = b) is really checking if b is a truthy value, and assigning that value to a regardless.
@calm parcel I am checking MIDI Input on my arduino, I noticed that it would read with = if it was non-zero, coincidentally what @barren scaffold said.
I am checking the velocity on one part of it, and I was using = for if it equaled 0. I changed that but to == and it read.
Then I assumed, by that working, that I should change the rest of the ifs with == as well. But that didn't work.
So, by what you two said, I am going to have to rewrite those ifs for any variables that could possibly be 0 in any condition
Though the if (a = b) {/* do something */} has a defined behavior, it's probably not worth the possible confusion. if (b) then { /* do something */ }; a=b; accomplishes the same thing. Maybe if (b!=0) { /* do something */ }; a=b; is better since it has a more explicit true/false condition.
And if you only want a=b to happen under certain conditions, you want that assignment inside an if statement (either the if (b!=0) if that's your preferred condition, or another independent if statement.
!= sounds like what I need. Will try that. :)
All of this is really a matter of translating "what do you really intend to do?" -- including considering as many alternatives as you can. So if you assume b is always greater than 0, you might write an if condition as if (b!=0) and it will work just fine up until b goes negative for whatever reason.
sorry if this isn't the best place to ask, but does anyone know where i can find a changelog for the latest Arduino IDE Beta (1.9.0)?
@barren scaffold it will either be 127 or 0.
I'm using a certain midi message to set the arduino in a certain mode, with the velocity at 127 to turn the mode on, and 0 to turn the mode off.
If that's a 100% guarantee, then if (a!=0) is the same as if (a==127). But if you do if (a==127) { /* do whatever for 127 */ } else if (a==0) { /* do whatever for 0 */ } else { /* flash a red LED because something went haywire */} you cover all possibilities.
@minor solar not sure where/if there is a changelog but just in case it helps, the branch is here https://github.com/arduino/Arduino/tree/ide-1.9.x-beta
@humble anchor yes meant the board manager, cant find it after following the tutorial on the github read me page
anyone know the distances between the holes on the trinket?
the 2.21mm to the 2.18mm holes from the center to center
playing with the fritzing SVG, 15.32mm. If you have eaglecad that file is probably more accurate
@burnt island I'll verify in a moment, thanks for checking though
@candid wren you can find the other esp32 boards?
@proper forum I kinda did a hasty measurement on the computer screen with my calipers and it's looking like it's about 25mm
@humble anchor
@humble anchor this is what i see
I think it might be named differently but Im trying to get the adafruit esp32 feather board setting like on the adafruit weebpage tutorial : using with arduino IDE
I see it too
I just bought this -> https://www.jaycar.com.au/uno-with-wi-fi/p/XC4411
BOARD DEV UNO ATMEGA328R3+WIFI DUINOTECH
I can't get it to show in my com listings, the manual in the downloads section says i have to move the dipswitches to ON for 3 and 4 and i've done that (turned others off)
but still nothing
Wow that is expensive
The com port should show up regardless @swift belfry
I think
Since the DIP switches are behind the chip that acts as a com port
If you are using windows try installing this driver https://cdn.sparkfun.com/assets/learn_tutorials/8/4/4/CH341SER.EXE
Also try a different cable
np will do
Some cables don't have the data lines, really annoying
WIth Windows it usually the cable, since it has excellent driver support and installs the correct driver pretty quickly
Are there any drawbacks to using Software Serial?
I'm wondering if this will help solve a problem I have while uploading to two UNO boards at once
I'm currently using hardware serial, and I've got to unplug the RX/TX cables when flashing code to allow it to upload successfully
It eats up some CPU bandwidth, it can only go so fast, and it can have issues with timing.
Let me try it out, never really had a use case for it until today
I'm not all too familiar with the Serial BUS, but if I'm trying to isolate data logging to an upstream from say communication between arduinos
Should I be looking for a board that actually has another Serial, like a mega
or will SoftwareSerial be able to fill in this gap
It mostly depends on whether those drawbacks are significant in your use case. If you're happy at 9600bps, it should be fine. If you need to go fast and not lose a byte if something arrives while you're in an interrupt routine, you may want a hardware UART.
I'm just sending a boolean
If you don't need top speed, and it's not a disaster if a byte gets lost, software serial is really nice.
nothing mission critical hehe