|
Did you test it first using a breadboard before making the PCB?
|
# ? Jan 1, 2021 00:14 |
|
|
# ? May 29, 2024 22:23 |
|
Cojawfee posted:Did you test it first using a breadboard before making the PCB? I did, I have the entire setup including the matrix on separate protoboards and it all worked fine, so I’m thinking I’ve had a manufacturing error (unlikely) or something else has gone wrong. I guess I’ll set that all up again tomorrow and see what happens. Nothing more to be added for now really. Edit: this, perhaps? The 1M resistor across the crystal was a late addition. https://www.avrfreaks.net/forum/atmega328p-1m-resistor-crystal thehustler fucked around with this message at 02:00 on Jan 1, 2021 |
# ? Jan 1, 2021 00:20 |
|
-nvm
|
# ? Jan 1, 2021 06:39 |
|
I was wondering about the resistor because I don't have one for my mcu.
|
# ? Jan 1, 2021 07:42 |
|
Get out the scope and start probing. Clock signals, pull ups/downs, comms busses, etc are likely candidates.
|
# ? Jan 1, 2021 17:25 |
|
Resistor removal hasn’t helped so it’s over to the prototype and see if I’ve introduced a bug into the code somehow or if the chip isn’t booting.
|
# ? Jan 1, 2021 17:43 |
|
It's my code I changed a bit to optimise for space a while back and I think I broke it then. I just turned up the delay in my multiplexing loop and now I can see the flicker. It isn't lighting the lights I want, again because of the change I've made I think, but at least that's SOMETHING. Christ, how loving embarassing. On the plus side, my PCBs work! Edit: and now all fixed https://youtu.be/m030u5mOa08 thehustler fucked around with this message at 01:04 on Jan 2, 2021 |
# ? Jan 1, 2021 19:45 |
|
thehustler posted:Christ, how loving embarassing. On the plus side, my PCBs work!
|
# ? Jan 3, 2021 00:42 |
|
Surprised this thread is so low traffic, but a quick question: Everyone seems to use the SPI pins for shift registers. Do I have to? Can I use other digital pins? I have an SPI device I want to use as well.
|
# ? Feb 28, 2021 22:41 |
|
thehustler posted:Surprised this thread is so low traffic, but a quick question: I assume they use the SPI pins because it's fast and really easy to just call up the SPI function rather than bitbanging their own implementation. A shift register is just an input and a clock, so you can do it with any of the GPIO pins, you'll just have to manually do the clock signal.
|
# ? Feb 28, 2021 23:05 |
|
Cojawfee posted:I assume they use the SPI pins because it's fast and really easy to just call up the SPI function rather than bitbanging their own implementation. A shift register is just an input and a clock, so you can do it with any of the GPIO pins, you'll just have to manually do the clock signal. Thanks. I'll be using the 74HC595 but to be honest I'll probably grab a library. Which means I should probably have a look at that code to see how they're doing it under the hood. Or I could test it, and if it all works pay no attention to it. That's always the more fun way. Trying to make a studio clock knock-off with 60 LEDs and a MAX7219 7 segment display in the middle, with an RTC hanging off via i2c as well, so it's getting a bit busy. Edit: One of these
|
# ? Feb 28, 2021 23:11 |
|
thehustler posted:Thanks. I'll be using the 74HC595 but to be honest I'll probably grab a library. Which means I should probably have a look at that code to see how they're doing it under the hood. It's like, 15 lines of code to bitbang the data/clock/latch lol If it "just works", which it might, depending on the microcontroller you're using, do that. But otherwise, just write the thing. It'll be slower than SPI, but easy to do.
|
# ? Feb 28, 2021 23:26 |
|
ante posted:It's like, 15 lines of code to bitbang the data/clock/latch lol You’re right, they’re all very simple implementations. Ok, will go that route then. I am excited about this, time to get some parts and get it breadboarded: https://www.dropbox.com/s/0zp0g8fnsibtcwy/Studio%20Clock.pdf?dl=0
|
# ? Mar 1, 2021 13:04 |
|
I've got a little programming brain puzzle that I'm stuck on and I'm wondering if I can get some help. The big picture: I have a display - a SSD1331 - being run by a Teensy 3.5. I've started using this library - SSD_13XX - and I've got things up and running for the most part. I've been able to get custom fonts working with LCD Image Converter, which can take font files or image files and turn them into a usable .c file, provided I use the template files provided with the SSD_13XX library to ensure they're formatted as expected. I need to be able to display numbers - let's say between 30 and 0 - on the TFT, but I need them to do two things - first, they need to visually glow, which means a bit of a halo effect around the numbers. Second, they need to be able to shift from blue to red as they count down to zero. When I talk about 'glow', this bitmap is an illustration of what I'm after: I can get tft.print(number) to show the numbers just fine with a font or whatever, and I can change the colors from blue to red that way without a problem as it counts down, but the output is monochrome - the pixels are either on or off. This is an example of the output if I use a font and the tft.print method: This works pretty well for what I need except I can't really get a glow effect on it. The best I can figure is that if I want to get that effect, I probably want the numbers to be bitmaps instead, since I can just have the glow as part of the image? If I take that example image above and run it through LCD Image Converter and get a .c file as output that works, and displays in color. code:
Is there a smarter way to accomplish what I'm after with this, or is it one of those things where I should just accept it as what it is and move on? I was wondering if there's a good way to take the drawImage function from the library I'm using and somehow make it take a color argument to tint things, but I haven't the first clue where I'd start with that.
|
# ? Mar 14, 2021 02:17 |
|
Do arithmetic to the entire array, like if you wanna make it redder just add 0b0100000000000000 to every pixel value, except black if you wanna get fancy with it
|
# ? Mar 14, 2021 03:24 |
|
Yeah, store the numbers and glow as a greyscale image. Then you can go through pixel by pixel and set it to be whatever color you want. I don't know how quickly a teensy can do that though.
|
# ? Mar 14, 2021 03:38 |
|
shame on an IGA posted:Do arithmetic to the entire array, like if you wanna make it redder just add 0b0100000000000000 to every pixel value, except black if you wanna get fancy with it Can you maybe expand on this a bit? Tbh I don't understand much about the actual 0x pixel values - when I've been calculating my lithe colors I've been doing it with functions that take RGB565 and spit out a red, green, and blue integer that I can do math I understand with.
|
# ? Mar 14, 2021 04:27 |
|
Harvey Baldman posted:Can you maybe expand on this a bit? Tbh I don't understand much about the actual 0x pixel values - when I've been calculating my lithe colors I've been doing it with functions that take RGB565 and spit out a red, green, and blue integer that I can do math I understand with. Each digit in the 0x0000 number is a hex number, which is 4 bits, and the whole thing is 16 bits. The first 5 bits are the red value, the middle 6 bits are the green value, and the last 5 bits are the blue values. You can extract these values by using bit masks and shifting to the right. So if you wanted the red value, you could take a random one from the list like 0x08c3, and then you would do a bitwise and with 0xF800, and then shift it 11 bits to the right and that gives you the 5 bit red value.
|
# ? Mar 14, 2021 04:40 |
|
Are you positive that's not an ssd1306 blue oled display? I don't think they have a brightness adjust at the pixel level
|
# ? Mar 14, 2021 06:35 |
|
I bet you could get that glow effect practically by placing a piece of glass or clear plastic over the display with a small gap in between them.
|
# ? Mar 14, 2021 07:05 |
|
Hadlock posted:Are you positive that's not an ssd1306 blue oled display? I don't think they have a brightness adjust at the pixel level I thought that too, but seems to be this: https://www.adafruit.com/product/684
|
# ? Mar 14, 2021 07:12 |
|
Bucnasti posted:I bet you could get that glow effect practically by placing a piece of glass or clear plastic over the display with a small gap in between them. This is a smart idea, but I also need the rest of the stuff on the screen to be legible aside from the numbers. ante posted:I thought that too, but seems to be this: That's right - I should have linked the product, not the datasheet, my bad.
|
# ? Mar 14, 2021 20:01 |
|
Here's a question - is it possible to set an arduino [Teensy 3.2, in my case] device up such that it runs a sketch, but when plugged into a PC would show as a USB drive with a .txt file on it? I've got a project that I need to send off to someone, and I was just imagining that I'd love to store some variables (timers, settings, that kind of thing) in a .txt file on the device that they could tweak or edit without having to re-upload a modified sketch. I'm not really sure where to even start searching for this kind of thing.
|
# ? Apr 13, 2021 22:28 |
|
I think I saw something like this for esp32 once. e: Many micropython boards operate this way as default: http://docs.micropython.org/en/latest/pyboard/tutorial/script.html?highlight=python VictualSquid fucked around with this message at 10:26 on Apr 14, 2021 |
# ? Apr 14, 2021 10:18 |
|
Here’s an odd one. My rotary encoder routines work fine if I put them together in one huge poll_encoder() function. I got the bulk of them from here: https://www.allaboutcircuits.com/projects/how-to-use-a-rotary-encoder-in-a-mcu-based-project/ But if I move the “actions for after the direction has been determined” functions to a separate function determine_rotary_action() with a couple of state variables for left and right and call it after checking the direction, the timing all goes to cock and the wrong sequences are read and the direction isn’t read properly. In fact it reads only in one direction. Is this timing-related? If I sorta hold the encoder between ten notches a bit sometimes I can get it to reverse direction for a bit until it randomly decides to only go in the other direction again. You’ll see how I’m utilising this all in poll_encoder() to figure out whether we’re in a menu or not: https://gist.github.com/mpentler/f31f07155830d65a44302936764a82a2 Any ideas? It’s fine, I can cope with it, but I feel I should separate the reading from the actioning. Edit: I don’t see how it’s timing as it’s technically running less code if I just have it set the left or right to true. Maybe TOO fast? I’m baffled but it’s working with it moved so this is more for interesting discussion. thehustler fucked around with this message at 18:07 on Apr 14, 2021 |
# ? Apr 14, 2021 17:35 |
|
You got a debounce in there?
|
# ? Apr 14, 2021 18:14 |
|
ante posted:You got a debounce in there? Not yet, so far I’ve gotten away without one. I’m basically done with that encoder functionality though so I’m tempted to leave it. Got a delay when I redraw screen sometimes which seems to be enough. It’s basically perfect if it’s all in the one function - very, very few slips or not-counted turns. Edit: I have little menus now! And rotary encoders are really cool https://twitter.com/markpentler/status/1382383543230328836?s=21 Edit 2: can’t even find the version that didn’t work now so never mind, the chunk of code stays where it is! thehustler fucked around with this message at 19:53 on Apr 14, 2021 |
# ? Apr 14, 2021 18:29 |
|
Noice Ive thought about using an encoder/clicker/screen setup for my custom controllers at work but then I’d have to write all the menu system bullshit and variable storage and no two controllers are quite the same and aghhhh gently caress that it only ever gonna get set once and then forgotten Throw a couple pots on and and forget about it
|
# ? Apr 26, 2021 01:09 |
|
Hey dudes. I made a conductivity module that communicates over UART. I've got it tested and working on Raspberry Pi, and am trying to make it work on Arduino. I'm running into an issue where I believe the Serial Monitor is interfering with the UART lines, as it appears they're connected. ("On Uno, Nano, Mini, and Mega, pins 0 and 1 are used for communication with the computer. Connecting anything to these pins can interfere with that communication, including causing failed uploads to the board.". How can I test and debug this module? My C/++ isn't great, so it's possible there are bugs in the code, but I'm not sure how to test and troubleshoot. Currently, I'm getting a mix of sync errors, and no response on the terminal, and missing response or bogus chars on the Serial Monitor. Thank you. Ideally future iterations will be I2C, but I'm not sure how to make an I2C slave device at this time Example code: Lib: C++ code:
C++ code:
Dominoes fucked around with this message at 18:37 on May 3, 2021 |
# ? May 3, 2021 15:36 |
|
Dominoes posted:("On Uno, Nano, Mini, and Mega, pins 0 and 1 are used for communication with the computer. Connecting anything to these pins can interfere with that communication, including causing failed uploads to the board.". What specific arduino board? Connect your module to Serial1 if it's available, or SoftwareSerial if not. SoftwareSerial works pretty OK for lightly-to-moderately loaded ATMEGA328p boards up to 9600 baud. You can't do full duplex serial comms with multiple transcievers on the same wire pair unless all senders know everything. This is historically what DTR/CTS and the other lines in a serial cable are for. This is almost certainly not what you want to try to implement here for testing. If your sensor requires some input before it gives output, there's no real way to do this cleanly with only one UART/serial pair. If your sensor does NOT require input before giving output, then you can have as many "readers" on one serial line as the device's output fanout allows, but you can't have more than one writer on any line. That is to say, coming out of a device's TX line, you can have as many RX lines connected as the TX can drive. However, there can only be one TX per physical wire.
|
# ? May 3, 2021 16:15 |
|
Thank you. I'm testing using an Uno, but I'd like it to work on any Arduino. It requires input before getting output: I have a simple serial protocol set up where you send an 11-bit message to the sensor; the first 2, and last 1 bit are fixed start and stop bits. The 3rd bit is the type of message to send, and the remaining ones are data as required. So to get a reading, change a setting etc, you have to send a message from the host; then you read the response, which may be "OK, setting change worked", or a reading, encoded as a success bit + 2 u8s encoding a u16 of the reading. It sounds like I need to wire a display etc to the Arduino to test. I think those error prints in the above code are also inappropriate. Dominoes fucked around with this message at 16:51 on May 3, 2021 |
# ? May 3, 2021 16:47 |
Hi, I've got some really really basic questions about arduinos, not sure where to begin. May I please start with Is the Feather the sort of current iteration of the arduino? Or is it entirely different? Is it ready for prime time? I came across the feather because I just discovered adafruit, I know little to nothing about them except they look like a potential path to my goal of developing and playing with accelerometers as MIDI input controllers. Is this a fairly straightforward goal? Being a cut n paste script kid, will I have a terrible time setting up the scripts, or is there code out there RN I can use straight out of the box?
|
|
# ? May 5, 2021 16:54 |
|
I think feather is Adafruit's own thing. It looks like they have boards with a bunch of different micro controllers. Arduino usually refers to a board with an Atmel micro controller. Usually some form of ATmega328 or 2560.
|
# ? May 5, 2021 17:16 |
|
petit choux posted:Hi, I've got some really really basic questions about arduinos, not sure where to begin. May I please start with The Feather is Adafruit's answer to the Arduino problem: Does Thing X that says "arduino" on it work with this board? With Feather, they've made as sure as they can that all their boards are cross-compatible with all their peripherals. So if you've got a MIDI peripheral and decide to add a bunch of LEDs, it'll work. If you decide to add more LEDs and find out you don't have enough processor/memory to run everything, then you can upgrade the base board to something with more horsepower and it'll Just Work. The goal is to have the same CircuitPython code be absolutely identical across all their mainboard chipsets; they're not quite there yet, but it's close. Feather + MIDI + accelerometer + copy/paste code is right up Feather's alley, and the Adafruit forums are pretty decent. I helped someone with a Feather project and they didn't actually need all that much help; I've never used them myself, but not having to hand-hold a relative beginner spoke volumes for the platform.
|
# ? May 5, 2021 17:23 |
|
Dominoes posted:Thank you. I'm testing using an Uno, but I'd like it to work on any Arduino. It requires input before getting output: I have a simple serial protocol set up where you send an 11-bit message to the sensor; the first 2, and last 1 bit are fixed start and stop bits. The 3rd bit is the type of message to send, and the remaining ones are data as required. So to get a reading, change a setting etc, you have to send a message from the host; then you read the response, which may be "OK, setting change worked", or a reading, encoded as a success bit + 2 u8s encoding a u16 of the reading. If you have an offboard usb <-> serial, then connect to your board with that and use Serial to your sensor for everything. If not, I recommend rolling something where you use softwareserial if your board doesn't have a serial1. Connect your sensor up to Serial1 and talk with it that way and keep serial free for debugging.
|
# ? May 5, 2021 17:33 |
babyeatingpsychopath posted:The Feather is Adafruit's answer to the Arduino problem: Does Thing X that says "arduino" on it work with this board? With Feather, they've made as sure as they can that all their boards are cross-compatible with all their peripherals. So if you've got a MIDI peripheral and decide to add a bunch of LEDs, it'll work. If you decide to add more LEDs and find out you don't have enough processor/memory to run everything, then you can upgrade the base board to something with more horsepower and it'll Just Work. The goal is to have the same CircuitPython code be absolutely identical across all their mainboard chipsets; they're not quite there yet, but it's close. Wow, this is great news. I'm currently gathering together all the hardware for a similar project with a dedicated device, a Doepfer Wheel, to work in this capacity, it might be great to do it with a feather and see how they compare. I'd like to maybe run a parts list for a feather project past this thread and see if I am doing it right. Lady Ada keeps her chips nice and cheap. Some of that stuff is amazing.
|
|
# ? May 5, 2021 18:15 |
|
petit choux posted:Lady Ada keeps her chips nice and cheap. oh boy wait until you discover aliexpress (Adafruit is absolutely the right choice if you're a total beginner, though, because their stuff comes with extensive documentation and support and is pretty certain to work correctly out of the box. Aliexpress is the wild east)
|
# ? May 5, 2021 22:56 |
|
Sagebrush posted:Aliexpress is the wild east This is perfect.
|
# ? May 6, 2021 01:21 |
|
Ok so here's a dumb question: I need to smooth out some fluctuations I'm getting on an analog input (just a dumb potentiometer). The pot controls a number that is spit out to an LED matrix display, and when I'm on the edge between two of the mapped values, it rapidly fluctuates between them. I'm a bit OK if it flips back and forth a little (say every second or two) but I also need it to stay responsive for when the slider is moved. I know that probably my best bet is to do a rolling average: basically, store an array of values and average them, then use that for the actual reading. What I'm not sure of is where exactly I should apply that averaging. I'm mapping that analog input from the default 0-1023 to a value between 5 and 50. Is it better to average the pre-mapped raw values, or apply the averaging post-map? Does it even matter?
|
# ? Jul 7, 2021 23:09 |
|
|
# ? May 29, 2024 22:23 |
|
Post your analog jitter control function here when you find out a good solution I think mine was to just use a 1024 and then expose 256 fidelity to the end user, and ignore any input that was ~+/-7 away from the previous known value. This was for a crude flight simulator that nobody else used, though I doubt the human eye could notice that kind of difference, but it might show up on camera as a flicker
|
# ? Jul 8, 2021 01:01 |