#help-with-arduino

1 messages Β· Page 53 of 1

wind drift
#

But not sure if the time will still be accurate after it went to sleep

cedar mountain
#

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.

scenic citrus
#

^ 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

lost nest
#

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

#

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.

scenic citrus
#

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.

lost nest
#

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.

cedar mountain
#

Normally the gyro is the power-hungry component. Accelerometers can be very low, since they just passively react to forces rather than actively vibrating.

lost nest
#

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

A ring laser gyroscope (RLG) consists of a ring laser having two independent counter-propagating resonant modes over the same path; the difference in the frequencies is used to detect rotation. It operates on the principle of the Sagnac effect which shifts the nulls of the int...

cedar mountain
#

Those are awesome. You can measure your latitude by picking up the rotation of the Earth at your location, they're so sensitive.

pine bramble
#

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?

north stream
#

Yes, the pin mapping (and direct port addressing) should work similarly.

pine bramble
#

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?

north stream
#

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.

pine bramble
north stream
pine bramble
#

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 πŸ™‚

pine bramble
#

Just keep the smoke in. sparky

pine bramble
#

Well, I got the LED blinking. 1% down, 99 to go πŸ˜„

indigo dome
#

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,

cedar mountain
#

It looks like the "equal to 800" condition would never be true, so the loop is skipped.

indigo dome
#

ah thanks

stark mist
#

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.

wanton forum
#

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?

odd fjord
stark mist
#

@odd fjord much appreciated

#

I hadn't found the schematic πŸ™‚

#

this makes interfacing with the pi a whole bunch easier

odd fjord
stark mist
#

thanks that is extremely useful

odd fjord
#

You’re welcome!

wanton forum
#

Still stuck

narrow thorn
#

@wanton forum what tutorial? give a link please

wanton forum
#

This one

flat imp
#

@wanton forum its at the bottom of the software page, you have to edit the binary arrays.

wanton forum
#

Huh?

north stream
#

That page describes LED matrix displays, which you can use to display custom images and animations.

flat imp
wanton forum
#

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?

north stream
#

Yes, you can modify the code to describe whatever patterns you want. The changes for more matrices aren't terribly difficult either.

wanton forum
#

It shows the binary code for the mouth, so I'm also assuming there's one for the eyes as well

north stream
#

Right, you would define bitmaps for mouth, eyes, nostrils, anything you wanted to display.

wanton forum
#

and just one Arduino can handle all that?

north stream
#

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).

wanton forum
#

oh?

north stream
#

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.

wanton forum
#

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

north stream
#

You could craft some prototype code set up for all the expected matrices and see if the IDE thinks it will fit.

wanton forum
#

IDE?

north stream
#

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.

wanton forum
#

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?

north stream
#

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.

wanton forum
#

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

north stream
#

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)

wanton forum
#

Idk, but I'm planning on building a PC anyway

north stream
#

Just figured you might want to start learning before you had that ready to go.

wanton forum
#

Ah

tawny tide
#

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.

tawny tide
#

nm like clockwork found something

#

was making it way too hard

pine bramble
#

anyone with ov7670 experience?

cedar mountain
#

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.

pine bramble
cedar mountain
#

Can you explain what looks wrong to you? It'd be easier to check a specific thing than check everything.

pine bramble
#

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

cedar mountain
#

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?

pine bramble
#

apparently they are used as pull ups, and a voltage divider.

cedar mountain
#

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.

pine bramble
#

so can I follow the first image?

#

or would it not work

#

@cedar mountain

cedar mountain
#

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.

pine bramble
#

my arduino has a pin for 3.3v and a pin for 5v

cedar mountain
#

What does that mean for its I/O voltage?

pine bramble
#

I dont know

cedar mountain
#

Multimeter time?

pine bramble
#

how do we check that?

cedar mountain
#

Set a pin high and check its voltage.

pine bramble
#

so I have to get a multimeter right

cedar mountain
#

