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.
 
  • Post
  • Reply
Bloody
Mar 3, 2013

i guess what im getting at is i have done some seriously shameful poo poo with embedded systems

Adbot
ADBOT LOVES YOU

Sniep
Mar 28, 2004

All I needed was that fatty blunt...



King of Breakfast

Bloody posted:

i guess what im getting at is i have done some seriously shameful poo poo with embedded systems

fleshlight vacuum-triggered stroke counter?

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Corla Plankun posted:

why would you avoid trig when you're doing spherestuff

when an arc shrinks to zero and is due to be removed, using floating point trigonometry (read: voodoo) it's fairly common that the west endpoint will be calculated to be 0.0000000000001 degrees to the east of the east endpoint, or however much it takes for the comparator function to consider them out of order. this fucks the search algorithm right up and it fails to find the node in the datastructure holding that arc, so can't remove it.

replacing all the trig w/ linear algebra and square roots stops any of that crap from happening. or at least, it hasn't happened to me yet :)

coffeetable fucked around with this message at 21:21 on Jan 3, 2014

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Bloody posted:

im just sharing traumatic past work experience dont worry thats what we wound up doing after the file system performance was unsurprisingly lackluster

oh i thought you were making a reference to my pissbox, cause thats what it was. that 512 bytes ram was killer especially since i made it read two locations at once. but arduino has 4x that so its all good.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Werthog 95 posted:

i still have an msp430 sitting in its box that i picked up like two years ago when they were doing that $4.30 thing and i've done nothing with it. probably because the dev tools looked like poo poo

yeah i didn't bother with that ti dev poo poo, like some 5GB environment to program a 2kb chip. also i was pissed that you have to agree to terms and conditions that you won't use it to make nukes.

i just used mspgcc

Corla Plankun
May 8, 2007

improve the lives of everyone

coffeetable posted:

floating point

that makes perfect sense. the worst thing i ever did was think that math and programming were two names for the same thing

i'm only just starting to figure out how dangerous floating point can potentially be

Trig Discipline
Jun 3, 2008

Please leave the room if you think this might offend you.
Grimey Drawer

Carthag posted:

wth trig is a good poster dont avoid

tyvm, that was getting hurtful :smith:

GameCube
Nov 21, 2006

peepsalot posted:

i just used mspgcc

that's what i was wondering about thx

Base Emitter
Apr 1, 2012

?

peepsalot posted:

yeah i didn't bother with that ti dev poo poo, like some 5GB environment to program a 2kb chip. also i was pissed that you have to agree to terms and conditions that you won't use it to make nukes.

i just used mspgcc

breaking t&cs bother you more than building nukes?

GameCube
Nov 21, 2006

doesn't the itunes eula include that condition too

Bloody
Mar 3, 2013

peepsalot posted:

yeah i didn't bother with that ti dev poo poo, like some 5GB environment to program a 2kb chip. also i was pissed that you have to agree to terms and conditions that you won't use it to make nukes.

i just used mspgcc

IAR or CCS?

GameCube
Nov 21, 2006

IAR looks like ghetto-rear end windows 95 software and CCS is eclipse :barf:

Bloody
Mar 3, 2013

Werthog 95 posted:

IAR looks like ghetto-rear end windows 95 software and CCS is eclipse :barf:

iar mostly is ghetto-rear end windows 95 software but the components that arent the text editor work pretty nicely and you can pretty easily substitute the text editor out (it has builtin support for this) so i just pointed mine at gvim and well it works pretty decently

GameCube
Nov 21, 2006

Bloody posted:

iar mostly is ghetto-rear end windows 95 software but the components that arent the text editor work pretty nicely and you can pretty easily substitute the text editor out (it has builtin support for this) so i just pointed mine at gvim and well it works pretty decently

guess i'll give that a shot then (gvim supremacy)

Bloody
Mar 3, 2013

it's not brilliant but it beats the trail of tears that is setting up an mspgcc-based toolchain on windows

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Bloody posted:

IAR or CCS?

ccs i think

GameCube
Nov 21, 2006

yeah ccs was loving huge. it's been a while, i forget what my real complaint was about IAR (probably that i was using a mac at the time)

Sagebrush
Feb 26, 2012

Doc Block posted:

The ATmega328 MCU has 1K internal EEPROM

but I'm not sure how I'd get the data back out.

