#help-with-arduino
1 messages Β· Page 53 of 1
I can't comment on the BLE side, but keeping track of the time in sleep mode should be fine. The board has a 32kHz crystal, and the real-time-clock peripheral of the nRF52840 can be configured to run in sleep mode at low power.
^ yes - I am currently playing with an Espruino MDBT42Q breakout, not the Adafruit feather, but I believe they use the exact same nRF module. It's been running for the past 24 hours on battery and keeping time with the internal RTC while in deep sleep. <1 min deviation from my phone's clock so far (hopefully much less, but i'm not showing seconds)
& yeah @wind drift , you should be able to wake from a button press interrupt no problem using one of the functions I mentioned above. Accelerometer I don't know about, but if it has interrupt capability maybe. You could probably also use one of these vibration sensor spring switches as a low-tech way to wake-on-wiggle https://www.adafruit.com/product/2384
There are various accelerometers and gyroscopes that support a programmable interrupt, often specifically for the purposes of being a pedometer.
And the nicer ones even let you do some sequence-based interrupts
Specifically the one I was remembering that on was: https://www.st.com/resource/en/datasheet/lsm6ds3.pdf
Where, in fact, it seems to have a specific pedometer mode that is probably reasonably hardened on the chip, and as such is very low power.
where it looks like the newest part in that series is: https://www.adafruit.com/product/4438
Behold, the ST LSM6DSOX: The latest in a long line ofΒ quality Accelerometer+Gyroscope 6-DOF IMUs from ST.This IMU sensor has 6 degrees of freedom - 3 degrees each of linear ...
very cool. looks like ~0.55mA current draw if you leave the accelerometer on. Still, if you're deep sleeping, that may be a good portion or even majority of your power budget, wake-on-button/switch would let you go even lower, depending on your requirements.
Yeah, absolutely. Unfortunately kind of just a fact of life with MEMS sensors, it's a small amount of material but it's got to be kept vibrating really quite fast. As with much of engineering, it's a trade of convenience for the end user (it's really nice if they don't need to remember to press a button, but only if that can be achieved with reasonable battery life) along with many other factors.
Normally the gyro is the power-hungry component. Accelerometers can be very low, since they just passively react to forces rather than actively vibrating.
yes, fair point.
or you could get a gyroscope with no mechanical moving parts! It's not going to be any less power-hungry though. Or cheaper... https://en.wikipedia.org/wiki/Ring_laser_gyroscope
Those are awesome. You can measure your latitude by picking up the rotation of the Earth at your location, they're so sensitive.
Hi all, just got the Nano 33 Sense board.
As I understand from the pinout (https://content.arduino.cc/assets/Pinout-NANOsense_latest.pdf), I can program the digital or analog pins just like a regular old school Mega328 by addressing, for example D2, then the Arduino IDE will know that I'm referring to P1.11, right?
Yes, the pin mapping (and direct port addressing) should work similarly.
Also, it appears that none of the pins routed out to the header conflict with the onboard sensors, like accelerometer and mic. Am I right about that?
Looks like the onboard sensors are on I2C bus 1.
The I2C bus routed to the headers is a separate one, so it shouldn't conflict.
https://github.com/arduino/ArduinoCore-nRF528x-mbedos/blob/master/variants/ARDUINO_NANO33BLE/variant.cpp#L7
as I said on the arduino Discord. ;)
Thanks guys. Just got this board and started soldering into a known circuit using the old pro mini and then the doubts started popping up.
Should have spent more time reading up first, I guess π
Just keep the smoke in. 
Well, I got the LED blinking. 1% down, 99 to go π
hello
i have a project i am trying to do with the esp8266
here is the part i am not understanding
if (list_1_weather_0_id == 800) {
Serial.println("clear");
digitalWrite(clearLed, HIGH);
digitalWrite(rainLed, LOW);
digitalWrite(snowLed, LOW);
digitalWrite(fogLed, LOW);
while (zero_to_two_fifty == 800) {
zero_to_two_fifty = math_random_int(30, 200);
delay(100);
pixels_RGB_LED.setPixelColor(math_random_int(0, LEDnum), pixels_RGB_LED.Color(0,zero_to_two_fifty,zero_to_two_fifty));
pixels_RGB_LED.show();
Serial.println("LED");
delay(1000);
}}
but it is not doing the part in the while loop,
It looks like the "equal to 800" condition would never be true, so the loop is skipped.
ah thanks
Hello, please can someone confirm the voltage levels of the i2c pins on the CLUE? It must be in the documentation but I'm struggling to see it.
So, in the tutorial on the website about Animating Multiple LED Backpacks, is there any way to reconfigure the files given to customize the look to how you want?
@stark mist the schematic shows the to be pulled up to 3.3v and the STEMMA connector has 3.3v on it. https://learn.adafruit.com/assets/87877
@odd fjord much appreciated
I hadn't found the schematic π
this makes interfacing with the pi a whole bunch easier
Schematics are usually on the Downloads page of a guide https://learn.adafruit.com/adafruit-clue/downloads
thanks that is extremely useful
Youβre welcome!
Still stuck
@wanton forum what tutorial? give a link please
@wanton forum its at the bottom of the software page, you have to edit the binary arrays.
Huh?
That page describes LED matrix displays, which you can use to display custom images and animations.
So, I can change that around to make it look how I want?
Will it take into account if there's more then three matrices?
Yes, you can modify the code to describe whatever patterns you want. The changes for more matrices aren't terribly difficult either.
It shows the binary code for the mouth, so I'm also assuming there's one for the eyes as well
Right, you would define bitmaps for mouth, eyes, nostrils, anything you wanted to display.
and just one Arduino can handle all that?
I'm unsure what the limits are. The two main limitations are flash (where your bitmaps will be stored) and RAM (where the current display is held).
oh?
Assuming monochromatic on/off matrices, you should have sufficient RAM. If you go to color and/or individually variable brightness, it would take more.
The amount of flash depends on how many different expressions you want to store.
An Arduino has 32kB of flash storage, and each expression (again assuming on/off matrices) would take 156 bytes. There should be enough room for 100 or so expressions.
well, for expressions, I'd like maybe 3 or 4, one of which, if I could be able to animate, which would just be having the eyes blink once in a while. The only ones that would change as part of the expression would be the eyes
You could craft some prototype code set up for all the expected matrices and see if the IDE thinks it will fit.
IDE?
Arduino code is normally built with the Arduino IDE (integrated development environment). It lets you edit the files, build the code, and load it onto an Arduino.
Even if you don't have an Arduino hooked up, you can do test builds to see if the code is okay and it's expected to fit onto an Arduino.
It's often a better way to answer "will it fit" type questions than trying to count bytes.
interesting
I will say, that this project is something I might not be able to do for a while, I think my laptop won't be able to handle it, as it has a few problems, so I would have to wait until I can build a PC. But I figure it might not be a bad idea to get things sorted out for the project now, so then there may be less likely of some problems
@north stream I noticed there were also buttons used in the tutorial I linked, would I be able to use those as well for my project?
Your laptop might be able to (it's just a Java app). Might be worth downloading it to see.
Yes, the Arduino can read buttons directly.
I don't think it can, I can't even open my files without it being annoying, it's a somewhat old laptop, and according to a friend, the specs are terrible
Might be something bogging it down, too. I'm still using a 2006-era Macbook, it's a little slow but still works for programming Arduinos and the like (it lives in the basement for use in my workshop)
Idk, but I'm planning on building a PC anyway
Just figured you might want to start learning before you had that ready to go.
Ah
hi everyone. can anyone point to a modern implementation of an oscilloscope using the adafruit_gfx library on the pyportal. I'm sure it exists but my keywords are failing me. Thanks in advance.
anyone with ov7670 experience?
Probably should just ask your question instead of waiting for an expert to volunteer. In a lot of cases people might be able to help just by reading the datasheet.
is this picture wired correctly? it looks wrong
Can you explain what looks wrong to you? It'd be easier to check a specific thing than check everything.
first thing the xclk should pass through 4.7k resistor
in the first pic it doesnt at all
and also why does he use two resistors? couldnt he just use 1?
they are both 10k
in the first pic
either way the first one looks like it skipped the 4.7k resistors
For the 10k resistors, you couldn't use one because then the two signals would be tied together.
It's not obvious to me what the 4.7k resistors are for. Is it to bypass a level-shifter on the other pins or something?
apparently they are used as pull ups, and a voltage divider.
The pullups are reasonable. The voltage divider is weird. I think it may be an artifact from a previous design using a 5V Arduino, whereas the rest of the tutorial assumes 3.3V for everything.
I haven't checked everything, but if you have a 3.3V Arduino, it will probably work without the 4.7k resistors. And if you have a 5V Arduino, it probably won't work even with them.
my arduino has a pin for 3.3v and a pin for 5v
What does that mean for its I/O voltage?
I dont know
Multimeter time?
how do we check that?
Set a pin high and check its voltage.
so I have to get a multimeter right
(BTW, I take back what I said about probably not working with 5V... since the camera pins are almost all outputs, the 3.3V signals will probably be read correctly by the Arduino regardless. It's just the XCLK that's the issue since it's an input to the camera.)
Good thing to have regardless if you're doing electronics. Plenty of decent ones available for $20 or so. If you don't have one, the alternative is documentation. What kind of Arduino specifically do you have?
That appears to have a 3.3V power output, but all of the I/Os are 5V. So you would need the 4.7k dividers.
hello
my micro usb jack broke off from pcb. i wish to solder a striped usb cable to the pcb
are these the points where i should solder VCC and ground?
or is it these points?
New to the Nano 33 BLE and getting some code up and running. So far, I've set up two characteristics which I can use to change volatile int variables in the code and change RGB LED color by.
But: How do I change the names of the service and characteristics as seen on the central device? (my cell running the nrf Connect app).
And must the UUID for the characteristics be the same as the service?
@hybrid ether VCC and GND would be the two edge pins in the row of 5 smaller pads.
Double-check the continuity with some known ground pad to verify which is which, since it's hard to know how the connector was oriented.
Probably the lefthand one is ground and the righthand one is Vcc. It might be easier to pick up ground at another point (like the top pad of the connector to the left) and Vcc as well (like the top pad of diode D1) but yes, double-check everything before applying power.
okay so this is weird... using a (knockoff) nano, setting pin 13 to output + high causes nothing to happen. but using the blink program (which uses LED_BUILTIN instead), pin 13 outputs 5v and the led blinks as normal
pin 13 i think was working normally before i did some more soldering attempts on it today lol, but i cant be sure
Howdy, can anyone help revise my code? I am working on making a micro servo robotic arm that sorts objects based on color. I got the color identifying part of the code right; however, the arm doesn't move.
Usually servos are controlled with PWM outputs
Yes, I got the servos to move, but it only does so when code is uploading/the arsuino is powered on
Hmm, might be an enable problem or an update issue
lol i found my issue: a6 and a7 can not be used as outputs. trying to set them both as outputs must just do something reaaaly weird
at the very least, setting them both as high outputs causes pin 13 and 10 to fail to output high
what's wrong with this
@wind pond no information about your error in the picture
no why is the error box so big and how do i shrink it its anoying i cant code
dosent even do anything
Edit menu -> decrease font size ? doe snothing ?
shoud i re dounload ide for th 2 time
don't know.
Hello there, my engineering knowledge is just 2 days old today. I was thinking to make a perfect mocap suit with intertial sensors. So I chose Mini Pro for gloves with 16 MPU 6050, and a 16 MUX. Although Gy521 is small, but not that to be housed for fingers, so my solution was to make pcb to arrange terminals in IC and then use wires to a Gy521 module. Is that possible, I dont know the least exceptions with this.
Also it should be independent, and connected to a pi (via wifi) in the head piece that masters body suit and a camera and another MPU 6050. Also for body suit I thought for 22 sensors, so a 16MUX and 8MUX, so do I need another 2MUX or maybe address could do? (0Γ68 0Γ69)
I dont know even the first thing about these things.
Hello ,i was working on esp8266 nodemcu board and was uploading micropython firmware ,i was able to flash it by pressing flash button on the board but when i just connect the board to computer the led gets on once then it stops and the COM port doesn't show up
I installed the required driver
But still not showing up
The board is on because i am getting a WiFi signal named micropython but not able to connect it
So the main problem i am facing is getting that COM PORT show up
@sharp forge You could theoretically talk to 22 sensors with a single 16x MUX and two addresses, but you may have trouble getting data fast enough (I'm not sure what sample rate you're hoping for)
@void vortex Does the board show up on the USB device list?
It shows only when i insert by pressing the flash button and then after a while it goes off
I just erased the firmware inside it and uploaded the blink code and its working but as soon as it uploads com port goes off ,is it the thing to happen is it normal?
I haven't seen that myself, but I don't work with NodeMCU much. It doesn't seem like a driver problem, and I don't know if there's a way for the ESP CPU to disable the serial chip (seems unlikely, but sounds like what you're describing). Could be a power problem.
Ok i will see through it ,i will update if any specific problem i identify
Thank you
@void vortex doesn't the micropython turn the device into a storage device which shows up as removeable storage on computer ?
Can someone tell me if this would work with a mega 2560? https://www.pjrc.com/non-blocking-ws2812-led-library/
Seems to be built for teensy but I don't know enough about the hardware differences
ARM versus AVR processor, so pretty different. It looks like this library is taking advantage of particular things like high-speed UART DMA transfers, so it would generally be only compatible with specific microcontrollers.
Hello, please can someone point me in the right direction for connecting an Mass Storage Device SD card to the Adafruit Clue, I quite likely would like to store more than 2 megs worth of sensor data, I'm also considering just streaming the sensor data across to the raspberry pi and have that do the file storage on its side but I'd also be happy if I didn't have to
actually think I found it https://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial/arduino-wiring
can anyone help me with this error:
Multiple libraries were found for "ESP8266WiFi.h" Used: C:\Users\Admin\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi Multiple libraries were found for "BlynkSimpleEsp8266.h" Used: C:\Users\Admin\Documents\Arduino\libraries\Blynk exit status 1 Error compiling for board LOLIN(WEMOS) D1 R2 & mini.
Pls help
Probably the actual error message is before this in the output. Does it say anything else earlier?
@wraith current no its not showing as a storage device ,its just after uploading the firmware i am not able to open the terminal(serial port for communication)
So i am not getting python terminal RPEL
@north stream i am hoping not more than 12Hz, which is more than enough, will mini pro be able to support it? (Based on max mA support etc?)
That should be feasible. The I2C bus can run at 400kHz, so at that sampling rate you should be able to support hundreds of sensors, in theory. The power requirements should be reasonable too... figure about 5mA per sensor.
Not sure if this is the right channel to post this...
I'm getting a CPP error that something was not declared in this scope. This is only occurring in one file. Should I just put the include for the define that contains the missing term at the top of the my problem file?
@ionic hazel That's what I would try first: the header files generally contain the declarations.
Thanks @north stream . I worked it out π Someone had commented out an include that was needed
Hi any ideas on why when i type F into the serial monitor it outputs it as ASCII?
When you say "outputs it as ASCII", what do you mean?
google ASCII
American Standard Code for Information Interchange, is a character encoding standard for electronic communication
I'm familiar with ASCII, but I'm not sure why you're using the term here. The serial monitor just sends data to a serial port.
okay so say I opened the serial monitor
I type in F and hit enter
if the serial monitor is set to the correct baud rate
what should appear?
you send the byte representation as F and the monitor is likely just turning that in to ascii implicitely
F
how do i stop that?
yes
the monitor receives a byte
and displays it as an F because thats the respresentation its using to display its bytes
if you were using realterm you can tell it to show you the hex
what is it you think you should be seeing?
so what I have is whatever is inputted is saved to a char variable called state
it then prints state to the serial monitor
okay
what are you using to input your bytes
a char is equivalent to a byte in most respects
im using the text input box on the serial monitor
okay so your echo'ing?
you send a byte from the serial monitor, receive it, then send it back to the serial port and it should come back out to your monitor?
what are you seeing on screen?
70
oh
its displaying it as an int
or hex
whats the code look like that you are using for the echo?
rather strange as on my other programs with the exact same block of code to perform the same action it works fine
state = Serial.read();
Serial.print(state);
flag = 0;```
what type is state?
okay so in the monitor what settings do you have?
thats at the beginning of the program
set to a baud rate of 38400
and Serial.begin(38400); is before setup()
so it is definitely on the correct baudrate
both NL and CR
literally tried every single possible setting regardless and it still doesnt work lol
what happens if you just do :
{
Serial.write( Serial.read() );
}```
sorry I dont know how to embed code snippets
also odd ball baudrate any reason you picked that one?
it might be because your using serial.print
serial.write( &state, 1 );
print might be doing some kind of implicit conversion
does anyone know how to embed code blocks?
here in the chat
@stark mist use backtick (`) for inline code, and three backticks in a row for multi-line
awesome thank you
@scenic citrus much appreciated
so i have a wee car and a wee controllee
both that are connected over bluetooth
and the hc05 bluetooth modules I have are automatically set to a baudrate of 38400 baudrate
so thats why it's that baudrate
@pine bramble FWIW this code is working fine for me and printing characters
just tried it on an Arduino Duemilanove
np π
@sharp forge came across this creative solution for talking to a bunch of I2C sensors https://www.sparkfun.com/news/3266
Facing the daunting task of wiring together 192 of the same I2C sensor inspired a creative solution.
anyone ever used a h bridge motor driver?
like an l923d?
need some help with the most bazaar issue ive ever experienced in all my time of coding
I've played with H bridges (currently playing with one to drive a GTL3)
pls help me
so i have set the outputs to a motor as low for both wires
what would you expect the motor to do?
@north stream
Outputs, not inputs? I would expect the motor to either free spin (high Z) or brake (low Z)
theyre dc motors
theyre both set to low
and the motor spins
makes absolutely no sense
Seems like a miswiring or a chip that doesn't work right
I'd get out the multimeter.
Greetings! I'm trying to see if I can use a Metro M0+ or M4 board as a UBS CDC device connecting the CDC endpoint to a SERDES lane in UART mode. The idea is to be able to essentially have a 4 port serial interface over USB, and some HID functions for turning on and off the connected devices. I can see how to get the SERDES parts done, but I cannot seem to find any docs on how to create CDC endpoints on the USB device in Arduino or CircuitPython. Is this even possible, or do I have to do something in a lower level environment (like MPLAB) directly?
@north stream Hello, I hate to bug ya, but is it possible to program the Arduino (connected to LED matrices) to do a sort of. . . . wake up animation type thing? Like when you switch it on?
@wanton forum Yes, just put the animation sequence in your setup() function and it will only happen once when the board powers up
or is reset
If you are using something like the Adafruit NeoPixel or FastLED libraries, you can write a function that does the animation and just call that function from setup()
are either of those easy to use or figure out?
I can't really answer that without knowing more about the LED matricies you are using and how they are connected. I would suggest spending some time playing around with the devices and examples, and then adapt those examples to suit your needs as the easiest way.
alright then
I think the ones I plan on workin with are the Adafruit LED 8x8 Matrix w/ Backpack, and I think also the 16x8 ones as well
Check the learn articles on those devices, there are some excellent tutorials in there.
@north stream thanks!
whats the cheapest arduino/adafruit/etc board that has the ability to act as a keyboard/mouse?
That'd pretty much be anything with USB functionality, most likely.
@bronze grotto Probably a 32U4 board like https://www.adafruit.com/product/3677
Maybe Trinket M0 or RPi Zero?
A Pi Zero is certainly inexpensive but I don't know offhand if it can act as a USB slave. A Trinket M0 is is a solid choice, and much more powerful than a 32U4.
Yeah, I wasn't sure about the Pi, older Pis don't seem to have the right mode supported in hardware, but seems some folks found software workarounds. Not my wheelhouse exactly, but could pan out maybe with some research. Hard to beat $5 without getting raw processors from China.
Does a button have to be connected to a breadboard for it to work with an Arduino, if it's connected via wires instead?
Wires should work fine. Nothing magic about a breadboard... it's just wires under the hood too.
alright, cause what I have in mind, is the Arduino being hidden around the head of my costume project, and wires running to buttons hidden in the gloves, to change expressions in the face
I'm just kinda trying to figure out how to make it so the button is firmly on a surface to make it easier for pressing
There are a few ways to manage that sort of thing. You can make your own switch out of conductive patches on your gloves, or use a Hall effect sensor or reed switch with a magnet. Alternatively, you can add a little bracing (like wood cut from a popsicle stick) to give the switch some more support.
What would be a good example of conductive patches? And what is a Hall effect sensor?
A Hall sensor picks up magnetic fields, either from magnets or electrical currents. So you can use them as a trigger for a non-contact switch when a magnet comes into proximity with them.
A conductive patch might be a piece of copper tape, for instance... touch a fingertip to your palm to close a circuit.
I cannot do that, can't make a proper closed fist
but I'm sure there's something I could work with
Finger-to-thumb would also work pretty well. Lots of possibilities.
well, my idea was, the gloves wold have hollow plastic claws over the tips, so I was thinking of putting a button or something on the inside part of that, inside the glove, so it'd be on a hard-ish surface, then I can quickly touch my finger with my thumb to press the button
but Idk if that'd backfire if I tried grabbing or holding something
yeah, a hall sensor might work - small magnet in the thumb, hall sensor in the inner glove (or even index finger)
can I have more then one?
you could have multiple hall sensors... each would need to be tied to a different pin (you could do something complex with resistors to tie them to one pin, but that's another conversation). If you're using a Trinket M0, then you might start to run out of pins
wouldn't I need to have them on different pins anyway if I have different expressions?
well.... there's a way to have multiple inputs (buttons, Hall sensors, etc) on one pin (https://www.instructables.com/id/How-to-Multiple-Buttons-on-1-Analog-Pin-Arduino-Tu/)... though you might not to add that level of complexity to your code
you would take a different action depending on the voltage reported... again, you might not need that level of complexity if you have enough pins for a one pin to button ratio
hmm, wondering if I might be going a little overboard with this project of mine
I think perhaps, while I do want to use buttons for multiple expressions, it could possibly be a better idea for me to just get one static (or animated) expression done first, I could always go back another day to do more with it. . . right?
that's a good approach. Most of us start "small" then add on to our projects
I feel a bit better about it now
I'd imagine I can find this with a bit of digging but does anyone know how to make a UF2 from an Arduino sketch? I see these in a few learn guides but I've never had to make one before.
Normally Arduino code isn't uploaded in a UF2 format, it's just handed off to a bootloader that copies it into flash.
Pages like https://learn.adafruit.com/how-to-make-animated-graphics-for-hologram-displays/software have a download of UF2. I thought I'd also seen guides which had a "here's the code or here's the UF2" but perhaps I imagined that.
Ignore that, that's not a good example.
Aha, found one: https://learn.adafruit.com/hallowing-minotaur-maze/software
reminds me of a Tamagotchi pet
This seems to be the payload:
https://github.com/Microsoft/uf2/blob/master/utils/uf2conv.py
@pine bramble Thanks, I'll have a look.
Hey team... I've been making headway trying to adapt John Park's Atari Fruit arduino code over to the Circuit Python Bluefruit.... and i was actually getting it to connect via bluetooth after using arduino ide and uploading the code... but now i've gotten to a point where i can't seem to connect via bluetooth anymore, and the board has gotten "fickle". Is there a way to reset this board to factory defaults? I would love to get back to where I was just a few hours ago. Thanks!
cause im having some problems with -> https://learn.sparkfun.com/tutorials/live-spotify-album-art-display/all
this works GREAT on my ESP32 π but they use
xTaskCreatePinnedToCore(
Task1code, /* Task function. */
"Task1", /* name of task. */
10000, /* Stack size of task */
NULL, /* parameter of the task */
0, /* priority of the task */
&Task1, /* Task handle to keep track of created task */
0); /* pin task to core 0 */
Tasks and when i uncomment my LED code (FastLED) in the "void loop()" the task stops :S
By "stops", do you mean it crashes? There doesn't seem to be anything weird about the task-creation function you posted, so I'd suspect a problem in your LED code.
@elder hare Do you get an error dump in the console?
there is no crash and no error @cedar mountain @safe shell
the task stops but the main loop() keeps running
and if i comment out everything inside the "main loop()" then the task keeps running like it should
So it sounds like the Task1 code and your loop() code are both accessing some LEDs? Perhaps they are contending for the same communications bus and causing a wait.
i did try to move the Task to Core 1 but still nope :S
this is what im running in the main loop()
static void Run() {
// Current Millis Time
unsigned long curtime = millis();
for (int Index = 0; Index < 6; ++Index) {
// Check Current Time against Strip Array Time and update accordingly
if (curtime > ARRAY_STRIP_SETTING[Index].lastUpdate) {
if(ARRAY_STRIP_SETTING[Index].ActivePattern == 3){
ARRAY_STRIP_SETTING[Index].Delta = 1;
}
// Check Strip Array Current Pattern and switch accordingly
switch (ARRAY_STRIP_SETTING[Index].ActivePattern){
case 1: Animation::SolidColor(Index); break;
case 2: Animation::TheaterChase(Index); break;
case 3: Animation::Cylon(Index); break;
default: break;
}
ARRAY_STRIP_SETTING[Index].lastUpdate = curtime + ARRAY_STRIP_SETTING[Index].Delay;
// Move the pattern in the direction choosen and increment Array Index by 1
Function::Increment(Index);
FastLED.show();
}
}
}
Have you tried increasing the Delay value? Maybe it's just running too often.
yea tried that :/ no go
what is weird is that the Spotify task is running on Core 0 and the main loop() is running on Core 1 :S
so they shouldn't colide
So I'm a little confused by the Run() declaration. Is this a function inside loop()?
yea
How is it being called?
void loop() {
Animation::Run();
}
Gotcha.
Perhaps a silly question, but what is the Task1 code doing now? Is it the same as the original example code, or is it new logic?
it's exactly the same! all i did instead of fetching the album image im getting Artist - Title!
ok ok ok ok
im confused
it's........it's working :S
what...
sooo the reason i was saying it wasn't working is that when i only ran the Task without main loop() i could see in the Serial Monitor it printed "Artist - Title"... but when i hooked up the main loop() aswell the prints would stop in the Serial Monitor....
but now i gave power to my dot led matrix display and uploaded my sketch with main loop() and Task1 active at the same time and..... the "Artist - Title" is updating correct on the dot led matrix display but as i mentioned the prints in Serial Monitor has stopped even tho it SHOULD print them out :S
that is super weird :S
Nano 33 BLE:
I want to connect two boards with I2C. Can I simply solder two pull ups from the pads on the Nano to the board's own 3V3 supply pin? (assuming everything else is alright)
Yep, that should be fine.
hi i have got a problem with the example reciver sketch for dmxSerial library the led just keeps flashing randomly
hello, i have an arduino micro with a busted serial converter, it gets SUPER hot and all uploads fail, but the rest of it seems fine. if I just desolder it, could i program the micro directly from an uno? of note is that the micro is a clone, specifically a: LGT8F328P LQFP32 MiniEVB
or, does anyone know how to troubleshoot a ?shorted? serial converter? i literally don't know what happened i didn't do anything to it
anyone used MD_Parola in here?
@elder hare I use md parola
How can i get Γ Γ Γ ro display π«
First ask the author on github, he'll know right away if the characters are already availablein the font : https://github.com/MajicDesigns/MD_Parola
if not, then you can design your own characters and map to chars you don't need.
Those chars do appear in ascii though so . . . https://www.codetable.net/asciikeycodes
Complete list of ASCII Key Codes
I use (char)247 to get the degrees symbol in my project, even though that table says it would be the division symbol . . . go figure.
Β° is 0xB0 (176) in Unicode.
hi all: is there a way to enable the full 12 bits to be available on a feather m4 in arduino. analogRead seems to default to 10 bits. thanks.
@tawny tide try calling analogReadResolution(12) https://www.arduino.cc/reference/en/language/functions/zero-due-mkr-family/analogreadresolution/
Hi there, I'm trying to use SERCOM to create a SPI bus to communicate between SAMD21 and TLC59711 via the adafruit lib (https://github.com/adafruit/Adafruit_TLC59711) but for some reasons I fail to it
I use a custom PCB, based on this variant.cpp : https://github.com/sparkfun/Arduino_Boards/blob/master/sparkfun/samd/variants/SparkFun_SAMD_Mini/variant.cpp
I created a sample repo on github here: https://github.com/xseignard/test-rushbuttons
Where you can find the setup, the most important is here:
#include <Adafruit_TLC59711.h>
#include <SPI.h>
#include <wiring_private.h>
// This one is working, e.g using default pins
// data: 11
// clock: 13
// Adafruit_TLC59711 tlc = Adafruit_TLC59711(1);
// The following is working
// bit-banging mode
// Adafruit_TLC59711 tlc = Adafruit_TLC59711(1, 5, 4);
// SERCOM SPI
// SPIClass SPI (&PERIPH_SPI, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI, PAD_SPI_TX, PAD_SPI_RX);
// not working...
SPIClass SPI2(&sercom2, 3, 5, 4, SPI_PAD_0_SCK_3, SERCOM_RX_PAD_1);
Adafruit_TLC59711 tlc = Adafruit_TLC59711(1, &SPI2);
void setup() {
SerialUSB.begin(9600);
pinPeripheral(3, PIO_SERCOM_ALT);
pinPeripheral(4, PIO_SERCOM_ALT);
pinPeripheral(5, PIO_SERCOM);
tlc.begin(); // will call SPI2.begin(); internally
tlc.write();
}
But for some reasons it's not working. What I'm doing wrong ?
Are your SPI signals getting out?
unfortunately I don't have a logic analyzer
But I don't understand what is wrong.
SERCOM2 SPI
Variant
| SAMD21 pin | Arduino pin | SERCOM PAD | ALT or NOT |
|---|---|---|---|
| PA14 | 2 | SERCOM2/PAD[2] | PIO_SERCOM |
| PA09 | 3 | SERCOM2/PAD[1] | PIO_SERCOM_ALT |
| PA08 | 4 | SERCOM2/PAD[0] | PIO_SERCOM_ALT |
| PA15 | 5 | SERCOM2/PAD[3] | PIO_SERCOM |
Pads selection
MISO
typedef enum
{
SERCOM_RX_PAD_0 = 0,
SERCOM_RX_PAD_1,
SERCOM_RX_PAD_2,
SERCOM_RX_PAD_3
} SercomRXPad;
MOSI/SCK
typedef enum
{
SPI_PAD_0_SCK_1 = 0,
SPI_PAD_2_SCK_3,
SPI_PAD_3_SCK_1,
SPI_PAD_0_SCK_3
} SercomSpiTXPad;
- I need SCK on PA15 (pin 5, pad 3), MOSI on PA08 (pin 4, pad 0)
- It gives me : SPI_PAD_0_SCK_3
- It then restricts MISO on pad 1 (PA09, pin 3) or 2 (PA14, pin 2)
- I choose pad 1 for no particular reason (I tried pad 2, no more luck)
So my SPIClass would be :
// SPIClass SPI (&PERIPH_SPI, PIN_SPI_MISO, PIN_SPI_SCK, PIN_SPI_MOSI, PAD_SPI_TX, PAD_SPI_RX);
SPIClass SPI2(&sercom2, 3, 5, 4, SPI_PAD_0_SCK_3, SERCOM_RX_PAD_1);
And pinPeripheral would be:
pinPeripheral(3, PIO_SERCOM_ALT);
pinPeripheral(4, PIO_SERCOM_ALT);
pinPeripheral(5, PIO_SERCOM);
It should work, I asked a colleague with a logic analyzer and he sees data flowing
But still not working with adafruit lib (https://github.com/adafruit/Adafruit_TLC59711)
If I create my own variant.h and variant.cpp and assign the sercom2 to the default SPI it also works.
Sounds like you're really close.
just found out
I need to call tlc.begin(); (for SPI2.begin to be called) before the pinPeripheral so:
tlc.begin();
pinPeripheral(3, PIO_SERCOM_ALT);
pinPeripheral(4, PIO_SERCOM_ALT);
pinPeripheral(5, PIO_SERCOM);
Feels a bit counter intuitive to my understanding, but that's good!
I'm glad you figured that one out!
thanks for the encouragements, really appreciate it
I know nothing about python
I'm trying to read information from an arduino into python
and for some reason the if statement isn't registering so I'm guessing either something is wrong with the data type or something else
https://pastebin.com/uDcmZwNp
It's printing the character as a new line but it's not going into the if statement
Completely new to python and not great at Arduino
FIY @north stream, here is the custom PCB I'm working on
(this one will go straight to the wounded protoypes bin)
@timid vine I recommend you to post to #help-with-circuitpython
This is Arduino
oh sorry! my bad
(Phantom's problem solved in #general-tech, since it was a desktop-side Python issue.)
Hello, if someone could please take a look at the question I posted here it would be appreciated, thanks!
https://forum.arduino.cc/index.php?topic=674199.0
Cannot retrieve data using client.readStringUntil('\a');
So it looks like the sending code is doing a literal backslash plus "a", due to the "\\a" string, whereas the receiving code is looking for the "\a" escape character, a 0x07 byte.
Hello I'm new to Arduino, is there an alternative way to connect GND/3.3V without creating any PCBs? (This case I'm using more than 4 IR sensors) 
A breadboard might be what you're looking for.
Or these https://www.adafruit.com/product/874
Okay! Thank you 
Are the ESP8266 wifi microchips typically ready to use out of the box with arduino? I am a little confused as some tutorials talk about needing to upgrade the firmware and program the chips. I see there is a USB dongle you can buy to do this but I also see that it might be possible using the arduino itself? I have a Nano and an UNO, any direction/help/links would be appreciated.
My understanding is that they can come with different firmware. To work with Arduino, you want the bootloader firmware, instead of the "AT" firmware, the "NINA" firmware, or one of the others. However, I could be wrong.
Unfortunately, I do not know how to update the firmware on an ESP.
@dull schooner are you looking at a particular board or buying the chips themselves for your own boards
@odd fjord I already purchased the HiLetgo ESP8266 esp-01 from amazon. I can share the link if that is allowed
I vaguely recall that you pull a particular GPIO line or two to specific levels and then send the firmware over an ordinary serial link, but I'm unclear on the details.
the amazon listing has links to docs, github, and a very old youtube tutorial. but i am still at a loss, i am thinking because this stuff is old
Worse, because of amazon's βship "equivalent" merchandise from the closest warehouseβ, there's a chance that the unit you receive may not be the one you ordered.
That should be ready for Arduino.
@north stream Yeah thats what I was thinking/hoping but the only tutorial i have found so far uses an arduino with microcontroller removed and on mine the microcontroller is not socketed so i cannot do that
With an Arduino, the serial chip and the controller are decoupled by 1k resistors, so if you load a "do nothing" sketch that leaves the RX and TX pins in a high impedance state, you can then use the Arduino board as a serial interface.
@north stream ok now that is the type of info I came here for, thank you. I was hoping there was something like that. a blank sketch! brilliant
you also can use a serial to USB cable https://www.adafruit.com/product/954
I have had success with communicating over RF between my nano and uno but now I want to learn how to connect them to the internet. I thought the RF would be the hard one and it was much easier so far π
@odd fjord thanks for that link
Are you planning to use the ESP8266 stand-alone or were you planning to use it to add wifi to your UNO?
Note that a standard Arduino is 5V logic, and an ESP is 3.3V logic, so you'd need a little circuitry between them to protect the ESP if you're going the Arduino route. The cable jerryn linked to is a 3.3V one, so can be safely connected directly to an ESP.
@odd fjord I was hoping to use it to add wifi to my uno or nano. but since you are asking I am guessing there may be a flaw in my thinking
@north stream and i cannot use the 3.3v from the uno? I read that but I dont understand why
no - It's just that the cable would be best for stand-alone.
ahh i see
If it's a 3.3V Uno, yes, however most Uno boards are 5V.
@north stream Maybe you can clarify for me... i was wondering why the 3.3v rail from the uno can't be used. I have the sparkfun redboard and it has a 5v and a 3.3v pin in the power sections.
but my understanding is the board runs on 5v
Yes, the Uno provides a 3.3V supply, but the serial signals (which are the ones you'd want here) are 5V.
Additionally, I'm unsure if the 3.3V supply on a Uno has enough current capacity to operate an ESP.
ok thank you @north stream and @odd fjord you have helped me enough to continue googling and reading. I really appreciate your guidance!
Good luck!
@dull schooner Just a few addenda: budget for 250mA current draw for the ESP chip. Useful resource for bootloading: https://github.com/espressif/esptool/wiki/ESP8266-Boot-Mode-Selection
Is there a way to make additional USB-CDC endpoints on a SAMD21 (Metro M0+) or SAMD51 (Metro M4) board in Arduino, or do I need to go lower level and use MPLAB directly?
If possible I would like to make a few additional USB-CDC endpoints that connect to SERDES UART ports, but I'm having a hard time determining how this can be done in Arduino or CircuitPython
You might be able to leverage PluggableUSB to do that. https://github.com/arduino/Arduino/wiki/PluggableUSB-and-PluggableHID-howto
Looks like that has the same limitation of only supporting HID, MSC, and MIDI
hey guys, i cant figure out an issue in my code for LED strips if anyone doesnt mind taking a look?
Just put it out there, we don't know who might be able to help until we see it.
ok so basically im trying to have both led strips colorwipe at the same time. i tried to keep it as simple as possible for myself but its around 230 lines of code. my issue is that on 2 collective strips, i can only get the first pixel on strip1 to work. https://pastebin.com/SYwH1rEZ is the full code but im guessing the issue is in the last few lines of code
void strip1Complete();
void strip2Complete();
// Define some NeoPatterns for the two strips
// as well as some completion routines
NeoPatterns strip1(300, 6, NEO_GRBW + NEO_KHZ800, &strip1Complete);
NeoPatterns strip2(150, 5, NEO_GRB + NEO_KHZ800, &strip1Complete);
// Initialize everything and prepare to start
void setup()
{
// Initialize all the pixelStrips
strip1.begin();
strip2.begin();
}
unsigned long next = 1;
boolean phase1_done = false;
boolean phase2_done = false;
unsigned long msec = 5; // next trigger time
// Main loop
void loop()
{
// Update the strips.
strip1.Update();
strip2.Update();
if ((millis() - next) >= !phase1_done)
{
strip1.ActivePattern = COLOR_WIPE;
strip2.ActivePattern = COLOR_WIPE;
strip2.TotalSteps = strip2.numPixels();
// lock out this phase
phase1_done = true;
phase2_done = true;
msec = 99; // next phase
}
}
//------------------------------------------------------------
//Completion Routines - get called on completion of a pattern
//------------------------------------------------------------
// Strip1 Completion Callback
void strip1Complete()
{
strip1.Color1 = strip1.Wheel(random(255));
strip1.Interval = 20;
}
// Strip 2 Completion Callback
void Strip2Complete()
{
strip2.Color1 = strip2.Wheel(random(255));
strip2.Interval = 20;
}
Is there a way to create 5V from an ESP8266? I heard that you can't use Vin pins as the voltage source π€
@silk iron I wonder if you're running out of memory
@west stream Depends on the board: some have a Vusb pin you can use to get 5V from USB.
@north stream I don't think so, it only uses 11% storage and 5% dynamic memory of my Uno. The problem is Im fairly new to code already so using State machine makes it even more confusing
Hmm. I wonder if strip updates are affecting each other, timing wise, somehow.
@silk iron dunno that this would cause your issue, but you have strip1Complete as the callback function for both strip1 and 2 in the code you posted above:
NeoPatterns strip1(300, 6, NEO_GRBW + NEO_KHZ800, &strip1Complete);
NeoPatterns strip2(150, 5, NEO_GRB + NEO_KHZ800, &strip1Complete);
guessing the latter should be &strip2Complete?
@north stream I've tried putting them in the setup but it does the same thing. @scenic citrus yeah I accidentally hit undo 1 too many times before I saved the code, but it's fixed and still only activating one Pixel
@silk iron have you gotten it working with 1 strip first? ie. if you comment out all of the strip2 code, does strip 1 work/behave differently? that would help rule out "strip updates are affecting each other, timing wise" as @north stream suggested
Not yet but I will give that a shot, and see what happens. Thanks!
OK so apparently the issue was with the "totalsteps", i had declared strip2 but not strip1 and now it works! thanks for the help guys!!!
if ((millis() - next) >= msec && !phase1_done)
{
strip1.ActivePattern = COLOR_WIPE;
strip2.ActivePattern = COLOR_WIPE;
strip1.TotalSteps = strip1.numPixels();
^^^THIS SONUVABEECH^^^
strip2.TotalSteps = strip2.numPixels();
// lock out this phase
phase1_done = true;
phase2_done = true;
msec = 99; // next phase
}
Hello, I'm looking for some advice for scaling down a 5v analogue voltage signal to be 3v, so similar to a logic voltage but I need the entire 5v range scaled into the 3v range rather than just clipped ect
@stark mist Is this for an analog input? Depending on the precision you need and if some current usage is OK, you could use a voltage divider with resistors.
I'd have to check the draw versus what the clue and pi can give versus what I'm already using
It wouldn't be much current... resistor values could go higher for less current (but potentially more noise)
yes its for an analogue input
I have a quarter turn throttle position sensor that outputs just under 5v at full throttle and just above 0 volts at 0 throttle
Simplest would be two identical-value resistors (could use 1% resistors for better match), then you have 0-2.5v, battery voltage monitors are often done this way. How many voltage levels are you hoping to differentiate (i.e., how many bits of ADC)?
I was thinking to use the analogue pins on the clue although I haven't read up on how to do that yet
Looks like plenty of analog-in capable pins on Clue, should be fine.
ok so i added a few more lines and got the strips to go in reverse on completion and its starting to make a lot more sense. now my issue is i cant find a way to increase the speed between pixels. I can only find a way to slow down the speed between color wipes
unsigned long next = 0;
boolean phase1_done = false;
boolean phase2_done = false;
unsigned long msec = 0; // next trigger time
// Main loop
void loop()
{
// Update the strips.
strip1.Update();
strip2.Update();
if ((millis() - next) >= msec && !phase1_done)
{
strip1.ActivePattern = COLOR_WIPE;
strip1.TotalSteps = strip1.numPixels();
strip1.Interval = 0;
// lock out this phase
phase1_done = true;
msec = 99; // next phase
} ```
Possibly you'd need to change two or more pixels per cycle to go faster, if it's already updating as fast as possible.
how do i know if its going as fast as possible? i cant figure out which part controls the speed
full code https://pastebin.com/PXg8fgxb
@cedar mountain
so i think the issue is actually with my UNO being too slow and not my code but i would appreciate it if someone could take a look just incase.
You could do some basic math for how many LEDs you are controlling, how much RGB data is being sent, and what the data rate is. That way you can know that you can expect N updates per second regardless of the code or processor speed.
Looks like 300 RGBW and 150 RGB, so that'd be a total of 13200 bits per update. At 800kHz, you'd expect 60 updates per second. So it'd take about 5 seconds to animate pixels one by one down the longer strip, if everything else is optimal.
What kind of speeds are you seeing?
@cedar mountain that sounds about right, im getting about 4 seconds for the length of thee 300strip. now im having trouble changing the increment like you suggested. do i have to change index++?
The easiest tweak would be something like:
{
setPixelColor(Index, Color1);
Increment();
setPixelColor(Index, Color1);
Increment();
show();
}```
where you change two pixels before sending the new data to the LEDs.
@cedar mountain Now thats the speed i was talking about!!! thank you so much, if i wanted to learn more about how that works do i look up C++ increments? because i tried to look up arduino index++ but that wasnt much help
i want to keep this code as simple as possible to understand while still being able to complete relatively complicated tasks so that i can use it as a guide for myself when writing future code. im trying to deconstruct every line of code by testing it on my led strips so i know what each line does and how i can customize it
also just wondering, is there a way to make it even easier by assigning(?) Increment a int value like Increment(int skip)
@silk iron the code index++ is just a shortcut which means the same as index = index + 1 (look up "C++ increment operator" if you're curious). So yes - you could change the top of the function to void Increment(uint8_t skip) and then change Index++ to Index = Index + skip
likewise with --Index - change to Index = Index - skip
@scenic citrus wow i actually understood that, thanks for the help and reference!
no prob π
A warning on using Direction backwards when changing by more than 1 at a time
Index is unsigned
so if Index becomes e.g. 1 and you call Increment(2) then it would dutifully subtract 2, roll over to 65535 which is >0, so it wouldn't exit like you expect.
The "<=0" is also not terribly meaningful for an unsigned value, so really you're just comparing ==0.
If you only increment/decrement 1 at a time, then it's OK because you'll always hit 0.
And on the forward direction, you're generally saved for reasonable values by the uint16_t maximum (65535) being much larger than ((Index -1) + skip), so you don't roll over in the positive direction
@lost nest it seems to be working fine as of now but thanks for the heads up!
Is it possible to charge the battery attached to a Feather without the Feather itself being on? This is possible with an ItsyBitsy and the charger backpack, which is the functionally Iβm hoping I can replicate with a Feather.
@fair steeple If you Ground the EN pin, the Feather will be off but the battery will still charge.
So, I've got an awkward issue.... I worked an Atmega32U4 into a project. I hooked up the USB as the datasheet suggests when using a 5v design (UGND connected to UGND but not connected to GND, UVCC to VCC, D+ to D+, D- to D-) except that I do not have anything hooked up to the UID wire. This is different than the Pro Micro design as they connect UGND to GND. When I hook up my USB, the computer does not see the 32U4. But if I connect UGND to GND it shows up and can be flashed over USB etc.... However, my 595's hooked to my LEDs start going nuts when UGND is connected to GND. They still partially display what they should, but there's a lot of random "noise" shown on the lights. The 595's are connected to a 3v regulator, and not directly to VCC.
I have another chip (vs1053b) hooked up to the 3v regulator for audio output that seems to function normally when UGND is connected to GND
So far everything on the device seems to operate the same if UGND and GND are or aren't connected except no USB if they're not attached, and lots of HC595 noise if they are attached...
SO, the erratic 595 behavior is really really similar to how they behave if you don't feed their power pins and just give them S0,S1,S2 input, but not quite as bad. Completely cutting the power made it a little worse. I cut the power then attached the 595's to the 5v rail and it fixed the erratic behavior. I noticed the 3v line was fluctuating with UGND and GND connected.... gonna have to look into it more. The 1.8v coming out of the same power regulator was completely steady.
Is it a special 595 or a standard 5V one? If it's a 5V one, it's not going to work particularly well on 3V.
has anyone used Processing to communicate with their arduino projects?
specifically android processing apps
I've done it for IMU calibration, but not on Android
@north stream it's a SN74HC595DR surface mount https://lcsc.com/product-detail/74-Series_Texas-Instruments_SN74HC595DR_Texas-Instruments-Texas-Instruments-SN74HC595DR_C10092.html
Texas Instruments Texas Instruments SN74HC595DR US$0.24 LCSC electronic components online Logic ICs 74 Series leaded datasheet+inventory and pricing
I must be misunderstanding the datasheet. I liked the brightness I was getting off the LEDs running it all off 3v, but man those 595's did not like when I connected that UGND. Something interesting, though... without UGND connected to GND the device VCC was only running at 4v, but the connection between UGND and VCC was 5v. With UGND and GND connected the whole VCC went up to 5v. I guess somehow the chip was sapping that approx 1v internally somehow, however it connects UGND to the GND lines internally. Also, with all the changes made, 595's connected to 5v, UGND connected to GND, the 3v voltage regulator seems to be running stable again.
Ah, that's a newer CMOS 595, it can run fine on 3V
Does anyone know how to connect a hc05 module to the bluetooth in an android phone?
like the actual android phone settings
cant detect the hc05 module at all
Maybe this Instructable? https://www.instructables.com/id/Arduino-AND-Bluetooth-HC-05-Connecting-easily/
<@&327289013561982976> I didn't know where to actually post this since it relates to a project as well as arduino help sorry about that But I could some serious help. My issue is that I'm using the STM32f405 feather along with a 3.5 feather touchscreen. Right now all I'm attempting is a graphics test but when I upload I get just a blank white screen can anyone help?
@deft scroll please only ping moderators when you have a moderation issue.
(aka something offensive that needs to be taken down)
this is the best place to ask a question and the Adafruit support forums are a second good place: https://forums.adafruit.com/
ok and thanks but I cannot log in there
@north stream thanks man, sadly the issue is the phone even detecting the hc05 module in the first place
Could be the module isn't discoverable. Can you detect it with your laptop?
@deft scroll do you have an account? what is happening when you try to log in?
I started by changing my password but it refuses to change
but I already posted the help at the help with projects if it's ok I can talk about it there
yep. that's fine. just wondering if we have an issue with the forums we need to look into.
It may be something on my behalf, but I got the topic going and we can talk there if that's ok as I don 't want to keep talking about an off topic here.
sure no prob. you can let us know if there is an issue with the forums though.
@north stream you were correct! turns out cmode was set to 0 when it should have been 1, thanks man!
Hello everyone. I am trying to drive 4 DC motors using the Adafruit Motorshield v1. Sometime only one motor spins and other times 3 motors spin. The behavior is unpredictable. I tried using 2 3.7V batteries as well as 3 batteries. Any suggestions?
Anyone here modify sercoms to get a second I2C port on a M0? I am using a feather M0 at the moment. If there is I have more details in this post https://forums.adafruit.com/viewtopic.php?f=57&t=164114
@wheat kiln it looks like too little power. I have used the v2 of that shield and I used 6 double aβs to power the motors and the Arduino.
I double checked, that connector is supposed to be 5-12v on v2. I imagine it was similar on v1
Those batteries are lithium-ion 18650s
Higher voltage and probably more energy dense than any battery regularly used here.
As long as they're reasonably charged (that is to say, you'd have to discharge them to unsafe levels in order for the overall voltage to be too low) they should be in the 5-12V range
2 batteries, depending on their state of charge, might be marginally too low to supply power to the Arduino.
And the cables from the batteries to the board might be a little thin, so there could be some drooping voltage or noise injection.
Have you tried each of the motors individually?
Also, while in general it should be sufficient voltage for the shield, do you know that it is sufficient voltage for your motors? And are you trying to run them at full-speed, or slower?
@lost nest thank you so much for the response. I tried each motor individually. The strange thing is each motor works when connected alone to the shield, but only on M3 (one of the motor slots). However, I guarantee you if I fiddle with it enough, I might be lucky and get 2 motors to work simultaneously. I winder if I need capacitors across the motor nodes. I am getting mixed responses on whether this is too much energy vs too little. I will have access to a multi-meter shortly, I will measure the voltage across each motor
What motor speeds are you trying?
Oh. My mistake. They are 3.7v each then so that should be fine.
Capacitors across the motor nodes can be a bit difficult: the PWM drive will put a bunch of extra current through the capacitor when you switch.
If you were going to put an extra capacitor anywhere, I'd put it on the input voltage screw terminal.
Solved my I2C issue. See post if you want to know.
Nice, glad you got it sorted
this is driving me NUTS..... having trouble with my MAX7219 dot led matrix daisy chain of 32.... the text appear on the display but then randomly portion / half / 80% of the display goes black and sometimes one of the letters/screen just turns to garbled text :S i JUST tried a level shifter (3.3v to 5v) to make the CS and CLK signal stronger (as suggested on some forums) but this actualy makes it worse :S it is NOT a power issue :S
The data sheet says 3.5V for the high threshold, so the level-shifter seems to be a good idea. It doesn't specify how much current the logic pins draw, though, so it's hard to know if your shifter might be getting overwhelmed with 32 in parallel. What clock speed are you using?
It's apparently an I2C shifter too, which is non ideal for these types and speeds of signalling.
processing.app.debug.RunnerException
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:152)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$UploadHandler.run(Editor.java:2047)
at java.lang.Thread.run(Thread.java:748)
Caused by: processing.app.SerialException: Error touching serial port 'COM6'.
at processing.app.Serial.touchForCDCReset(Serial.java:107)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:136)
... 5 more
Caused by: jssc.SerialPortException: Port name - COM6; Method name - openPort(); Exception type - Port busy.
at jssc.SerialPort.openPort(SerialPort.java:164)
at processing.app.Serial.touchForCDCReset(Serial.java:101)
... 6 more
soooooooo
what is this error
it wont upload
"Port busy." seems fairly clear: probably some other program has the port open.
An error occurred while uploading the sketch
No device found on COM5
well
is my board toast
First, you need to figure out which port your device is really on (annoyingly, that can change in windows)
well I know its port
and it still wont find it
what did I do to burn it this time
how do I check if my board is working
cause I cant upload to it
its an arduino due
@north stream
Does it show up with a vendor ID and product ID?
where would it show up?
it appears on the correct port when I check on it on nightly
In the USB device list
on the device manager?
I don't know, I don't use windows
linux?
welp
I tried arduino create
and it didnt upload
so I guess its official
my board is toast
although I didn't anything to it
dmesg in Linux, or /var/log should have the necessary entries to notice if the board is recognized.
Unplug every last USB device, cold boot.
We had one person here with at least one unnecessary USB device plugged in during all troubleshooting.
That just ended up being a mask for the problem.
Many people become convinced they need to return an item that's supposed to be recognized as USB, who later come to understand the hardware's fine (and no return would accomplish a thing).
So, back to basics: Is the cable used a known good USB cable that's already working with another USB target board?
@pine bramble the main thing that can damage electronics without a lot of evidence is static electricity (that blue spark off your fingertip when you touch the light switch screw, after scuffing your feet on the carpet).
Most other things have a cause you can identify.
If the board was ever working, and you demonstrated it personally, chances are very good it will work again.
On Linux the lsusb command is also useful for checking USB devices.
@pine bramble I don't think I did anything like that, the lights on it are working fine and nothing looks burned on it yet no ide will find it
although nightly notices when I put it in the port
okay nvm I found the issue
and its really stupid
the board turns out wasnt my arduino due
;)
lol
it was my mega 2560
but im blind
Understood.
Been there myself.
can someone tell me error in this and hwo to fix
can i send link of projet
its over the chat limit by 481
but im haveing probs with void loop
//Define a one-byte variable (8 bits) which is used to represent the selected state of 8 columm.
int cols;
//Display the static smiling pttern
for (int j = 0; j < 500; j++) { // repeat 500 times
cols = 0x01; // Assign 0x01(binary 00000001) to the variable, which represents the first colum is selected.
for (int i = 0; 1 < 8; i++) { // display 8 column data by scaning
/*matrixColsVal*/ (cols); // select this column
/*matrixRowsVal*/ (silingFace[i]);// display the data in this column
delay(1); // display them for a period of time
/*matrixRowsVal*/(0x00); // clear the data of this column
cols = 0x01 <<= 1; // shift"cols" 1 bit left to select the next column```
there error in bottom row
its for leg matrix
ping me with how to fix
here is out put
/tmp/010223862/sketch_nov30a/sketch_nov30a.ino:52:19: error: lvalue required as left operand of assignment
exit status 1```
the only red
based on the code comment, you probably want this:
cols = 0x01 <<= 1; // shift"cols" 1 bit left to select the next column
to be this:
cols <<= 1; // shift"cols" 1 bit left to select the next column
the code we rinted off shos what i put
but ill try
ok now i got now i got line 55-86 to go
cols = 0x01; // Assign binary 000000001. Means the first column is selected.``` errors:
/tmp/966660282/sketch_nov30a/sketch_nov30a.ino:57:30: error: expected ')' before ';' token
/tmp/966660282/sketch_nov30a/sketch_nov30a.ino:57:35: error: expected ';' before ')' token
/tmp/966660282/sketch_nov30a/sketch_nov30a.ino:58:14: error: expected '}' at end of input
/tmp/966660282/sketch_nov30a/sketch_nov30a.ino:58:14: error: expected '}' at end of input
exit status 1```
new prob
don't mind the } ones i got those later
You have typos
what fix
i ded
look up
at the code
i closed ()
those are the only columns that have errors
ik cause i figues out what the numbers are
afetr ino
@vital light can you attach the entire code file? ("+" button to the left of text box) Impossible to debug otherwise.
Well every box you open needs to be closed, in your sketch you use 3x {
@vital light from the code linked - just like the compiler is telling you - you have two for blocks at the end which have { with no } (lines 56 and 57)
ik
also you're missing a } for the void loop() {
im not done
OK well - it won't compile until you are.
add the missing braces if you want it to compile
yes - i see errors about missing braces
also errors about missing ; - because your last for loop is malformed
for (int k = 0; k < 10; 128; i++) { - the 128; shouldn't be there.
and i'm assuming you mean k++?
im sending pic of code on paper
hold on
i got a pic it still says arror in taht coumn
error
the picture is blurry/unreadable. you have folks here who are happy to help - but you need to do the legwork on your end too. if you can fix all the errors you know about (ie. all the missing braces/broken for loop i mentioned), and you're still seeing unexpected errors, save the entire code file with the fixes, upload it here using the "+" button, and paste the entire error you're getting. currently no one can help with the info you've given.
no. the "+" button is on discord, to upload files. first you need to save it as a file from the arduino web IDE. i've never used it but i'm guessing click the "share" button and there might be an option to download the file?
i'm not sure what to say other than to repeat what i said above. "if you can fix all the errors you know about (ie. all the missing braces/broken for loop i mentioned), and you're still seeing unexpected errors, save the entire code file with the fixes, upload it here using the + button, and paste the entire error you're getting." The same errors (missing braces, broken for loop on line 57) still exist in the file you just uploaded. You will continue to get compilation errors as long as those problems exist in your code.
Hello, does anyone know of any restrictions for the adafruit clue as to which pins a software serial port would work on
?
nvm I got it working I had to reflash my gps breakout for some reason
could of been the battery backup failed
and just coincidentally happened to be about the time a rewired it to new pins
#include <SPI. h> #include <RFID. h> //DIO:pin of card reader SDA. D9:pin of car reader RST RFID rfid(10, 9); unsigned char status; unsigned char str[MAX_LEN], //MAX_LEN is 16; size of the array void setup() { Serial.begin(9600); SPI.begin() rfid.init() //initialization Serial.printIn("plese put the card to the induction area..."); } void loop() { //search card, return card types if (rfid.findCard (PICC_REQIDL, str) == MI_OK) { }
^~~~~~~~
compilation terminated.
exit status 1```
waht does this mean in my code its saying error
#include <RFID. h>
//DIO:pin of card reader SDA. D9:pin of car reader RST
RFID rfid(10, 9);
unsigned char status;
unsigned char str[MAX_LEN], //MAX_LEN is 16; size of the array
void setup()
{
Serial.begin(9600);
SPI.begin()
rfid.init() //initialization
Serial.printIn("plese put the card to the induction area...");
} ```
this teh code
taht all i done
rn
Looks like you have a space before the ".h" in your include lines.
when i did it shows an error
I mean, take the space out.
/tmp/678739605/sketch_apr3a/sketch_apr3a.ino:2:10: fatal error: RFID.h: No such file or directory
compilation terminated.
exit status 1```
i did
and shows error
Looks like you need to install the RFID library you're using.
Are you following a tutorial?
i got the app and guess what
still same error
sketch_apr04a:2:10: fatal error: RFID.h: No such file or directory
#include <RFID.h>
^~~~~~~~
compilation terminated.
exit status 1
RFID.h: No such file or directory
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.```
thsi the app
@cedar mountain what is teh uplaod file called
and i got same error from app
I don't know what that library is, as I don't think it's a standard Arduino one. You'd need to consult whatever source you got the code from.
i gto lateest won from the gethub arduiuo website\
like here link
Arduino RFID Library for MFRC522 (SPI)
Cool, if you've installed that, you should just need to import the library in the Arduino IDE so it knows to use it.
Open-source electronic prototyping platform enabling users to create interactive electronic objects.
I am trying to use a cd4017 decade counter to drive a 8x6 button matrix on an atmega328p, while using the full 8 bit PORD as the input for the 8 pin side and the 4017 as the driver for the 6 pins side.
Since this method excludes the option of using the internal pull-up resistors I was wondering a few things.
I know I should be using pull-down resistors on the mcu side (since the 4017 will drive the line high),
but do I need to use series resistors on the inputs to PORTD, as they would be directly connected to the 4017 driving the line high? (minus a diode before each button matrix line on the 4017 side).
I'm not certain of the dc input resistance of a GPIO pin set as input without pull-up resistors,
and I am wondering If this would damage the mcu or the cd4017 without series resistors to limit current
The inputs themselves are high impedance, they won't load down the 4017. As long as the pull-down resistors are a reasonable value, they won't overload the 4017.
ok tyvm!! (=
From what I could tell they were high impedance inputs, but I am a tad rusty so I wanted to be sure.
As long as you don't configure them as outputs, you should be good.
cool ty! You're a life saver xD
i still ahve problems
Same one or different?
i have to variables
char Playing[100];
char tmpPlaying[100];
why can't i do this
if(tmpPlaying != Playing) {
// DO STUFF
}
?
@elder hare Assuming this is C, not another similar looking language, tmpPlaying and Playing are pointers to the respective arrays, not the arrays themselves. So this operation is checking to see if the two variables are pointing at the same region of memory, not whether they have equivalent contents. You probably want something like: if (memcmp(tmpPlaying,Playing,100) { //do stuff }
Ahh, right, sorry arduino group, not looking carefully where I'm posting. That answer was for C. Unless there is a similar function I'm not thinking of for Arduino, you will need to do a for loop and compare the elements one by one:
Comparing Two Arrays
strcmp should work for null-terminated strings. if you #include <ctype.h>. There's probably an include to be able to use memcmp
@safe shell Sorry, a) not on arduino and b) even in C, strcmp/strncmp will stop at the first zero it encounters, so it will not do a robust comparison of the entire array. In this context I suspect this is an array of arbitrary 8 bit values rather than a string.
True. I had edited to specify null-terminated strings. It's possible memcmp is available in Arduino, it doesn't appear to need any includes.
But yeah, standard Arduino recommendation is a loop.
In C, it does require an include, and I don't think it's part of the tiny library of Arduino functions. The link I pointed at includes an assembly code option though π
I just replaced one of my strcmp with a memcmp in Arduino and it compiles. And the <ctype.h> was for some other functions, not strcmp. I think Arduino automatically has access to some of the C libraries (at least in the ESP32 board environment I'm using).
Hello Guys
I'm new to arduino , i want to connect a ultra sonic sensor to the breadboard, but the pins are not sitting
Is the sensor on a breakout board with header pins, or what?
bread board
Ill post a picture
im trying to insert that sensor in the breadboard like in the image
but the pins are not going in
They are going in for the last two rows, but those are not supposed to be used i guess
The outer holes are connected in the other direction, so they'd just short all the pins together.
Are they misaligned, or just seem to be too big to fit?
the size is alright, but when i insert them they go in a little bit . But its like something is blocking them
the jumper wires are going in fine
but even for the jumper wires they seem tight and they are bending
I'm guessing the jumper wires are round and slightly smaller. The breadboard I'm guessing is new and probably tight in spots.
Try slight angles, or find a pin or wire similar to the pins on the breakout and see if you can get that in the holes you'll be using, to ease them just a bit. It's probably just tight.
hmm i have been trying other pins too, no luck so far
ill keep trying , thx everyone
ok its saying my labraye is invald @cedar mountain
Can you paste the error message?
Use pastebin or something, then.
It's saying that it can't find this path: C:\Users\Rebecca Dear\Documents\libraries. Does it exist with that exact name?
Hey I think I might need help with this one, just wanted to burn the bootloader to an wemos d1 mini (esp8266) But I keep getting this error message, just updated java and arduino didnΒ΄t helped.
Also the communication with the sketch on the esp does work.
java.lang.NullPointerException
at cc.arduino.packages.uploaders.SerialUploader.burnBootloader(SerialUploader.java:329)
at processing.app.Editor.lambda$handleBurnBootloader$61(Editor.java:2366)
at java.lang.Thread.run(Thread.java:748)
Error while burning bootloader.```
hmm what is the output current of an arduino uno r3 being fed off of a usb?
60ma per pin 500ma in total
wdym
hmmm
im just looking at this tutorial and it need resistors, and it doesnt state what power rating they should beo, other than being 10kiloohms
and it does seem like they're connected to the 5v and analog in pin, that goes through 3 buttons
that also are connected in between with 2 same resistors
and the place im trying to get them from have different power rated resistors
At 5V, a 10k resistor will pull 0.5mA, which is 2.5mW. You don't really need a power-rated resistor for that.
So yeah fck arduino π I just fixed it with uploading a binary with esp easy flasher π
also what kind of spec power supply i should use for an arduino uno r3?
when not having it plugged in to the computer via usb?
Depends on your load m8
But as long you power it with usb and your stuff over the 5v pins you can get away with 500ma psu
Depends on you can also use 5-17V psu on the barrel jack, but thats waste of power
k then
hmm i found a power supply that has a max output current of 1A
i assume it will forcefully push it into the arduino board even if it doesnt need the 1A
and might aswell fry it
and the output voltage is 7.5V
because i heard that arduino may output less than 5V if the input voltage is less than 7V
Generally power supplies supply a fixed voltage up to a maximum current limit. So they won't push more current than a board consumes.
Yep, that'd be fine.
Although you should also consider just using a USB power brick... may be cheaper or even already lying around your house.
eh i dont think we have a usb power brick that goes over 7V
or 5V
dont want the components im using undervolting, because from what ive heard it wont even supply the 5V if input is under 7V
USB is 5V, but that's okay... the 7V limit is only if you use the Uno's power converter, which just changes things back to 5V for the board. If you give it 5V over USB, it doesn't have to do anything.
ohhh
I'm using a HUZZAH32 is there any way to tell what is powering the device (i.e. i'd like to be able to differentiate if the device is on battery power or USB power)?
I'm able to read A13 for the battery voltage but want to be able to tell if the device is being powered by usb or battery?
I wonder what can control 2 steppers and in least one servo?
@stable solar Doesn't looks like it... no signals with that information make it to the processor. It doesn't even have the battery-charge status line hooked up.
@cedar mountain Thanks!
@stable solar On the Huzzah Feather, only battery voltage. On the Huzzah Breakout, nothing. TinyPICO does have battery voltage and charging state.
@modest meteor Maybe the Motor/Stepper/Servo shield? https://www.adafruit.com/product/1438
The library support is pretty good, making it reasonably easy to program for.
cool
Hi
Which would be the most accurate low power temp and humidity sensor available from Adafruit
can somebody help.
Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Arduino Uno"
Project1_code:14:8: error: expected constructor, destructor, or type conversion before '(' token
pinMode(12, OUTPUT);
^
Project1_code:15:1: error: expected declaration before '}' token
}
^
exit status 1
expected constructor, destructor, or type conversion before '(' token
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I get this message when i try do upload
hmm something weird is happening im using these libs
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
and on that i have set to use
#define CLK_PIN 18
#define DATA_PIN 23
#define CS_PIN 5
when i now introduce the FastLED library and try to compile it gives me a massive error log some of them are
MyParola.h:15:22: error: expected '>' before numeric constant
#define DATA_PIN 23
another one
C:\Users\Mythical Force\Documents\Arduino\libraries\FastLED/platforms/esp/32/clockless_rmt_esp32.h:176:15: note: in expansion of macro 'DATA_PIN'
template <int DATA_PIN, int T1, int T2, int T3, EOrder RGB_ORDER = RGB, int XTRA0 = 0, bool FLIP = false, int WAIT_TIME = 5>
it seems that FastLED uses that pin 23 for something or am i wrong? :S or is it that i use the word "DATA_PIN" define? :S
i need some help with my sketch
it throws this error
Arduino: 1.8.12 (Windows Store 1.8.33.0) (Windows 10), Board: "Arduino Uno"
C:\Users\User\Downloads\Project1_code\Project1_code.ino: In function 'void setup()':
Project1_code:15:6: error: redefinition of 'void setup()'
void setup() {
^~~~~
C:\Users\User\Downloads\Project1_code\Project1_code.ino:2:6: note: 'void setup()' previously defined here
void setup() {
^~~~~
C:\Users\User\Downloads\Project1_code\Project1_code.ino: In function 'void loop()':
Project1_code:21:6: error: redefinition of 'void loop()'
void loop() {
^~~~
C:\Users\User\Downloads\Project1_code\Project1_code.ino:8:6: note: 'void loop()' previously defined here
void loop() {
^~~~
exit status 1
redefinition of 'void setup()'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Hey folks! I'm using the Airlift Bitsy add-on with my ItsyBitsy M0 and Arduino. Does anyone know how to get the RGB led on the Airlift's ESP32 working? https://learn.adafruit.com/adafruit-airlift-bitsy-add-on-esp32-wifi-co-processor/pinouts#rgb-led-2-11
@fringe kayak Looks like you have some problem in a preceding line that is confusing the compiler
@elder hare that's a strange error, my guess is that both libraries are trying to #define the the same "DATA_PIN" name.
@proud gust The WiFi class has a setLEDs() method you can call that takes three parameters for the brightness of the red, green, and blue LEDs.
@north stream Thanks!
Personally, I think there should be an example that shows it
Agreed
@north stream yea it seems like it, how can i fix this?
If that's the case, you'd have to modify one of the libraries to change all the references to "DATA_PIN" to something else (like "PAROLA_DATA_PIN")
@stable solar you may be able to infer USB power just by looking at vbat. It will almost always be higher when charging than when not charging. Threshold around 4 volts somewhere
Is UART a specific protocol, or a general one? I'm seeing that it can be used to read LIN bus communication (with a voltage divider/level converter)
Just wondering if there's a way to specify the protocol that uart uses, or if it's automatic somehow?
I could buy a $30 LIN transceiver, but I only want to read it. I know it's possible if I use a software serial library. Just wondering if UART is built in and I can use that somehow?
Low cost silicon implementation based on common UART/SCI interface hardware β Almost any Microcontroller has necessary hardware on chip
Interesting
UART is an implementation of an asynchronous (the "A" in UART) serial protocol. Most UARTs can read a variety of serial protocols. However, I don't know anything about LIN. How many bits is it?
So dumb question: the feather has a 100mA/hr charger on board. Is there an easy way to bump that up at all? I have a 2200mAh battery on it and itβs taking forever to change. Could be almost 24 Hours to charge it fully
@fiery lichen Check the schematics for your board. There are probably external resistor(s) determining charge current. Conceivably you could change the resistor config with some careful board rework. But there may not be much headroom in available current, depending on the board.
The adafruit library for the fingerprint sensor isn't working it can't register this command: Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); could someone help me please
Do you get an error message?
Jes: no matching function for call to 'Adafruit_Fingerprint::Adafruit_Fingerprint(SoftwareSerial*)'
Is the library installed in your IDE, and do you have #include <Adafruit_Fingerprint.h>?
What board are you using? The software serial support isn't available on every architecture.
Jes I installed the library and it was already included in the example. I use the teensy 3.6 as board
For whatever reason the Fingerprint library only allows the software serial on AVR/ESP8266/RISC-V, not on M4. Is it possible for you to use a hardware serial port instead?
And on what boards have a hardware serial (arduino uno)
They all do, sometimes on particular pins.
So it would allsow work on the teensy 3.6, would it?
Yes, it'd just be a matter of hooking the sensor to possibly different pins than you have now. Hardware serial is the "normal" way to use serial ports, with software serial being a compromised fallback if you run out of available pins.
ok I will try
not sure best channel... if any π but anybody really well versed in USB HID? trying to attempt sending pressure tablet/pen events to Windows from Arduino powered SAMD21 board... got non-pressure to respond but soon as I tried modifying to do more like pressure I just get nothing. maybe off chance there's someone that knows it super well π
Using the screen command on Mac, how can I send a one liner serial command?
I don't want to establish a serial session
I think you may need to provide a little context. By serial, do you mean to some sort of serial port? Maybe a couple of lines about what you are actually trying to do?
You don't even need screen to squirt a command out a serial port.
Agreed, I'm not sure that's what (s)he is even trying to do... Note the same was posted to circuitpython π€·ββοΈ
I need some help I need to put the potentionometer into e10 aand d9,11
Put its 5 pins wide
Hello, I'm French so sorry for my English. For my high school project in SI, I have to program an Arduino motor, an LCD screen, and connect everything with a push button. The final goal would be that: when I press the push button, a motor starts to run for a time x (30sec surely), and that it adds "+6" to a value which is on the LCD screen. All the button and screen part is finished and works perfectly. I am now at the engine stage. My program allows me to run it, but I can't give it a limited time. Once done, I just have to connect it to the push button (on a breadboard) in order to start the engine. I use an Arduino UNO, a breadboard, a "L293D" module, and the power supply is by battery (because I don't have a power supply at home). You will find the diagram of the assembly (I have done only one side because I do not need 2 motors.
Ps: I did not follow the 1st year program because I was in SVT (change in terminal) so I do not have the basics in Arduino and I learn everything this year almost alone. Thank you very much π
int etat;
int test=0;
int ENA = 10; //vitesse moteurA
int IN1 = 11; //sens moteurA
int IN2 = 12; //sens moteurA
//moteurB
//int ENB = 5; //vitesse moteurB
//int IN3 = 2; //sens moteurB inverse
//int IN4 = 4; //sens inverse moteurB
void setup() {
Serial.begin(25);
pinMode (ENA, OUTPUT);
pinMode (IN1, OUTPUT);
pinMode (IN2, OUTPUT);
pinMode(ROUGE, OUTPUT);
pinMode(VERT, OUTPUT);
pinMode(MOTEUR, INPUT);
digitalWrite(ROUGE, HIGH);
digitalWrite(VERT, HIGH);
}
void loop () {
digitalWrite (IN1,LOW);
digitalWrite (IN2,HIGH);
//digitalWrite (IN3,HIGH);
//digitalWrite (IN4,LOW);
delay(25);
analogWrite (ENA , 255);
delay (25);
analogWrite (ENA , 0);
//delay (25);
//analogWrite (ENB , 255);
//delay(25);
//digitalWrite (INB,LOW);
//digitalWrite (IN2,HIGH);
//analogWrite (ENA, 200);
//delay(3000);
etat=digitalRead(MOTEUR);
if (etat==LOW){
digitalWrite(ROUGE, LOW);
digitalWrite(VERT, HIGH);
test=1;
temps=millis();
}
if(etat==HIGH && test==1){
digitalWrite(ROUGE, HIGH);
digitalWrite(VERT, LOW);
if(millis()-temps> 5000) {
test=0;
}
}
digitalWrite(ROUGE, HIGH);
digitalWrite(VERT, HIGH);
}
}
@fringe kayak While there are little potentiometers designed to fit in breadboards, you can use jumper wires to adapt the ones that don't fit. "Extension" style jumper wires like these https://www.adafruit.com/product/1953 make this fairly easy.
@sharp mortar It looks like you have the right idea, using millis() to figure out when to turn the motor off.
@north stream can we speak in private ?
If necessary, but then others don't get the benefit of the discussion and since I'm at work, I can get pulled away at any moment with no warning, leaving you hanging
I'm not sure. It looks like it would keep turning the motors on and off rapidly. I do not know offhand what the various combinations do, and you have three of them (possibly forward, reverse, and stop?).
I would expect the code to be something like ```c
if (etat == LOW) {
// do one thing
} else if (test == 1) {
// do another thing
} else {
// do the third thing
}
So that only one of the actions is ever selected at once
Do you think I restart all the program for it's more simple ?
I don't think that's necessary, just wrap the part where it sets both ROUGE and VERT to HIGH inside something so it only runs when the other two don't apply
and your code I put where ? The part with ROUGE, VERT, and HIGH I write "//" before ?
I didn't mean to replace your code with my code, I was just using that to illustrate the structure
The way it is now, it has two if statements, that will run chunks of code under different conditions, and one chunk of code that runs in any case.
what I can change for to include millis ?
I get this error when i try to upload my sketch. Arduino: 1.8.12
p11_CrystalBall:1:10: fatal error: DHT11.h: No such file or directory
#include <DHT11.h>
^~~~~~~~~
compilation terminated.
exit status 1
DHT11.h: No such file or directory
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
You have millis() - time > 5000 which seems like it should work
You may need parenthesis to make sure the compiler does the subtraction before the comparison like (millis() - time) > 5000
@fringe kayak You may need to install the DHT library
i have
Weird. I wonder if it's expecting a different DHT library or something
@north stream don't change with parenthesis
What happens? Does the motor turn on? Does the motor turn off?
The motor turn on every time and not for 30sec for exemple
So it turns on but it doesn't turn back off?
It looks like your first chunk of code at the beginning of loop() turns the motor on for 25ms, then lets it coast for 25ms.
And it's the only item in your code that touches the motor enable pins
Where do you define temps, and what type is it?
Hello guys, anyone can help me to connect dht11 to database to store data
Usually with an Arduino, I just write data (as CSV) to a file on an SD card. Connecting to a database would entail getting some connection to the system hosting the database, and the ability to talk to it, which could strain the capabilities of an Arduino
In other words, it's possible, but would depend a lot on your environment, and may be difficult.
I got a php file with a database (phpmyadmin) and the issue is I think in host connection
it's always gave me connection failed for some reason
Hey all so I am having an issue with my ws2811 addressable leds they are set to show red but they are doing this. They are running in parallel.
https://photos.app.goo.gl/686gG8dCg5HhkdBt5
It even happens when I remove 2 of the strips
Hi guys, I'm trying to make a function to simplify writing text on an OLED, but every time it prints my message 4 times. Here is the function, any help appreciated:
void text(int ts, int x, int y, char *finalstr){
display.setTextSize(ts);
display.setTextColor(SSD1306_WHITE);
display.setCursor(x,y);
for (int i=0;i<sizeof(finalstr);i++){
display.print(F(finalstr));
}
display.display();
}
I only called the function once in setup
hi @spice plume - I think its printing four times because it's printing the entire string each time inside that loop body - try it without the loop and instead just do display.print(F(finalstr)); once after the setCursor
the reason it prints 4 times instead of 11 times (length of "hello world") is because finalstr is a char * and so sizeof(finalstr) will give you the size of the memory address, which is 4 bytes, not the length of the string
no prob π glad it helped.
ILI9341 TFT question:
I want draw a logo on my Adafruit TFT. Is there another way to do this than using .bmps on an SD card?
Like a shape to code generator or something?
(probably a silly question, but had to give it a shot)
@jolly wolf Looks red to me, what is the problem?
@pine bramble The AdaFruit GFX library has primitives to draw shapes, lines, and so forth.
@pine bramble I uploaded a png to https://javl.github.io/image2cpp/, but It was for monochrome OLEDs
@north stream
Ah, didn't see that in the first image, I just saw a still picture of red LEDs. That does look like a signal degradation or timing issue.
Aw ok I will get a signal booster my friend already recommend that
OK I took a look at the project to see if anyone did it and I haven't seen anything so the project is a feather STM32F405 Express to a feather 3.5 touchscreen to show the feather graphics test. When I upload the code I get a white screen I could really use some help. Please anyone?
I think last we were debugging, we'd asked for a copy-paste of the serial console log, under the assumption that something was erroring out and would be producing a console print.
RIGHT! well the computer is a linux computer but "this one" is windows as for the serial print out, but the code uploaded successfully. I can maybe print what the serial console stating
looks like I may be close to figuring this out ok what I think I need is the correct pin outs for the stm32 express has anyone got those? #ifdef ARDUINO_STM32_FEATHER
#define TFT_DC PB4
#define TFT_CS PA15
#define STMPE_CS PC7
#define SD_CS PC5
#endif Something seems off about it I cannot figure it yet but I think the answer is there
If you've got the console, I believe the request in the past was to put it here, instead of DMing it to people. That way anyone who is available can look at it and you're not blocked waiting for any one person.
As for the pinouts, the schematic for the F405 express is available here: https://cdn-shop.adafruit.com/product-files/4382/4382-schematic.pdf
The pin numbers there are referencing the STM32 pin numbers, not Arduino pin numbers.
but e.g. PB4 looking at the schematic is listed as running directly to the flash chip (FLASH_MISO), which is probably not what you want.
Got it, I'm used to DM because it was usually requested. Sorry about that, and I guessed it was the pinout @lost nest. Now I gotta play the guessing game without shorting out the feather. also remember too the feather wing I'm connecting to is HX8357 this threw some confusion as well and lastly the following is the headers for the pinouts don't see anything for the stm32 express.
So it's looking like the cable select and DC are the pins I'm looking for right?
#define TFT_DC PB4
#define TFT_CS PA15
Hi there,I got a problem: I tried Arduino with my Switch lite, at first il worked perfectly, when I put it on my docking station(only for charging), il worked no more!!
But it works well at another switch....
Is it the problem of the lite?
@deft scroll Those look like the pinouts for the older WICED Feather. Looking at the Feather STM32F405 pinouts https://learn.adafruit.com/adafruit-stm32f405-feather-express/pinouts and the 3.5" TFT Featherwing pinouts https://learn.adafruit.com/adafruit-3-5-tft-featherwing/pinouts, looks like it's pin 9/PB8 and pin 10/PB9 (can be changed with jumpers). Is that your read?
Hi i have a really big concern, I dont know how to work the ESP32, i know how to run the example codes but my coding teacher wants me to do something specific and i dont know how to do it, its due monday and I am already freaking out. anyone want to help?
@tawdry merlin Best to ask specific questions. What board are you using? How far have you gotten... installed and setup Arduino IDE, communicated with the board over serial, etc.?
should i send the code here and explain what he wants me to do?
Yes, also some background needed so we know where you are at (see above). Use three backtick ` characters before and after your code to make it show up as code (see #2: https://support.discordapp.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline-) If the code is long, you can post a file.
the characters is too long, should i send it in a file instead (discord offered to send it in a file)
Yes, a file is fine.
he wants me to get wifi and bluetooth working on the builtin screen
on the ESP32
I got it only qworking on the serial monitor
What ESP32 board are you using?
What do you choose for "Board" in the Arduino IDE before you flash the code?
ah, ok, I'm not familiar with that one, but shouldn't be a problem. Good that serial is working. What screen are you using?
So what is happening when the code runs, and what is not happening that should be?
it looks like it is, but i dont know how to put it on the screen
the screen is just blank
what my goal is, to have the wifi on the screen
and the time on the serial monitor
so i am just trying to get the wifi connection screen to pop up there
this is what it looks like on the serial monitor
ill send what my teacher told me. when i showed him this
So you've got this getLocalTime function that gets the time and stores it as an object in &timeinfo. You can see it being called on line 43. Then line 47 prints out the time using the formatting inbetween those quotes. Have you read about what each of those %A, %B etc do? So those are the key lines for you. After we GET the time in that object we need to put it on the screen. But first we need to put it into a String. Something like: strftime(timeString, 128, "%r", &timeinfo); should do that for us.
Then we just need to follow the format of clearing the screen. Setting the font and alignment, calling drawstring (something like: Heltec.display->drawString(0, 10, timeString);) and then the Heltec.display->display(); to actually display it.
what micro sd card do i need to use the adafruit musik maker shield and what format should it be?
@safe shell I think so let me see
@tawdry merlin Are you using, or have you seen, these examples? https://github.com/HelTecAutomation/Heltec_ESP32/tree/master/examples
Yeah i downnloaded everythign that is needed for this board with libraries examples etc. since schools closed when we didnt expect it. We are learnign this completely new from home. I am so new to this that the code i showed u is 2 examples morphed into one in hopes it would work
@tawdry merlin One thing I see in the code is that I believe you do Heltec.begin in line 162 in a function that is never called. That's needed to initialize the OLED.
quick question, on my arduino 1.8.10, the line numbers arent there, how do i enable it so i can get to 162?
You probably want to do those initialization steps (anything that never changes for the life of your main loop() ...do those things in setup()
There's a setting for line numbers, hang on...
Arduino Preferences, there's a checkbox in the first panel (I'm on Mac, could different for you, but it should be there somewhere)
I think your code line is fine, just needs to be in a different place so it runs
it's in TimeScan() now, but that's never called afaict
most of that stuff that's in TimeScan() should be in setup()
moved the one from timescan to 162
moved everyhing inside of timescan to setup
and then deleted timescan
what else?
and btw ty for helping me so far, really appreciate it, I was on a stress attack for the last 2 hours
np, you have a good start, should be workable with some tweaks. What happens when you load and run it now?
alright uploading now
line 31: "WIFISetUp" was not declared in this scope
ill send u the updated code
should the micro sd card be in the format fat32 to use the musik maker for arduino?
ignore the */ in the beggining, I accidently copied thatwhen pasting it here
@tawdry merlin OK, you'll need to do some cleanup. Some functions are never called. You probably know this but Arduino has two special functions: setup() and loop. When the code start executing, setup runs once. Then, loop() runs repeatedly, annd does or calls whatever you tell it to inside loop(). The Heltec.begin... lines are a bit out of order, and need to be in `setup(), rather than in a function that is never called.
It might help to mentally trace through your code... start at setup() and then move to loop() and make sure things are in the order you want, and that functions you want called, are called. If it's not making sense, we'll take it a step at a time.
yeah please if u can help me one step at a time because idk which should be in setup and which it shouldnt
i know what a steup and loop is
i just dont know what needs to be repeated or just run once
Oh, the void WIFISetUp(void) should just be void WIFISetUp() so it matches what you call in setup: WIFISetUp();. I see now that it is called in setup().
alright fixed that
Same with void WIFIScan(void)
@safe shell you said something about pin jumpers what do you mean?
ok deleted that one too
now hopefully it will compile, but there may still be some out of order things. Sometimes it's helpful to run it and see what happens so you have the feedback to see what the code is doing, even if you know it's not yet right.
The Serial.prints are your best friend right now to follow along with what the code is doing
@deft scroll Nevermind that unless you want to change those pin assignments. You're plugging the display wing into the Feather, so you'll want it just the way it is.
@safe shell but won't the pin number change? rather than PB15 and PA_4
@safe shell because the wicked pin numbers don't work rather I believe there the wrong pinouts
@pine bramble From the learn page on it https://learn.adafruit.com/adafruit-music-maker-shield-vs1053-mp3-wav-wave-ogg-vorbis-player: "MicroSD card socket, for any FAT16/FAT32 formatted SD card from 64Mb or greater."
@tawdry merlin Can you attach the code again, please? Notice also that WifiLoop() is never called, so WIFIScan() will never be called.
thanks @north stream
Okay, so I'm using MIDI.h with an atmega32u4.... I have a physical serial midi jack and a usb cable. I've got both initialized, I can read the serial jack, I can send to the serial jack, I can read midi over USB, I can send the things I read from USB over to the serial jack, but I can't send out messages over USB except for somewhat random messages at random times. I've tried setting the Serial.begin to 115200 and also 31250, neither fixes....
umm let me look
@deft scroll Ignore what I said about jumpers. I believe that #ifdef ARDUINO_STM32_FEATHER is messing things up and you just want to use that default block
what line should i call it?
@tawdry merlin Depends what you want to happen. I'm not sure what order of things you want. That's why I mentioned mentally trying to trace through your setup() then loop(0 to see if it made sense to you, based on what you want to happen.
@safe shell right that's where the issue begins I changed #ifdef rather removed it and I just still get a white screen is there something missing there?
ohh ok
i misread when u wanted me ot re attach code
my dad was trying to upgrade my iphone while texting u and he kept asking me "what is this"
sorry for my slow responses
im back now
@deft scroll Seems to me if you have #define TFT_CS 9 #define TFT_DC 10 the TFT should work?
@tawdry merlin Please delete that message.txt, has info you don't want posted. The previous one too.
@tawdry merlin I don't think your latest compiles, look at line 27
OH I JUST REALIZED
sorry
took me a fat minute to figure out what information u wanted me to take it down for
i added to the lines
and it said WIFISetUp was not declared aain
again*
np, I think you have all of the pieces you need in the code, it's just a matter of stepping through it and putting things in the order you want. Plus, you probably don'w want the //disconnect WiFi as it's no longer needed WiFi.disconnect(false); WiFi.mode(WIFI_OFF); in the setup(), it will keep WiFi from working in your main loop()
OK, let me look at that compile error...