[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself

Search:


View post   

>> No.2806543 [View]
File: 42 KB, 960x960, media_F9a1YYDXQAA4h5k.jpg [View same] [iqdb] [saucenao] [google]
2806543

>>2806539
Ok anon. I didn't really get it. but thanks for your effort anyways.
I asked chatgpt where I learned about bitshifting. I feel retarded for having everything spoonfed but I guess I also learned something new:
https://pst.moe/paste/gyenln

>> No.2806542 [View]

>>2806521
The DJI system doesn’t have standalone receivers. You have to buy goggles that support the transmitter (‘air unit’) you are using.

With analog everything is compatible with everything.

>> No.2806541 [View]

>>2806539
>>2806527
also i misread your entire question but i think it's not entirely out of place

>> No.2806540 [View]

>>2806538
like wire colors.
lets say you have a old cable with 3x black and 1 green/yellow. eg 3 phases and 1 COMBINED Earth/Neutral.
but you do not need 3 Phases so i would be comfortable to use 2 black as L1 and L2 and the 3 black as Neutral and the Green/yellow as earth. and a GFCI in fron of it.

This would be not to code because N has to be blue on the whole lengt. but it would be much much saver than having a combined Earth/Neutral and no GFCI.

>> No.2806539 [View]

>>2806527
Instead of
>byte shiftLED1 = 1;
>byte shiftLED2 = 2;
>byte shiftLED3 = 4;
it's more common to see
>byte shiftLED1 = 1<<0;
>byte shiftLED2 = 1<<1;
>byte shiftLED3 = 1<<2;
Of course, you should call them LED0-LED7, not LED1-LED8, for more clarity. I'd also use the term "bitmask" (or "bm") instead of "shift" when labelling these variables.

But better than that is to use the bitmasks that come along with the register data in the header files that the compiler uses. I don't actually know where to get human-readable names for these bitmasks, I see them in tutorials and code that MPlab wizards create for people, and in examples in datasheets, but nowhere in whole. They make more sense with status registers, here's an example:
>/* Write logical one to WDCE and WDE */
>WDTCR |= (1<<WDCE) | (1<<WDE);
Where WDCE is bit 4 of the Watchdog Timer Control Register WDTCR, and WDCE stands for Watchdog Change Enable. The actual constant WDCE is just "4", it's intended to be used to bitshift for bitwise boolean setting or unsetting of bits. For I/O ports specifically, here's another example:
>/* Define pull-ups and set outputs high */
>PORTB = (1<<PB7)|(1<<PB6)|(1<<PB1)|(1<<PB0);
>/* Define directions for port pins */
>DDRB = (1<<DDB3)|(1<<DDB2)|(1<<DDB1)|(1<<DDB0);
Here, writing "PB7" is the same as writing "7", but it's more clear.

The arduino IDE uses something similar but more removed from the user and less flexible, it uses a selection of functions to calculate which bitmask of which port a given "i/o pin number" is, e.g. arduino pin 12 = port B, bitmask 0b00000001. It's fine for static use cases as it all gets precalculated at compile time, but if you're trying to iterate through several pins it becomes extra bloat. See:
https://forum.arduino.cc/t/get-portx-from-arduino-style-pin-number/469729/8
If you want to optimise code portability (e.g. in a Marlin compiler) then using this sort of function may well be desirable. I don't know how to use it properly.

>> No.2806538 [View]

>>2806268
a little interesting note:
here in Germany the VDE code is not a Law.
The actual law just says things like "you need to follow the state of the art way of wiring"

the easy thing is now to just follow the code and call it a day. because Code = made by 100s engineers = state of the art.

but you don't have to, as long as its a save installation no inspector could come over and fail the house or smth like you Americans always complain. in fact no inspector will come to residential houses.
on a commercial job site the contract will probably say "has to follow VDE" and they will hire their own in surveyor.


the problems start if someone dies or starts a fire then you can now hire engineers that need to prove your insurance the way you installed something was equally good as the code and the fire would also have happened with the code.
if you just fucked up and made a installed something faulty code wouldn't helped you either

>> No.2806537 [View]

>>2800221
IT WAS YOU you were the guy that picked up my old wheelbarrow when I dumped it on the side of the road at 11pm. Thanks fren.

>> No.2806536 [View]

>>2806527
you need a "shadow register"
add a variable to keep the state of all your LEDs, turn bits off and on in that, then send it out to the shift register

>> No.2806535 [View]

>>2800360
I agree that's actually worse than drinking and driving

At least with 5 beers you're not falling asleep

Sleepy driving is definitely more dangerous

>> No.2806534 [View]

>>2805941
i would have such a hard time not rolling a bowling ball down it.

>> No.2806533 [View]
File: 553 KB, 2084x4624, 20240531_125824.jpg [View same] [iqdb] [saucenao] [google]
2806533

i think my vtx is dead.
no lights no heat no nothing, it worked just fine the first time.
any any ideas as to what went wrong?

>> No.2806532 [View]
File: 178 KB, 643x792, 87D54A48-4217-49B1-B3E9-4C235A61E2DF.jpg [View same] [iqdb] [saucenao] [google]
2806532

>>2806349
> sawzall
> make table and desk
I think most fine furniture is made from old, rotting, fence grade, pressure treated softwood lumber. The really good stuff has fine cuts from the sawzall—the choice of only the finest craftsman. Not those rougher cuts from a chainsaw that sam maloof used. Of course, the best of the best, build it right where the tree stands. Like Ikea.

>> No.2806531 [View]
File: 27 KB, 840x416, Bildschirmfoto_2024-05-31_11-48-45.jpg [View same] [iqdb] [saucenao] [google]
2806531

how would I even iterate a for loop this way?
im brain ded

>> No.2806530 [View]
File: 27 KB, 840x416, Bildschirmfoto_2024-05-31_11-48-45.jpg [View same] [iqdb] [saucenao] [google]
2806530

aah how would I even iterate a for loop this way?
im brain ded

>> No.2806529 [View]

>>2806523
I assume, but don’t know for sure, that the entire current from a dewalt pack is available from its terminals. As you are probably aware, the cell arrangement is the same as the ryobi 18 V.
So, you could probably wire it directly.
As far as I know the cell protections are in the packs themselves.

Now you can use all your corded tools, too, when you need to cut down a fence 100 feet away from an outlet, or sawzalling a bunch of stuff in a prison-cell-like storage unit where they won’t let you cook your own ramen noodles when your wife kicks you out.

>> No.2806528 [View]
File: 42 KB, 960x960, media_F9a1YYDXQAA4h5k.jpg [View same] [iqdb] [saucenao] [google]
2806528

Hello /ohm/ is there a better, high IQ way to talk to individual pins on a shift register than just specifying every bit digit individually?

(I'll also ask this on /mcg/ but there's even less activity than here rn)


#include <SPI.h>

/*Define the pins we are using on the Arduino Board and
cross reference them with the pins on the Shift register
so you can give them appropriate names*/
int latchpin = 3; // chip select
int datapin = 11;
int clockpin = 13;

byte shiftLED1 = 1;
byte shiftLED2 = 2;
byte shiftLED3 = 4;
byte shiftLED4 = 8;
byte shiftLED5 = 16;
byte shiftLED6 = 32;
byte shiftLED7 = 64;
byte shiftLED8 = 128;


void setup() {

SPI.begin(); //Start the SPI library
SPI.setBitOrder(MSBFIRST); //Set LSB as bit order, this means we will send the least significant bit first and it will be written to Q7 = Register Pin 7 with the most significant bit being written last to Q0 or Pin 15
/*Configure the Arduino pins we use as OUTPUT, so they can send
data to the Shift Register
*/
pinMode(latchpin, OUTPUT);
pinMode(datapin, OUTPUT);
pinMode(clockpin, OUTPUT);

delay(50);
}
void loop() {
digitalWrite(latchpin, LOW);

SPI.transfer(shiftLED3); // Send a test byte

digitalWrite(latchpin, HIGH);
delay(0); // 1 second delay to observe changes

digitalWrite(latchpin, LOW);

}

>> No.2806527 [View]

Hello /MCG/ is there a better, high IQ way to talk to individual pins on a shift register than just to specify every bit digit individually?

(I'm too embarrassed to ask chatgpt again)

#include <SPI.h>

/*Define the pins we are using on the Arduino Board and
cross reference them with the pins on the Shift register
so you can give them appropriate names*/
int latchpin = 3; // chip select
int datapin = 11;
int clockpin = 13;

byte shiftLED1 = 1;
byte shiftLED2 = 2;
byte shiftLED3 = 4;
byte shiftLED4 = 8;
byte shiftLED5 = 16;
byte shiftLED6 = 32;
byte shiftLED7 = 64;
byte shiftLED8 = 128;


void setup() {

SPI.begin(); //Start the SPI library
SPI.setBitOrder(MSBFIRST); //Set LSB as bit order, this means we will send the least significant bit first and it will be written to Q7 = Register Pin 7 with the most significant bit being written last to Q0 or Pin 15
/*Configure the Arduino pins we use as OUTPUT, so they can send
data to the Shift Register
*/
pinMode(latchpin, OUTPUT);
pinMode(datapin, OUTPUT);
pinMode(clockpin, OUTPUT);

delay(50);
}
void loop() {
digitalWrite(latchpin, LOW);

SPI.transfer(shiftLED3); // Send a test byte

digitalWrite(latchpin, HIGH);
delay(0); // 1 second delay to observe changes

digitalWrite(latchpin, LOW);

}

>> No.2806526 [View]

>>2798991
polished concrete to increases slipping plus a ramp so you can do tricks.

>> No.2806525 [View]

>>2806483
a taut line with bits of wool with increasing lengths and a hydrometer/barometer would get you close.

>> No.2806524 [View]
File: 25 KB, 898x530, energy-sun-sky.png [View same] [iqdb] [saucenao] [google]
2806524

heliostats you thick walled bitch.
light tubes for your dingy ass
seal that mother and dry it the fuck out
water proof that fucking foundation, drain water away and insulate the ground bout 4-8ft out from the walls, styrofoam or might be cheaper to get a geo block and just cut it yourself frost hevee will fuck you; nature abhors your survival. solarium.
concrete with low temp parafin wax will self heat below 32 for a few years. save this for when the sun solar flare activity gets low passive snow melt systems are amazing.
penn state just made massive tunnels and like british sewers and filled that shit with steam all winter long.
conductive concrete, concrete with metal shaving in it will heat up might be fun to repoint the inside with this crazy shit, heated grout fuck your thermal mass. separate the floor from your feet, floating dance floor bitch do the balboa and bounce that shit. shit raise the whole fucking thing floor entrance surrounding garden driveway shit is now on a hill designed to remove water and insulate your bullshit.
infrared glass sucks, propane heaters transfer heat with water so your dark dungeon is increasing in weight. silicone/tar any surface you can outside reduce water egress evaporative cooling sucks. repoint with hydraulic cement.
microwave fumigation fast track you water removal by cooking it with reckless abandon 2 foot thick walls you might be able to do that shit your-self just excite beryllium and run
nature aint your friend, anything casting a shadow on your baribe dream house 4 hours either side of solar noon gots to go. castle belong on hills needs sun.
>tldr: sunlight, mirrors, dry, seal, extend conditioned area to decrease heat transfer, make it a hill, evaporative cooling sucks

>> No.2806523 [View]

Are there inverters to 110/220v (sine wave) available for dewalt 18v/20v batteries?
Ryobi has one ( https://m.youtube.com/watch?v=nZ5_FhzD09g ) which can power 150w. Since I want it as a backup system for power outages to keep the fridge running and maybe power the gas-operated central heating, 150w is enough. But I want it to run on the batteries I use (not an extra set which will be empty or broken if you need it)

>> No.2806522 [View]

>>2806265
>>2805722
>>2806511
if it isn't a weird issue caused by the low resolution, it could simply be a multi-start lead screw (although I've never seen one)

>> No.2806521 [View]

>>2806515
That's what I thought, I see many goggles have video-in, so I guess as long as I pair the right receiver and transmitter I'm good to go?
Wouldn't that be true of analog too, though?

>> No.2806520 [View]

>>2806396
Read a microcontroller datasheet to see what you might be getting yourself into. I recommend an older AVR like the popular ATmega328P. It has both assembly and C code examples, though I prefer how the later AVRs handle their I/O ports.

The relevant assembly manual may also be useful, if just to see what instructions the part you've chosen has. Whether it can do hardware multiplication or division, floating point, etc. Whether it can bit-shift multiple bits at once, or just one at a time. Whether it has instructions for easily reading longs from adjacent registers, or if it can read-bitwiseop-write a register in a single clock cycle. Additionally, and this may be in a different document, how many clock cycles it takes for things that don't have instructions, like different multiply and divide routines from different optimisation levels. The kind of stuff that's important for optimising code.

I'd also check out Ben Heck's videos where he programs an ATtiny10, a chip with 6 pins, 1kB progmem, and 32B RAM, to run space invaders. Surprisingly entertaining.

Navigation
View posts[-24][+24][+48][+96]