(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?

pine bramble
#

I think I have a multimeter somewhere in my house

#

also

#

I have an arduino uno

cedar mountain
#

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.

hybrid ether
#

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?

pine bramble
#

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?

cedar mountain
#

@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.

north stream
#

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.

bronze grotto
#

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

unique crystal
#

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.

north stream
#

Usually servos are controlled with PWM outputs

unique crystal
#

Yes, I got the servos to move, but it only does so when code is uploading/the arsuino is powered on

north stream
#

Hmm, might be an enable problem or an update issue

bronze grotto
#

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

wind pond
wraith current
#

@wind pond no information about your error in the picture

wind pond
#

no why is the error box so big and how do i shrink it its anoying i cant code

wraith current
#

trying hitting ctrl+ - a few times

#

@wind pond

wind pond
#

dosent even do anything

wraith current
#

Edit menu -> decrease font size ? doe snothing ?

wind pond
#

shoud i re dounload ide for th 2 time

wraith current
#

don't know.

sharp forge
#

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.

void vortex
#

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

north stream
#

@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?

void vortex
#

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?

north stream
#

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.

void vortex
#

Ok i will see through it ,i will update if any specific problem i identify

#

Thank you

wraith current
#

@void vortex doesn't the micropython turn the device into a storage device which shows up as removeable storage on computer ?

wanton mirage
#

Seems to be built for teensy but I don't know enough about the hardware differences

cedar mountain
#

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.

wanton mirage
#

Thanks Ed

#

Trying to roll with the hardware I've got.

stark mist
#

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

stark mist
pine bramble
#

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

cedar mountain
#

Probably the actual error message is before this in the output. Does it say anything else earlier?

void vortex
#

@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

sharp forge
#

@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?)

cedar mountain
#

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.

ionic hazel
#

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?

north stream
#

@ionic hazel That's what I would try first: the header files generally contain the declarations.

ionic hazel
#

Thanks @north stream . I worked it out πŸ™‚ Someone had commented out an include that was needed

pine bramble
#

Hi any ideas on why when i type F into the serial monitor it outputs it as ASCII?

north stream
#

When you say "outputs it as ASCII", what do you mean?

pine bramble
#

google ASCII

#

American Standard Code for Information Interchange, is a character encoding standard for electronic communication

north stream
#

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.

pine bramble
#

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?

stark mist
#

you send the byte representation as F and the monitor is likely just turning that in to ascii implicitely

#

F

pine bramble
#

how do i stop that?

stark mist
#

so an F is a byte

#

when you type F internally it is stored and sent as a byte

pine bramble
#

yes

stark mist
#

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?

pine bramble
#

so what I have is whatever is inputted is saved to a char variable called state

#

it then prints state to the serial monitor

stark mist
#

okay

#

what are you using to input your bytes

#

a char is equivalent to a byte in most respects

pine bramble
#

im using the text input box on the serial monitor

stark mist
#

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?

pine bramble
#

yes

#

but instead of coming back as F

#

it comes back as the ASCII code for F

stark mist
#

what are you seeing on screen?

pine bramble
#

70

stark mist
#

oh

#

its displaying it as an int

#

or hex

#

whats the code look like that you are using for the echo?

pine bramble
#

rather strange as on my other programs with the exact same block of code to perform the same action it works fine

stark mist
#

it could just be the setting in the monitor

#

like I posted the realterm pic above

pine bramble
#
   state = Serial.read();
    Serial.print(state);
    flag = 0;```
stark mist
#

what type is state?

pine bramble
#

forgot to add char state;

#

char

stark mist
#

okay so in the monitor what settings do you have?

pine bramble
#

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

stark mist
#

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

scenic citrus
#

@stark mist use backtick (`) for inline code, and three backticks in a row for multi-line

stark mist
#

awesome thank you

scenic citrus
#

sorry, backticks on both sides

#

like `this`

stark mist
#

@scenic citrus much appreciated

pine bramble
#

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

scenic citrus
#

just tried it on an Arduino Duemilanove

pine bramble
#

oh nice, i'll give that a shot

#

thanks man!

scenic citrus
#

np πŸ™‚

north stream
pine bramble
#

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

north stream
#

I've played with H bridges (currently playing with one to drive a GTL3)

pine bramble
#

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

north stream
#

Outputs, not inputs? I would expect the motor to either free spin (high Z) or brake (low Z)

pine bramble
#

theyre dc motors

#

theyre both set to low

#

and the motor spins

#

makes absolutely no sense

north stream
#

Seems like a miswiring or a chip that doesn't work right

#

I'd get out the multimeter.

tidal vale
#

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?

wanton forum
#

@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?

tidal vale
#

@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

wanton forum
#

hm

#

how would I begin doing that?

tidal vale
#

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()

wanton forum
#

are either of those easy to use or figure out?

tidal vale
#

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.

wanton forum
#

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

tidal vale
#

Check the learn articles on those devices, there are some excellent tutorials in there.

wanton forum
#

alrighty

#

hmm. . .now I should be finding my notepad to be writing this stuff down

sharp forge
#

@north stream thanks!

bronze grotto
#

whats the cheapest arduino/adafruit/etc board that has the ability to act as a keyboard/mouse?

cedar mountain
#

That'd pretty much be anything with USB functionality, most likely.

north stream
safe shell
#

Maybe Trinket M0 or RPi Zero?

north stream
#

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.

safe shell
#

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.

wanton forum
#

Does a button have to be connected to a breadboard for it to work with an Arduino, if it's connected via wires instead?

cedar mountain
#

Wires should work fine. Nothing magic about a breadboard... it's just wires under the hood too.

wanton forum
#

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

north stream
#

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.

wanton forum
#

What would be a good example of conductive patches? And what is a Hall effect sensor?

cedar mountain
#

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.

wanton forum
#

I cannot do that, can't make a proper closed fist

#

but I'm sure there's something I could work with

cedar mountain
#

Finger-to-thumb would also work pretty well. Lots of possibilities.

wanton forum
#

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

twilit hare
#

yeah, a hall sensor might work - small magnet in the thumb, hall sensor in the inner glove (or even index finger)

wanton forum
#

can I have more then one?

twilit hare
#

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

wanton forum
#

wouldn't I need to have them on different pins anyway if I have different expressions?

twilit hare
#

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

Instructables

How To: Multiple Buttons on 1 Analog Pin - Arduino Tutorial: The Arduino uno board has 12 availabe digital I/O pins and 6 analog input pins, sometimes, on complex or 'big' projects, we run out of digital pins. In this tutorial you will learn how to use multiple buttons on one ...

#

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

wanton forum
#

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?

twilit hare
#

that's a good approach. Most of us start "small" then add on to our projects

wanton forum
#

I feel a bit better about it now

dense valve
#

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.

north stream
#

Normally Arduino code isn't uploaded in a UF2 format, it's just handed off to a bootloader that copies it into flash.

dense valve
#

Ignore that, that's not a good example.

wanton forum
#

reminds me of a Tamagotchi pet

dense valve
#

@pine bramble Thanks, I'll have a look.

frail shard
#

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!

elder hare
#

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

cedar mountain
#

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.

safe shell
#

@elder hare Do you get an error dump in the console?

elder hare
#

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

cedar mountain
#

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.

elder hare
#

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();
              }

       }
   }
cedar mountain
#

Have you tried increasing the Delay value? Maybe it's just running too often.

elder hare
#

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

cedar mountain
#

So I'm a little confused by the Run() declaration. Is this a function inside loop()?

elder hare
#

yea

cedar mountain
#

How is it being called?

elder hare
#
   void loop() {
     Animation::Run(); 
   }
cedar mountain
#

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?

elder hare
#

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

pine bramble
#

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)

cedar mountain
#

Yep, that should be fine.

whole hull
#

hi i have got a problem with the example reciver sketch for dmxSerial library the led just keeps flashing randomly

fleet ivy
#

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

elder hare
#

anyone used MD_Parola in here?

wraith current
#

@elder hare I use md parola

elder hare
#

How can i get Γ† Ø Γ… ro display 😫

wraith current
#

if not, then you can design your own characters and map to chars you don't need.

#

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.

north stream
#

Β° is 0xB0 (176) in Unicode.

tawny tide
#

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.

scenic citrus
tawny tide
#

whoa

#

very cool

heady hawk
#

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 ?

north stream
#

Are your SPI signals getting out?

heady hawk
#

unfortunately I don't have a logic analyzer

heady hawk
#

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

#

If I create my own variant.h and variant.cpp and assign the sercom2 to the default SPI it also works.

north stream
#

Sounds like you're really close.

heady hawk
#

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!

north stream
#

I'm glad you figured that one out!

heady hawk
#

thanks for the encouragements, really appreciate it

timid vine
#

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

heady hawk
#

(this one will go straight to the wounded protoypes bin)

timid vine
#

This is Arduino

heady hawk
#

oh sorry! my bad

cedar mountain
#

(Phantom's problem solved in #general-tech, since it was a desktop-side Python issue.)

fervent arrow
cedar mountain
#

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.

west stream
#

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) spinthink

cedar mountain
#

A breadboard might be what you're looking for.

north stream
west stream
#

Okay! Thank you taiko

dull schooner
#

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.

north stream
#

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.

odd fjord
#

@dull schooner are you looking at a particular board or buying the chips themselves for your own boards

dull schooner
#

@odd fjord I already purchased the HiLetgo ESP8266 esp-01 from amazon. I can share the link if that is allowed

north stream
#

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.

dull schooner
#

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

north stream
#

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.

odd fjord
#

That should be ready for Arduino.

dull schooner
#

@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

north stream
#

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.

dull schooner
#

@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

odd fjord
dull schooner
#

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

odd fjord
#

Are you planning to use the ESP8266 stand-alone or were you planning to use it to add wifi to your UNO?

north stream
#

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.

dull schooner
#

@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

odd fjord
#

no - It's just that the cable would be best for stand-alone.

dull schooner
#

ahh i see

north stream
#

If it's a 3.3V Uno, yes, however most Uno boards are 5V.

dull schooner
#

@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

north stream
#

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.

dull schooner
#

ok thank you @north stream and @odd fjord you have helped me enough to continue googling and reading. I really appreciate your guidance!

odd fjord
#

Good luck!

safe shell
tidal vale
#

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

north stream
tidal vale
#

Looks like that has the same limitation of only supporting HID, MSC, and MIDI

silk iron
#

hey guys, i cant figure out an issue in my code for LED strips if anyone doesnt mind taking a look?

north stream
#

Just put it out there, we don't know who might be able to help until we see it.

silk iron
#

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;
}
west stream
#

Is there a way to create 5V from an ESP8266? I heard that you can't use Vin pins as the voltage source πŸ€”

north stream
#

@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.

silk iron
#

@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

north stream
#

Hmm. I wonder if strip updates are affecting each other, timing wise, somehow.

scenic citrus
#

@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?

silk iron
#

@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

scenic citrus
#

@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

silk iron
#

Not yet but I will give that a shot, and see what happens. Thanks!

silk iron
#

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
  }  
stark mist
#

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

safe shell
#

@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.

stark mist
#

I'd have to check the draw versus what the clue and pi can give versus what I'm already using

safe shell
#

It wouldn't be much current... resistor values could go higher for less current (but potentially more noise)

stark mist
#

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

safe shell
#

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)?

stark mist
#

I was thinking to use the analogue pins on the clue although I haven't read up on how to do that yet

safe shell
#

Looks like plenty of analog-in capable pins on Clue, should be fine.

silk iron
#

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
  }  ```
cedar mountain
#

Possibly you'd need to change two or more pixels per cycle to go faster, if it's already updating as fast as possible.

silk iron
#

how do i know if its going as fast as possible? i cant figure out which part controls the speed

#

@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.

cedar mountain
#

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?

silk iron
#

@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++?

cedar mountain
#

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.
silk iron
#

@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)

scenic citrus
#

@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

silk iron
#

@scenic citrus wow i actually understood that, thanks for the help and reference!

scenic citrus
#

no prob πŸ™‚

lost nest
#

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

silk iron
#

@lost nest it seems to be working fine as of now but thanks for the heads up!

fair steeple
#

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.

odd fjord
#

@fair steeple If you Ground the EN pin, the Feather will be off but the battery will still charge.

proven mauve
#

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...

proven mauve
#

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.

north stream
#

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.

pine bramble
#

has anyone used Processing to communicate with their arduino projects?

#

specifically android processing apps

north stream
#

I've done it for IMU calibration, but not on Android

proven mauve
#

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.

north stream
#

Ah, that's a newer CMOS 595, it can run fine on 3V

pine bramble
#

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

north stream
deft scroll
#

<@&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?

sour tide
#

@deft scroll please only ping moderators when you have a moderation issue.

#

(aka something offensive that needs to be taken down)

deft scroll
#

ok and thanks but I cannot log in there

pine bramble
#

@north stream thanks man, sadly the issue is the phone even detecting the hc05 module in the first place

north stream
#

Could be the module isn't discoverable. Can you detect it with your laptop?

leaden walrus
#

@deft scroll do you have an account? what is happening when you try to log in?

deft scroll
#

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

leaden walrus
#

yep. that's fine. just wondering if we have an issue with the forums we need to look into.

deft scroll
#

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.

leaden walrus
#

sure no prob. you can let us know if there is an issue with the forums though.

pine bramble
#

@north stream you were correct! turns out cmode was set to 0 when it should have been 1, thanks man!

wheat kiln
#

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?

livid holly
livid holly
#

@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

lost nest
#

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?

wheat kiln
#

@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

north stream
#

What motor speeds are you trying?

livid holly
#

Oh. My mistake. They are 3.7v each then so that should be fine.

lost nest
#

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.

livid holly
#

Solved my I2C issue. See post if you want to know.

lost nest
#

Nice, glad you got it sorted

elder hare
#

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

cedar mountain
#

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?

north stream
#

It's apparently an I2C shifter too, which is non ideal for these types and speeds of signalling.

lyric steppe
#

++

#

0

pine bramble
#

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

north stream
#

"Port busy." seems fairly clear: probably some other program has the port open.

pine bramble
#

An error occurred while uploading the sketch
No device found on COM5

#

well

#

is my board toast

north stream
#

First, you need to figure out which port your device is really on (annoyingly, that can change in windows)

pine bramble
#

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

north stream
#

Does it show up with a vendor ID and product ID?

pine bramble
#

where would it show up?

#

it appears on the correct port when I check on it on nightly

north stream
#

In the USB device list

pine bramble
#

on the device manager?

north stream
#

I don't know, I don't use windows

pine bramble
#

linux?

pine bramble
#

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.

cedar mountain
#

On Linux the lsusb command is also useful for checking USB devices.

pine bramble
#

@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.

north stream
#

Been there myself.

vital light
#

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

leaden walrus
#

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
vital light
#

the code we rinted off shos what i put

#

but ill try

#

ok now i got now i got line 55-86 to go

vital light
#
  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

wet crystal
#

You have typos

vital light
#

what fix

wet crystal
#

error: expected ')' before ';' token

#

You forgot to close ()

vital light
#

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

wet crystal
#

{}

#

This also needs to be closed

vital light
#

ik

#

im not donw with void loop

scenic citrus
#

@vital light can you attach the entire code file? ("+" button to the left of text box) Impossible to debug otherwise.

wet crystal
#

Well every box you open needs to be closed, in your sketch you use 3x {

vital light
#

ye

#

i can't copy it was 481 ove rext lmit earler

#

i fixed all the way up to 54

scenic citrus
#

@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)

vital light
#

ik

scenic citrus
#

also you're missing a } for the void loop() {

vital light
#

im not done

scenic citrus
#

OK well - it won't compile until you are.

#

add the missing braces if you want it to compile

vital light
#

but i ahve an otehr error

#

look up

#

in chat

scenic citrus
#

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++?

vital light
#

im sending pic of code on paper

#

hold on

#

i got a pic it still says arror in taht coumn

#

error

scenic citrus
#

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.

vital light
#

il try whole page

#

can u read?

scenic citrus
#

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?

vital light
#

there not

#

but here

#

as far as i got

#

rn

scenic citrus
#

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.

vital light
#

befroe i srted this i nevr codeed before

#

so taht migth be the problem

stark mist
#

Hello, does anyone know of any restrictions for the adafruit clue as to which pins a software serial port would work on

#

?

stark mist
#

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

vital light
#

#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

cedar mountain
#

Looks like you have a space before the ".h" in your include lines.

vital light
#

when i did it shows an error

cedar mountain
#

I mean, take the space out.

vital light
#

/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

cedar mountain
#

Looks like you need to install the RFID library you're using.

vital light
#

hmnmm where i snaill

#

install

cedar mountain
#

Are you following a tutorial?

vital light
#

in teh book

#

taht we printed out

#

im installing the software

vital light
#

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

cedar mountain
#

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.

vital light
#

i gto lateest won from the gethub arduiuo website\

#

like here link

cedar mountain
#

Cool, if you've installed that, you should just need to import the library in the Arduino IDE so it knows to use it.

vital light
#

ikd how

#

idk

cedar mountain
delicate pecan
#

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

north stream
#

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.

delicate pecan
#

ok tyvm!! (=
From what I could tell they were high impedance inputs, but I am a tad rusty so I wanted to be sure.

north stream
#

As long as you don't configure them as outputs, you should be good.

delicate pecan
#

cool ty! You're a life saver xD

vital light
#

i still ahve problems

cedar mountain
#

Same one or different?

elder hare
#

i have to variables

char Playing[100];
char tmpPlaying[100];

why can't i do this

if(tmpPlaying != Playing) {
// DO STUFF
}

?

potent heart
#

@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:

safe shell
#

strcmp should work for null-terminated strings. if you #include <ctype.h>. There's probably an include to be able to use memcmp

potent heart
#

@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.

safe shell
#

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.

potent heart
#

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 πŸ˜ƒ

safe shell
#

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).

proven creek
#

Hello Guys

#

I'm new to arduino , i want to connect a ultra sonic sensor to the breadboard, but the pins are not sitting

north stream
#

Is the sensor on a breakout board with header pins, or what?

proven creek
#

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

cedar mountain
#

The outer holes are connected in the other direction, so they'd just short all the pins together.

proven creek
#

oh

#

Why aren't the pins going in though ?

cedar mountain
#

Are they misaligned, or just seem to be too big to fit?

proven creek
#

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

safe shell
#

I'm guessing the jumper wires are round and slightly smaller. The breadboard I'm guessing is new and probably tight in spots.

proven creek
#

yeah it is new

#

it is tight everywhere except the outer

safe shell
#

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.

proven creek
#

hmm i have been trying other pins too, no luck so far

#

ill keep trying , thx everyone

vital light
#

ok its saying my labraye is invald @cedar mountain

cedar mountain
#

Can you paste the error message?

vital light
#

ye

#

too big

cedar mountain
#

Use pastebin or something, then.

vital light
#

let em go to website

#

how i get link

#

i sent in dm

cedar mountain
#

It's saying that it can't find this path: C:\Users\Rebecca Dear\Documents\libraries. Does it exist with that exact name?

vital light
#

/how i make it find

#

i did same name but same error

#

wait

#

i give up\

wet crystal
#

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.```
native kelp
#