infrared led, bit-banging the data out serially at ~2400-4800bps shouldn't be a problem, hook up a phototransistor to an arduino when you need to read it

Werthog 95 posted:

i still have an msp430 sitting in its box that i picked up like two years ago when they were doing that $4.30 thing and i've done nothing with it. probably because the dev tools looked like poo poo

code composer studio is a pile of rear end and it's loving hilarious that you have to installe like 3.5 gigs of junk to program a microcontroller with 8 kilobytes of rom. as whatshisname up there said you can use msp-gcc if you're ok dealing with that kind of toolchain. there is also the energia project http://energia.nu/ which is basically a modded arduino environment all pre-packaged that will program the msp430 launchpads just as if they were arduinos. it works pretty well imo.

Corla Plankun
May 8, 2007

improve the lives of everyone
i wish that there was an open source emedded movement that straddled the middle ground between 2gb ides and full-arduino

Sagebrush
Feb 26, 2012

like, a netbeans or eclipse plugin? frankly i don't see the advantage of those over either arduino, or notepad++ with some plugins. just extra bloat. i guess you could use the netbeans c ide with some minor modifications.

i would probably think different if someone had written a good free avr simulator with support for debugging and breakpoints and stuff, but lol as if

Doc Block
Apr 15, 2003
Fun Shoe

Sagebrush posted:

infrared led, bit-banging the data out serially at ~2400-4800bps shouldn't be a problem, hook up a phototransistor to an arduino when you need to read it.

a cool idea, but prob not for this project. probably just gonna go with an SD card. if it can be done on an ATmega168 with room to spare then it can be done on an ATmega328.

Nelson MandEULA
Feb 27, 2011

"...the biggest shitbag
I have ever met."
i got an arduino uno kit from golden-i for yosmas (thanks golden-i!!) and a 555 timer kit from my brother for xmas, so between them i think i'll be learning a lot about electronics in tyool 2014

i already blinked an led and also made it get brighter when i press the button. also learned about stuff like debouncing and pull-down resistors. :feelsgood:

Sagebrush
Feb 26, 2012

neat! if you are using the arduino for reading buttons, teh microcontroller actually already has internal ~25k pull-up resistors on each pin and it's just not really well documented by the arduino folks. you do a


#define BUTTON 10
//or whatever

void setup() {
pinMode(BUTTON, INPUT);
digitalWrite(BUTTON, HIGH);
}

and the combo of INPUT mode and sending a digital HIGH sets the pull-up on 10 so it defaults to Vcc. then you just connect ur button or switch from that pin to ground, and treat digitalRead(BUTTON) == LOW as the button being pressed. no other external components needed.

this really helped me miniaturize some circuits when i learned it was a thing



e: i realized if you are just getting started with code the preprocessor stuff might be strange. the

#define BUTTON 10
pinMode(BUTTON, INPUT);

is functionally equivalent to

int button = 10;
pinMode(button, INPUT);

except that the compiler literally just does a find-and-replace for BUTTON and puts a 10 in there. depending on how smart/dumb the compiler you're using is (i have no idea for avr-gcc), this can save you a tiny bit of space over using an int assuming the value of BUTTON will never change, which it probably won't since it is associated with a piece of hardware.


e2: this is what all the capitalized commands are actually in the arduino environment incidentally. when you say HIGH the preprocessor just replaces it with a 1, LOW it replces it with a 0. i forget what INPUT and OUTPUT evaluate to but i think it's a hex value for some register. etc. so digitalWrite(10, 1); is equal to digitalWrite(BUTTON, HIGH);

Sagebrush fucked around with this message at 06:23 on Jan 4, 2014

poty
Jun 21, 2008

虹はどこで終わるのですか? あなたの魂の中で、または地平線で?
is there an ac-wifi + bluetooth 4 dongle for the raspberry pi

if not would you guys mind making one thx

Bloody
Mar 3, 2013

poty posted:

is there an ac-wifi + bluetooth 4 dongle for the raspberry pi

if not would you guys mind making one thx

afaik the rpi lacks a bus fast enough for either of those to be useful

power botton
Nov 2, 2011

a 27 year old mac plus was able to do it. lol that 3 decade old technology from apple can beat things from 2014

Usagi-Sauce
Dec 2, 2005

YAMOxNINJA
~otp~

git clone trooper posted:

a 27 year old mac plus was able to do it. lol that 3 decade old technology from apple can beat things from 2014

uhh all I'm seeing is a hack that got a mac plus connected to the web, and that actually used a rpi to bridge serial and wired ethernet

Usagi-Sauce
Dec 2, 2005

YAMOxNINJA
~otp~
also if you took literally every bit of data going into or out of the mac plus cpu it still wouldn't even saturate 802.11n let alone ac so ughhhh trap sprung

poty
Jun 21, 2008

虹はどこで終わるのですか? あなたの魂の中で、または地平線で?
i found this http://www.amazon.com/IOGEAR-Bluetooth-Micro-Adapter-GBU521/dp/B007GFX0PY/ref=zg_bs_490499011_13 and this http://www.amazon.com/Cirago-Bluetooth-Speed-Adapter-BTA7300/dp/B005QUQPDA/ref=cm_cr_pr_product_top

i guess ac-wifi doesnt matter but bluetooth 4 is a lot nicer than 3 so ill hold out for that

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp

WorkingPeer posted:

i got an arduino uno kit from golden-i for yosmas (thanks golden-i!!) and a 555 timer kit from my brother for xmas, so between them i think i'll be learning a lot about electronics in tyool 2014

i already blinked an led and also made it get brighter when i press the button. also learned about stuff like debouncing and pull-down resistors. :feelsgood:

555's are my favorite IC ever, holy poo poo can you do a lot of goofy neat things with those.
reminder that yosvape's code is on github if you want to read some bad C https://github.com/jonny290/yosvape

Bloody
Mar 3, 2013

oh bluetooth 4 is 3 Mbit? jesus christ that's slow, i could saturate that with an msp, rpi will have no issues at all

spankmeister
Jun 15, 2008






Jonny 290 posted:

555's are my favorite IC ever, holy poo poo can you do a lot of goofy neat things with those.
reminder that yosvape's code is on github if you want to read some bad C https://github.com/jonny290/yosvape

i want one of these



http://www.evilmadscientist.com/2013/555-kit/

:iia:

Bloody
Mar 3, 2013


way cooler to design it yourself & understand the design

GameCube
Nov 21, 2006


omg THANK U I've been needing a new kit for a while and forgot about that one

Doc Block
Apr 15, 2003
Fun Shoe
Ugh. Looks like I'm gonna have to use two MCUs for my stupid beer temperature logger thing.

The 16x2 LCD I want to use needs 11 pins, plus I need 4 for reading/writing an SD card, another pin for SD card detection, 2 more for talking to the real-time clock (via I2C), an analog pin for reading the temp sensor, a pin for controlling LCD power (via transistor, probably), a pin for reading the LCD power on/off switch, and pins to check other buttons (for setting the time, date, view highest/lowest temp, etc.).

All the input buttons can be connected through a shift register, but that's still way more pins than one ATmega328 has. I've got an old ATmega168 that I can use to drive the LCD, so it isn't quite as wasteful as two ATmega328s, but still...

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Doc Block posted:

Ugh. Looks like I'm gonna have to use two MCUs for my stupid beer temperature logger thing.

The 16x2 LCD I want to use needs 11 pins, plus I need 4 for reading/writing an SD card, another pin for SD card detection, 2 more for talking to the real-time clock (via I2C), an analog pin for reading the temp sensor, a pin for controlling LCD power (via transistor, probably), a pin for reading the LCD power on/off switch, and pins to check other buttons (for setting the time, date, view highest/lowest temp, etc.).

All the input buttons can be connected through a shift register, but that's still way more pins than one ATmega328 has. I've got an old ATmega168 that I can use to drive the LCD, so it isn't quite as wasteful as two ATmega328s, but still...

maybe find a lcd that has i2c interface or something? or use a big honkin atmega1280/2560 for more pins.

Doc Block
Apr 15, 2003
Fun Shoe
Except that I've already got the LCD, and this little project is already way over budget... and these ATmega168s I bought years ago are just sitting there gathering dust.

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
pretty sure there are libs to allow you to beat on a hd44780 via shift registers too. should get you more pins. cmon son i did a vape on an uno, you can do this

GameCube
Nov 21, 2006

hd44780 has a 4-bit mode too doesn't it

Adbot
ADBOT LOVES YOU

GameCube
Nov 21, 2006

though that's probably not cutting enough pins out

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply