|
Sagebrush posted:how did you get into bitwise math without getting past use of delay()? it was essential for what i was trying to do (passing arrays around in c fucks me up) so i copied and pasted it from a website! i understand it kind of but not enough to do it myself. i intend to work it out quote:also, for tuning the whiteness of rgb leds i wrote a little processing app that sends serial commands to raise or lower the r/g/b values and then prints out the current settings. just press butan until you get the right color and then write down the values. writing processing apps is super easy but if you don't know how you could do a similar thing with, like, a button to toggle through a state machine and a potentiometer to dial up or down, or something. im all down with sending serial but recieving it i just dont even know the first thing. i have thought of this conceptually but im happy recompiling trial and wrror the thing is that the colour is also relative to what came before it. if i let it go 255 for all colours it looks green but only because its been preceded by red and the green is the last colour to clamp when i crank the gain. my system and the settings so far give a convincing set of colours kinda
|
# ? Jul 16, 2014 05:10 |
|
|
# ? Apr 27, 2024 19:29 |
|
echinopsis posted:how bad is it for me to use floats? the atmega328 microcontroller that your arduino uses can't do floating point math in hardware, there's no FPU or anything. so it has to be done in software, which means it's not only a lot slower but also requires the inclusion of a couple kilobytes worth of floating point math routines. of course, the arduino libraries use floating point in a few places so you're probably already indirectly including the FP math stuff.
|
# ? Jul 16, 2014 08:34 |
|
echinopsis posted:the thing is that the colour is also relative to what came before it. if i let it go 255 for all colours it looks green but only because its been preceded by red and the green is the last colour to clamp when i crank the gain. my system and the settings so far give a convincing set of colours kinda that's a good point I ran into the same issue with the philips Hue LED light bulb
|
# ? Jul 16, 2014 08:44 |
|
Doc Block posted:the atmega328 microcontroller that your arduino uses can't do floating point math in hardware, there's no FPU or anything. so it has to be done in software, which means it's not only a lot slower but also requires the inclusion of a couple kilobytes worth of floating point math routines. how else can I use decimal fractions? or just take the performance hit given actually how few of them need to be done overall
|
# ? Jul 16, 2014 09:52 |
|
this thing will basically have "nighttime" which is a nightlight and is very dim and sorta shadows moving effect (haven't made this yet) and the sunrise progression which will happen at a particular time. i need to work out a way to move from one to the other.. actually writing this right now I just worked it out
|
# ? Jul 16, 2014 09:54 |
|
echinopsis posted:how else can I use decimal fractions? or just take the performance hit given actually how few of them need to be done overall work with big integers and scale them afterwards eg: you need 2 decimal places in a scale of 0 to 100. well just do all your math on ints from a range of 0 to 10000 and have the rest of your code handle it accordingly
|
# ? Jul 16, 2014 16:49 |
|
that had occurred to me. if i run into performance issues i'll do that. ive fiddled it around to run without a delay so i guess i'll only run into issues if my calculations are taking longer than my millisecond interval i borrowed your code from a few pages back regarding timging and i think i understand those bitwise operators now. not enough to do it flawlessly or make sure i was using the correct end of the HEX value but i thinik i get it. its a good way to store multiple variables in one number. are they fast operations?
|
# ? Jul 16, 2014 20:36 |
|
the atmega328 also doesn't have a hardware divide unit right
|
# ? Jul 16, 2014 20:38 |
|
echinopsis posted:its a good way to store multiple variables in one number. are they fast operations? the port registers are the pro way to twiddle outputs and read inputs: http://www.arduino.cc/en/Reference/PortManipulation for a speed comparison, if you use the arduino digitalwrite() as fast as you can, you can twiddle a port on an arduino at about 15 khz. If you do it with the port registers, you can do it at over 1 MHz.
|
# ? Jul 16, 2014 20:49 |
|
box update 2: I built a bigger, stronger (and much heavier) box
|
# ? Jul 16, 2014 20:53 |
|
Jonny 290 posted:the port registers are the pro way to twiddle outputs and read inputs: i guess that means yes...
|
# ? Jul 16, 2014 21:14 |
|
Luigi Thirty posted:the atmega328 also doesn't have a hardware divide unit right hmm. that may be the case. well, you can always bit-shift and add
|
# ? Jul 16, 2014 21:37 |
|
Wild EEPROM posted:box update 2: I built a bigger, stronger (and much heavier) box i like these unexplained posts about boxes. you're just a dude who makes boxes. like that guy on youtube who just smokes pipes and wears different hats. it's just the thing you do. keep on keepin on
|
# ? Jul 16, 2014 21:38 |
|
echinopsis posted:that had occurred to me. if i run into performance issues i'll do that. ive fiddled it around to run without a delay so i guess i'll only run into issues if my calculations are taking longer than my millisecond interval since you're masking at byte boundaries, yes* comedy factors where no, it will be slow as balls: your microcontroller's architecture does not have a barrel shifter (lookin @ u msp430) -> all shifts get turned into piles of rotates. shifting by a variable? enjoy your rotates and branches! you're compiling with optimizations turned off -> byte-boundary masks will just get turned into byte reads from some larger sea of memory (in this case, a uint32 or w/e). this only happens at some optimization levels! this penalty doesn't matter much unless you also dont have a shifter in which case lmao @ you i think the atmega has a shifter so w/e although i don't think there's a defensible reason to not either do it with a 4-parameter function or with structs!
|
# ? Jul 16, 2014 22:26 |
|
also the idiomatic c foreverloop is for(; {...} not that fuckin do{...} while(2>1) poo poo you got smdh
|
# ? Jul 16, 2014 22:27 |
|
Bloody posted:also the idiomatic c foreverloop is for(; {...} not that fuckin do{...} while(2>1) poo poo you got smdh lol check disable smilies smdh
|
# ? Jul 16, 2014 22:28 |
|
Wild EEPROM posted:box update 2: I built a bigger, stronger (and much heavier) box where the gently caress did you get pieces of plywood that big that aren't warped to hell? also, i don't think i would be good at making wooden boxes since i can't seem to ever cut a perfect 90 degree angle, no matter how much effort i put into it.
|
# ? Jul 16, 2014 22:33 |
|
syscall girl posted:lol check disable smilies smdh same
|
# ? Jul 16, 2014 23:02 |
|
i made an fm antenna today there really is gently caress all to listen to but its still pulling from a station about 80 miles away so im impressed. it's just two dowels with a single 22 awg conductor running arounc the periphery and attached to a balun. its really simple compared to what yall are doin but im kinda proud of it nonetheless
|
# ? Jul 16, 2014 23:08 |
|
Bloody posted:also the idiomatic c foreverloop is for(; {...} not that fuckin do{...} while(2>1) poo poo you got smdh hahaha ok. especially given I'm doing it in the main loop designed to be executed over and over for infinity still it's a great example of my inguinuoty
|
# ? Jul 16, 2014 23:33 |
|
I like while (1) {...} better
|
# ? Jul 16, 2014 23:46 |
|
echinopsis posted:koiwoi unguinuoity
|
# ? Jul 17, 2014 00:08 |
|
Symbolic Butt posted:I like while (1) {...} better me too. it's the pro way
|
# ? Jul 17, 2014 00:29 |
|
Bloody posted:since you're masking at byte boundaries, yes* i hate the msp430 so much why can't anyone else make mcus with fram
|
# ? Jul 17, 2014 00:43 |
|
i don't think microcontrollers have needed oil filters since 1920 tim
|
# ? Jul 17, 2014 00:51 |
|
movax posted:i hate the msp430 so much weren't there fram pics?
|
# ? Jul 17, 2014 01:39 |
|
i have a number of msp430s because several years ago ti was giving away those launchpad boards for $4.30 and they each came with a couple of spare chips and i was like "drat! this is so much cheaper than an arduino, or even a discrete mega328!" so i bought a couple planning to use them for small projects. then i discovered the attiny.
|
# ? Jul 17, 2014 02:14 |
|
https://www.adafruit.com/products/1655 the individual neopixels, not mounted to anything. are they surface mounted? is that something easy to achieve wth amateur skills
|
# ? Jul 17, 2014 04:44 |
|
echinopsis posted:https://www.adafruit.com/products/1655 they are, and you probably do not want to have to try and solder those. they are tiny tiny
|
# ? Jul 17, 2014 05:30 |
|
if you have a 5050 breakout board you can solder them on without too much trouble but then you might as well just buy the premounted ones they sell dig around on the side -- for about twice the price of the individual chips they sell the neopixels potted in epoxy in a standard 5mm led housing w/ 4 wires. those are easy to work with
|
# ? Jul 17, 2014 05:35 |
|
echinopsis posted:https://www.adafruit.com/products/1655 also desoldering might require a heat gun which might destroy them
|
# ? Jul 17, 2014 05:39 |
|
there's hot air rework tools specifically made for soldering/desoldering surface mount that are sort of "precision heat guns". if you're going to invest money in doing surface mount stuff.
|
# ? Jul 17, 2014 05:42 |
|
Base Emitter posted:weren't there fram pics? i would be the happiest man alive if fram pics or fram arms existed
|
# ? Jul 17, 2014 06:45 |
|
Doc Block posted:where the gently caress did you get pieces of plywood that big that aren't warped to hell? The plywood I used was warped to hell, probably a good inch off from the edges to the middle, I just nailed and glued it in such a way that every piece holds every other piece straight. I can't cut perfect 90 degree angles either, most people can't. What you want to do is get a table saw with a good fence.
|
# ? Jul 17, 2014 07:30 |
|
code:
|
# ? Jul 17, 2014 10:03 |
|
make sure all of those variables are the same type for an arduino i think they should all be unsigned long i have made that mistake before.
|
# ? Jul 17, 2014 16:00 |
|
movax posted:i hate the msp430 so much why do you need fram
|
# ? Jul 17, 2014 16:17 |
|
Bloody posted:why do you need fram fram's more resilient for certain environments
|
# ? Jul 17, 2014 19:07 |
|
got the measurements of my 7-segment wrong, wasted $35 on 3 boards that won't work
|
# ? Jul 17, 2014 19:23 |
|
|
# ? Apr 27, 2024 19:29 |
|
movax posted:fram's more resilient for certain environments what like rad-hard or high-temp or?
|
# ? Jul 17, 2014 21:46 |