hmm what is the output current of an arduino uno r3 being fed off of a usb?

wet crystal
#

60ma per pin 500ma in total

native kelp
#

what about the 5V power pin?

#

its also 60ma?

wet crystal
#

Na there you can grab around 450ma

#

Depending on current use of your sketch

native kelp
#

wdym

wet crystal
#

All arduinos have a 500ma fuse

#

Your mcu and electronics also need power

native kelp
#

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

cedar mountain
#

At 5V, a 10k resistor will pull 0.5mA, which is 2.5mW. You don't really need a power-rated resistor for that.

native kelp
#

ah

#

thanks for the clarification

wet crystal
native kelp
#

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?

wet crystal
#

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

native kelp
#

what about the input voltage?

#

5v aswell?

wet crystal
#

Depends on you can also use 5-17V psu on the barrel jack, but thats waste of power

native kelp
#

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

cedar mountain
#

Generally power supplies supply a fixed voltage up to a maximum current limit. So they won't push more current than a board consumes.

native kelp
#

oh

#

so im good with using the 1A power supply

cedar mountain
#

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.

native kelp
#

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

cedar mountain
#

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.

native kelp
#

ohhh

stable solar
#

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?

modest meteor
#

I wonder what can control 2 steppers and in least one servo?

cedar mountain
#

@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.

stable solar
#

@cedar mountain Thanks!

safe shell
#

@stable solar On the Huzzah Feather, only battery voltage. On the Huzzah Breakout, nothing. TinyPICO does have battery voltage and charging state.

north stream
modest meteor
#

looking

#

not bad yeah

#

just not sure how hard it is to program it lol

north stream
#

The library support is pretty good, making it reasonably easy to program for.

modest meteor
#

cool

vocal lynx
#

Hi

#

Which would be the most accurate low power temp and humidity sensor available from Adafruit

fringe kayak
#

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

elder hare
#

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

fringe kayak
#

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.

proud gust
north stream
#

@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.

proud gust
#

@north stream Thanks!

north stream
#

Personally, I think there should be an example that shows it

proud gust
#

Agreed

elder hare
#

@north stream yea it seems like it, how can i fix this?

north stream
#

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")

wraith current
#

@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

reef pollen
#

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

north stream
#

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?

fiery lichen
#

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

safe shell
#

@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.

pine bramble
#

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

cedar mountain
#

Do you get an error message?

pine bramble
#

Jes: no matching function for call to 'Adafruit_Fingerprint::Adafruit_Fingerprint(SoftwareSerial*)'

cedar mountain
#

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.

pine bramble
#

Jes I installed the library and it was already included in the example. I use the teensy 3.6 as board

cedar mountain
#

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?

pine bramble
#

And on what boards have a hardware serial (arduino uno)

cedar mountain
#

They all do, sometimes on particular pins.

pine bramble
#

So it would allsow work on the teensy 3.6, would it?

cedar mountain
#

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.

pine bramble
#

ok I will try

ivory mural
#

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 πŸ˜„

fierce ridge
#

Using the screen command on Mac, how can I send a one liner serial command?

I don't want to establish a serial session

potent heart
#

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?

north stream
#

You don't even need screen to squirt a command out a serial port.

potent heart
#

Agreed, I'm not sure that's what (s)he is even trying to do... Note the same was posted to circuitpython πŸ€·β€β™‚οΈ

fringe kayak
#

I need some help I need to put the potentionometer into e10 aand d9,11

#

Put its 5 pins wide

sharp mortar
#

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);
}
}

north stream
#

@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.

sharp mortar
#

@north stream can we speak in private ?

north stream
#

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

sharp mortar
#

ok no problems

north stream
#

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

sharp mortar
#

Do you think I restart all the program for it's more simple ?

north stream
#

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

sharp mortar
#

and your code I put where ? The part with ROUGE, VERT, and HIGH I write "//" before ?

north stream
#

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.

sharp mortar
#

what I can change for to include millis ?

fringe kayak
#

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.

north stream
#

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

fringe kayak
#

i have

north stream
#

Weird. I wonder if it's expecting a different DHT library or something

sharp mortar
#

