Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
gonadic io
Feb 16, 2011

>>=

hobbesmaster posted:

the real problem is sensors with wires already attached and having wire to bare pads and the like

i accidentally bought this:

It's roughly 1cm a side.

after looking for a socket that'll fit it, in the end i just bought a second that comes attached to a pcb. for £90. my only justification is eventually i'll need three if i follow through with this project

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=
i had a productive lunch today :toot: i guess im officially now a terrible bit janitor

https://www.youtube.com/watch?v=S8MtqhWVQ2E&hd=1

this is in C in the arduino IDE, time for another attempt at replicating rust next i think

gonadic io
Feb 16, 2011

>>=

fritz posted:

gyros are fine (but subject to bias), it's the accelerometers that are noisy



gently caress 2mm pitch pins.

Also what are we counting as "crazy expensive aviation" ones? These are £90 each,and I am eventually planning on using them in aviation.

gonadic io fucked around with this message at 18:49 on Feb 15, 2017

gonadic io
Feb 16, 2011

>>=

Silver Alicorn posted:

please do not crash your plane, forums poster gonadic io

plane? :q:

https://github.com/djmcgill/to-the-moon

gonadic io
Feb 16, 2011

>>=

JawnV6 posted:

how'd you even find that $70 gyro?

it's the latest model of the one used by this guy:

https://www.aeroconsystems.com/tips/Active_Stabilized_rocket_Wyatt.pdf

i got the same solenoid valves too.

gonadic io
Feb 16, 2011

>>=

JawnV6 posted:

im not sure how to set your problem up, but i'd imagine it's measuring degrees off the vertical. "if i'm over 2 degrees the wrong way, fire the solenoid" is the problem statement? forget about time for now, how precise do you need the degree measurement to be?

p much yeah, and i have no idea :v: i'm just copying that paper mostly. once i have anything working, in about 10 years, i'll look to lower the price.

gonadic io
Feb 16, 2011

>>=
https://www.arduino.cc/en/Tutorial/Potentiometer

why this tutorial say to connect 1 pin with ground, one with the board, and then 1 to +V?

surely the same effect is achieved with enabling the internal pullup resistor, then connecting it to the middle pin then connecting ground to either of the side ones?

gonadic io
Feb 16, 2011

>>=

Sweevo posted:

if you connect both ends of the potentiometer to ground then the mid point will always be ground regardless of where you turn it.

i get that, what i'm asking is the diff between

code:
     pin
      |
0V ---|-- 5V
and
code:
  pulledup pin (+5V)
      |
0V ---|--- (disconnected)

gonadic io
Feb 16, 2011

>>=

Bloody posted:

the goal is to use the pot as a voltage divider presumably. if you just pull up the middle of the pot you have... something. not a voltage divider. well at least not a useful voltage divider

i see, it goes between 0 and 5 with all three pins connected.

with just the middle you have something that goes between x and y where 0 < x < y < 5 and they both depend on the exact resistors involved

gonadic io
Feb 16, 2011

>>=
Bah, still having issues with Rust and my Arduino. Anybody want to weigh in? http://stackoverflow.com/questions/42368675/why-does-getting-the-address-of-certain-linker-variables-halt-samd21-execution-i

Honestly at this point I'm not far off just creating a dynamic library in Rust and doing the setup in C to call the Rust library.

gonadic io
Feb 16, 2011

>>=
hmm, this doesn't look good

code:
0000247c <__etext-0x68>:
    247c:	7ffffc38 	svcvc	0x00fffc38
    2480:	80978408 	addshi	r8, r7, r8, lsl #8
    2484:	7ffffca0 	svcvc	0x00fffca0
...
    24c4:	7ffffec0 	svcvc	0x00fffec0
    24c8:	8000b0b0 	strhhi	fp, [r0], -r0
    24cc:	7ffffec0 	svcvc	0x00fffec0
    24d0:	800ba8b0 			; <UNDEFINED> instruction: 0x800ba8b0
    24d4:	7ffffeec 	svcvc	0x00fffeec
    24d8:	8006abb0 			; <UNDEFINED> instruction: 0x8006abb0
    24dc:	7fffff14 	svcvc	0x00ffff14
    24e0:	00000001 	andeq	r0, r0, r1

gonadic io
Feb 16, 2011

>>=
dumb noob question

if i only have a 24V battery, and i use some DC/DC regulator to get it to 3.3

can i have


pre:
+24V ----- motor --|
       |           |
     DC/DC         |
       | (+3.3V)   |
     arduino       |
       |           |
 +0v --------------|

i.e. i don't need to protect the arduino from the ground rail, 0 is 0? the motor will have a rectifier diode to prevent kickback.

gonadic io
Feb 16, 2011

>>=
i mean i'll probably have to step up to 24 instead of stepping down to 3.3 but the question is still relevant

gonadic io
Feb 16, 2011

>>=
triple post project update:

i got digitial pio working in rust so my single-digit-button-counter
https://www.youtube.com/watch?v=S8MtqhWVQ2E&hd=1
is now implemented entirely in rust with a little bash script to compile and upload!

it's not especially good code, and i still can't get the address of __etext, but i'm pretty pleased that it's working

gonadic io
Feb 16, 2011

>>=

yippee cahier posted:

0 is 0, yeah. some people might still warn you about noise from the motor, idk.

do you want to control the motor using the arduino? i used https://www.sparkfun.com/products/10213 to control a higher voltage DC motor from a 3.3V arduino.

yeah i have a bunch of those, currently i'm blinking an led with one but the plan is to control motors/solenoid valves with them

gonadic io
Feb 16, 2011

>>=

atomicthumbs posted:

it's all fun and games until your inductive load starts ringin', flips that pulse around, and rams it backwards through your switching bank and capacitor

got myself some rectifier diodes to put across the motors and solenoid valves

gonadic io
Feb 16, 2011

>>=
Zero:

quote:

The board can operate on an external supply of 6 to 20 volts. The recommended range is 7 to 12 volts.


MKRZero:

quote:

Vin
This pin can be used to power the board with a regulated 5V source. If the power is fed through this pin, the USB power source is disconnected. This is the only way you can supply 5v (range is 5V to maximum 6V) to the board not using USB. This pin is an INPUT.

gonadic io
Feb 16, 2011

>>=
Got my Arduino's ADC working in Rust! i'm p happy not going to lie

code:
const VAR_RES: Port = A2;
const ADC: *mut ADC = 0x42004000 as *mut ADC;

pub fn main() {
    unsafe {
        VAR_RES.set_pin_dir(false);
        let mut digit = create_eight_segment!(D7, D6, D3, D4, D5, D8, D9, D2);

        loop {
            let s = (*ADC).analog_read(VAR_RES) as u32;        
            digit.display( s >> 7 );
            delay(100);
        }
    }
}
https://www.youtube.com/watch?v=rE2VUSBSRB8

gonadic io fucked around with this message at 14:06 on Apr 4, 2017

gonadic io
Feb 16, 2011

>>=

Sagebrush posted:

i know i keep spamming this thread but i am finding this stuff p cool

fwiw i'm also finding your stuff really cool. especially since my rust arduino project has kinda stalled

gonadic io
Feb 16, 2011

>>=

Bloody posted:

caps are full of lies and are trash

ACAB

gonadic io
Feb 16, 2011

>>=
what use case does logical shift have except trying to out-optimise the compiler when multiplying/dividing by powers of 2?

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=
Wait poo poo I got them the wrong way around. I'm all for bitshifting, I guess I meant arithmetic shift

  • Locked thread