|
rawrr posted:Where are you located? The power bricks are easier to use since you don't need to buy separate cables and everything is in a neater package. You should be able to find 5V power bricks locally too. I found the bricks locally for about the same price as adafruit has them so that's good. How do I hook it up to the strips though? They have a round plug and from what I've seen I need to solder wires to the led strip or use some kind of connector. I've seen several local store sell Adafruit products for similar prices (but without the import tax) but I'll have a look if I can find non branded strips too.
|
# ? Oct 20, 2017 19:22 |
|
|
# ? May 29, 2024 21:47 |
|
You can snip the round plug off and solder the wires to the strip. Check polarity with a multimeter
|
# ? Oct 20, 2017 19:58 |
|
LochNessMonster posted:I found the bricks locally for about the same price as adafruit has them so that's good. How do I hook it up to the strips though? They have a round plug and from what I've seen I need to solder wires to the led strip or use some kind of connector. If you solder some wires to your LED strip you can use a barrel jack to terminals thing like this: https://smile.amazon.com/HitLights-Light-Strip-Jack-Connection/dp/B00ZGDF7AY/
|
# ? Oct 20, 2017 20:17 |
|
I'm looking to run somewhere between 100-150 neopixels off an arduino. This is going to be controlled from a game I'm coding up in python, and I basically want the LEDs to just chill in a standard sine wave pattern, and just switch colors depending on some events in the game. I assume I just need to send some serial data to my arduino and then parse it from that side, yeah? Could send it as a series of .... 12 bytes, I guess, to preserve some latency, or I could define the colors as an enumer and just send over a single byte. Is there a simpler way to do it? Also, shouldn't matter which board I use, right? I've got a couple teensy's and an Uno and a Mega sitting around, probably just gonna use the teensy and solder it to a perf board Sockser fucked around with this message at 01:41 on Oct 22, 2017 |
# ? Oct 21, 2017 20:47 |
|
Sockser posted:I'm looking to run somewhere between 100-150 neopixels off an arduino. I've run 300 neopixels with a single uno; any board will work. You need to use the fastleds library for that; you start to run out of timing to do anything else with that many pixels. Also, the strips get REALLY HOT if you just have one power connection at the end. Split the strings. If all you're doing is changing the color with serial data, then 3 bytes is plenty to send a color. But that's probably not where your bottleneck is, so sending "0xFFEE00" over serial and parsing it is likely easier to understand and code, and not where your code is going to be spending most of its time.
|
# ? Oct 22, 2017 02:29 |
|
Yeah I’ve got a strip of 144 running the code I want (mostly ripped from adafruit) and it’s been running 24/7 on my desk for a long time without any significant problems, just I’m switching the colors with a button press instead of from serial, wasn’t sure where it’d get weird And my final product is going to be something like 4 rings of 12 in series = 48 2 dense strips of about a foot each run in series = ~ 90 2 sparse strips of 3 ft each = 112 So a total of 250, I guess? And then I’m gonna have a dedicated power supply on them I could split it out into two separate arduino if it becomes too heavy for one to handle Sockser fucked around with this message at 19:52 on Oct 22, 2017 |
# ? Oct 22, 2017 19:45 |
|
What are the options if I want my thing (something with an atmega probably) to know what time and date it is, with the minimum amount of user provided interaction ? A wifi module can pull the time from the internet, but credentials will be hardcoded, and it relies on a working connection. There are circuits that receive the Frankfurt atomic clock signal (I'm in europe) but those seem like they require some processing work in case the signal isn't strong. I haven't looked at GPS modules but can those give me what I need ? I kinda want to try making a tide clock. Those exist but mine would store local forecasts instead of relying only on the moon. This would be a fixed device. Ideally it would sync to local time somehow, set a clock (there's an atmel doc on the subject), and display the time to next full tide and tidal coefficient with a stepper motor moving hands or something that isn't a screen.
|
# ? Oct 24, 2017 07:34 |
|
A GPS module will give you an accurate UTC time code. You need to handle the time zone and daylight savings. It only works reliably in places with a view to the sky and takes a few minutes to start up and get synchronized. A Wifi module or other internet connection can get an NTP time code. You need a wifi network nearby, obviously. The cheapest way is to get a battery-powered RTC module, which will run for like two years on a coin cell. You just program it once and let it go.
|
# ? Oct 24, 2017 07:54 |
|
unpacked robinhood posted:What are the options if I want my thing (something with an atmega probably) to know what time and date it is, with the minimum amount of user provided interaction ? pulsar clock
|
# ? Oct 24, 2017 11:42 |
|
The easiest and most reliable option is an RTC. With a little coin cell they can run for years and years keeping good time. Just set their time once and you're done. No messing around with parsing GPS data, waiting for signals, etc. Sure it won't work without that initial time setting, but in almost all cases it's far easier to set the time once ahead of time and just forget about it forever vs. futzing around constantly with locking on to a time signal.
|
# ? Oct 24, 2017 22:22 |
|
I have an input box on my web interface that gives me this in the serial monitor. GET /?LEDWHITE=100&submit=Send+White+LED+Level HTTP/1.1 I want to parse the number out of the string. I tried: code:
This code was lifted from an example I found online so I have no idea what I messed up. thegasman2000 fucked around with this message at 12:30 on Oct 26, 2017 |
# ? Oct 26, 2017 11:15 |
|
Thanks, I ordered one. That's cool
|
# ? Oct 26, 2017 15:51 |
|
OK So I think I am close... I have with the help of somebody on the arduino forums got this far... code:
With this code I can set the value and press submit and the URL has the correct value in it. I just want that value setting to a variable, it shouldn't be hard no?
|
# ? Oct 26, 2017 20:15 |
|
That is a mess. I'm phone posting so I can't get the sketch I based my code around for you, but check out the ESP8266WebServer library and it's example, I used it and it's a lot less messy.
Splode fucked around with this message at 20:41 on Oct 26, 2017 |
# ? Oct 26, 2017 20:33 |
|
Can I cheat? I just need to grab the 3 digits after the = and make that equal to whiteLevel if (request.startsWith("/whiteLevel=") != -1) { Serial.println("WHITE LEVEL SET "); Serial.println(whiteLevel); analogWrite(whiteLed, whiteLevel); } The URL looks like http://192.168.1.150/?LEDWHITE=100&submit=Send+White+LED+Level
|
# ? Oct 26, 2017 20:40 |
|
There's a nice way to do that, I had the user set the temperature that way, hang on... Fake edit: code:
This requires you to set up a form on your html page code:
My web page was set up in the code as a bun of strings that I could gently caress with depending on what the user did
|
# ? Oct 26, 2017 20:48 |
|
thegasman2000 posted:
I wonder how many people have this same SSID. Someone near me has it as well.
|
# ? Oct 26, 2017 21:13 |
|
'class WiFiServer' has no member named 'hasArg' :/ Never ending
|
# ? Oct 26, 2017 21:19 |
|
thegasman2000 posted:'class WiFiServer' has no member named 'hasArg' Are you using this library? https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266WebServer Use it, check out the examples
|
# ? Oct 27, 2017 07:45 |
|
Not sure what's going on here: There are two DS1307s, one with a crystal already installed I think (on the left), what's the DS pin for ? Here 's a general C question, I scrapped a bunch of tide predictions from a website, so far I formatted them in a rudimentary CSV format: code:
I'm going to want to go look up a date and read the associated time and tide values. Generally speaking, what's the cleanest/least headachy way to go about this on a limited system ? I'll probably replace the high and low fields with a numeric value at one point but that's my only idea. I plan to store those on a small SD card or any compatible medium that will support a 40kb text file.
|
# ? Oct 29, 2017 13:45 |
|
unpacked robinhood posted:Not sure what's going on here: I haven't used one of those but apparently DS is a temperature sensor output: http://www.hobbyist.co.nz/?q=real_time_clock
|
# ? Oct 29, 2017 13:50 |
|
So I've realized that shopping for wire connectors is very hard when you don't actually know the name for the various wire connectors. Unfortunately, my in person electronics shop isn't any longer, so my continuing ignorance ain't gonna work anymore. What do you actually call the following connectors so I can buy them online properly? These are the two I need right now. Basic, I know, but no idea what they are actually called and I've finally run through my supply of both. Any additional semi-common connector names would be great! only one I can ever remember is "screw terminal" and there's actually a bunch of different variants for that. And those aren't very useful for the "need to connect to actual prongs of some sort" place I'm stuck in right now. I've also got a button I need to hook up to that has prongs like: pre:| | | | |
|
# ? Oct 29, 2017 14:07 |
|
The first one is a "blade" connector, maybe a Faston? https://en.wikipedia.org/wiki/Electrical_connector#Blade_connector e: The second may be a Molex crimp housing? ynohtna fucked around with this message at 15:18 on Oct 29, 2017 |
# ? Oct 29, 2017 15:13 |
|
It's a Molex KK connector E - https://www.digikey.com/catalog/en/partgroup/kk-series/25872
|
# ? Oct 29, 2017 15:36 |
|
Yo use wago surface mount lever connectors they own hard
|
# ? Oct 29, 2017 17:24 |
|
Yes, wago 222 connecters and the like are good too but probably more expensive than molex. Common pin types you'll hit will probably be some kind of Molex (KK, Minifit, minifit jr, microfit) and JST.
|
# ? Oct 29, 2017 17:34 |
|
Micro-fit are my favorite small connector
|
# ? Oct 29, 2017 17:52 |
|
Does anyone have experience with/thoughts about the Wago 256 (cage clamp) spring connectors? How robust are they compared to the Faston blade connectors?
|
# ? Oct 29, 2017 18:19 |
|
unpacked robinhood posted:Here 's a general C question, I scrapped a bunch of tide predictions from a website, so far I formatted them in a rudimentary CSV format: How many records are there? If it can fit in ROM, I would do that, so you don't have to deal with the SD card. If you have the same amount of data for each day, looking a day up is easy. Just calculate (current day - start day) * bytes-per-record and you have an index into the table. If you are missing some days, or have different amounts of data for each, you could make an index or you could binary search the data (assuming it is sorted).
|
# ? Oct 29, 2017 18:19 |
|
40kb is too much to fit even in an Arduino's PROGMEM, as the 328 on an Uno only has 32kb of total flash. If you've got a bigger Arduino you can certainly do it. However, you can probably save a ton of space by compressing your date to a smaller format. Your plain text file currently uses 24 bytes per line of data. I suggest taking the 32-bit Unix timestamp for each entry and combining it with a single byte that concatenates high or low tide and tide strength. For instance you could use the lower seven bits to record tide strength from 0 to 128, and the upper bit for high or low. The end result of that would be 5 bites for each entry, so you'd be down to less than a quarter of your original file size. Store that in a PROGMEM array and you've still got 22 kilobytes left for your program.
|
# ? Oct 29, 2017 18:33 |
|
So I have 2 input fields on a web interface. I use String request = client.readStringUntil('\r'); to get the url from the get form and it works great until I try the second field. I am guessing the problem is that the variable request isn't being "cleared". My code looks like this:code:
|
# ? Oct 30, 2017 13:58 |
|
Sagebrush posted:I suggest taking the 32-bit Unix timestamp for each entry and combining it with a single byte that concatenates high or low tide and tide strength. For instance you could use the lower seven bits to record tide strength from 0 to 128, and the upper bit for high or low. Thanks. In C it would be two arrays of identical sizes, one with 32 bit values, the other a byte wide, accessed with the same index ? I like the idea of having an SD card in the back instead of removing the uC each year to flash fresh data, but it's really not a huge concern, and functionally makes almost no difference. taqueso posted:How many records are there? If it can fit in ROM, I would do that, so you don't have to deal with the SD card. My current file is around 1300 lines (approx. a year worth), each line is a day, a different hour and data for the same day occupies a new line. A day can have 3 or 4 records (spread over 3 or 4 lines) so I can't scroll a fixed number of lines to lookup a specific day. I can use binary search since the lines are ordered by increasing timestamps (using Sagebrush's suggestion), thanks for the idea. e: For example the atmega88 has 8kb of program memory. Assuming 5 bytes wide lines, I can store 800 lines (around 6 months of data) and still have 50% for the program, correct ? (8x8x1024)-(800x40) unpacked robinhood fucked around with this message at 09:05 on Nov 1, 2017 |
# ? Oct 30, 2017 18:49 |
|
Is there any way of running Arduino C programs locally? I'd like to build a test suite to run my functions locally instead of just sending them straight to the device without knowing their behaviors.
|
# ? Nov 3, 2017 15:39 |
|
rt4 posted:Is there any way of running Arduino C programs locally? I'd like to build a test suite to run my functions locally instead of just sending them straight to the device without knowing their behaviors. You can compile locally but Arduino applications aren’t designed to run the way a normal application does on your PC. Maybe it’s doable but I haven’t seen anything that just let’s you compile and run like a normal executable. What you can do, and what I’d suggest, is just write a library in C and import the library into your arduino sketch when you’re ready to run it. You’ll have to implement the library for each environment but you can guarantee the logic will be the same.
|
# ? Nov 3, 2017 16:37 |
|
That sounds good. What I'm trying to get is a clean separation between the code that calculates what should happen (declarative) and the code that tells the Arduino to execute it (imperative). Not too worried about testing the Arduino-specific stuff. Setting aside issues like number sizing, most functions I write that don't use Arduino-specific should compile and run equally well with gcc as they do on the device?
|
# ? Nov 3, 2017 16:58 |
|
Arduino C is regular C. (C++11, I believe). However, microcontroller code in general is often very hardware specific. Arduino does its best to abstract some of the things like GPIO and ADC reading (which require that you access specific memory registers that will differ from one chip to another) so that the same code works on a variety of different boards, but it still doesn't make sense to run code with an analogRead(12) on your PC, which doesn't have a pin 12 or an ADC connected to it. If all your code is doing is math and serial printing, or other stuff that doesn't rely on any microcontroller specific hardware features, then yeah, you could port it to run on your computer with minimal changes. To do what you're asking, you essentially need a simulator that creates a virtual AVR and simulates the code step by step.
|
# ? Nov 3, 2017 18:49 |
|
Sagebrush posted:Arduino C is regular C. (C++11, I believe). However, microcontroller code in general is often very hardware specific. Arduino does its best to abstract some of the things like GPIO and ADC reading (which require that you access specific memory registers that will differ from one chip to another) so that the same code works on a variety of different boards, but it still doesn't make sense to run code with an analogRead(12) on your PC, which doesn't have a pin 12 or an ADC connected to it. If all your code is doing is math and serial printing, or other stuff that doesn't rely on any microcontroller specific hardware features, then yeah, you could port it to run on your computer with minimal changes. you'd probably do better to just run the tests on the device
|
# ? Nov 4, 2017 01:45 |
|
I often have a second arduino that I use as a development device for stuff like that (where I need to test higher level logic or comms). It's always a good idea to just have piles of arduino compatible microcontroller boards lying around.
|
# ? Nov 4, 2017 02:37 |
rt4 posted:Is there any way of running Arduino C programs locally? I'd like to build a test suite to run my functions locally instead of just sending them straight to the device without knowing their behaviors. https://www.tinkercad.com/ tinkercad lets you simulate arduino code on its circuit playground.
|
|
# ? Nov 4, 2017 08:54 |
|
|
# ? May 29, 2024 21:47 |
|
unpacked robinhood posted:I like the idea of having an SD card in the back instead of removing the uC each year to flash fresh data, but it's really not a huge concern, and functionally makes almost no difference. Are you doing this for a US-based location? Is there a library in this collection: https://github.com/millerlp/Tide_calculator close to your site? If so, those libraries are set to make tide predictions through 2024, by just supplying a date and time.
|
# ? Nov 4, 2017 22:44 |