@north stream don't change with parenthesis

north stream
#

What happens? Does the motor turn on? Does the motor turn off?

sharp mortar
#

The motor turn on every time and not for 30sec for exemple

north stream
#

So it turns on but it doesn't turn back off?

sharp mortar
#

no

#

every time

lost nest
#

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?

wide rampart
#

Hello guys, anyone can help me to connect dht11 to database to store data

north stream
#

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.

wide rampart
#

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

jolly wolf
#

It even happens when I remove 2 of the strips

spice plume
#

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();
}

scenic citrus
#

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

spice plume
#

ok, thanks for explaining

#

that fixed it

scenic citrus
#

no prob πŸ™‚ glad it helped.

pine bramble
#

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)

north stream
#

@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.

spice plume
jolly wolf
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.

jolly wolf
#

Aw ok I will get a signal booster my friend already recommend that

deft scroll
#

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?

lost nest
#

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.

deft scroll
#

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

deft scroll
#

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

lost nest
#

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.

#

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.

deft scroll
#

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

pine bramble
#

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?

safe shell
tawdry merlin
#

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?

safe shell
#

@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.?

tawdry merlin
#

should i send the code here and explain what he wants me to do?

safe shell
tawdry merlin
#

the characters is too long, should i send it in a file instead (discord offered to send it in a file)

safe shell
#

Yes, a file is fine.

tawdry merlin
#

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

safe shell
#

What ESP32 board are you using?

tawdry merlin
#

let me check

#

wifi kit?

#

HTIT-WB32

safe shell
#

What do you choose for "Board" in the Arduino IDE before you flash the code?

tawdry merlin
#

let me look

#

Wifi Kit 32

#

heltec ESP32 Arduino

safe shell
#

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?

tawdry merlin
#

it is buitl in i can send a picture

safe shell
#

So what is happening when the code runs, and what is not happening that should be?

tawdry merlin
#

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.

pine bramble
#

what micro sd card do i need to use the adafruit musik maker shield and what format should it be?

deft scroll
#

@safe shell I think so let me see

safe shell
tawdry merlin
#

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

safe shell
#

@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.

tawdry merlin
#

quick question, on my arduino 1.8.10, the line numbers arent there, how do i enable it so i can get to 162?

safe shell
#

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...

tawdry merlin
#

waitg found it

#

it was under preference

safe shell
#

Arduino Preferences, there's a checkbox in the first panel (I'm on Mac, could different for you, but it should be there somewhere)

tawdry merlin
#

at the end of heltec.begin do i do ();

#

?

safe shell
#

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()

tawdry merlin
#

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

safe shell
#

np, you have a good start, should be workable with some tweaks. What happens when you load and run it now?

tawdry merlin
#

alright uploading now

#

line 31: "WIFISetUp" was not declared in this scope

#

ill send u the updated code

pine bramble
#

should the micro sd card be in the format fat32 to use the musik maker for arduino?

tawdry merlin
#

ignore the */ in the beggining, I accidently copied thatwhen pasting it here

safe shell
#

@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.

tawdry merlin
#

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

safe shell
#

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().

tawdry merlin
#

alright fixed that

safe shell
#

Same with void WIFIScan(void)

deft scroll
#

@safe shell you said something about pin jumpers what do you mean?

tawdry merlin
#

ok deleted that one too

safe shell
#

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

tawdry merlin
#

ok ill compile

#

WIFISetUp(); was not declared in this scope

safe shell
#

@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.

deft scroll
#

@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

north stream
safe shell
#

@tawdry merlin Can you attach the code again, please? Notice also that WifiLoop() is never called, so WIFIScan() will never be called.

pine bramble
#

thanks @north stream

proven mauve
#

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....

tawdry merlin
#

umm let me look

safe shell
#

@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

tawdry merlin
#

what line should i call it?

safe shell
#

@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.

deft scroll
#

@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?

tawdry merlin
#

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

safe shell
#

@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

tawdry merlin
#

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*

safe shell
#

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...