|
I went to Radio Shack, picked up an Arduino Uno, then took a dremel to an old Dreamcast Racing wheel, uploaded some stuff from this page. $30 rudder pedals with individual toe brakes for my flight sim. $60 if my time is worth $20/hr. As to the other stuff, I normally program PICs and MSP430s, and most of my stuff is in assembler, so program size and memory has never, ever, ever been a problem. Debugging and time to product, however, could be faster. This Arduino stuff is kinda backwards; throw lots of code at a small problem and let the huge memory cope with the bloat, overhead, and unused stuff, and just not worry because It Works.
|
# ¿ Nov 3, 2012 03:51 |
|
|
# ¿ May 14, 2024 10:39 |
|
JesusDoesVegas posted:Ya, if you look at my code I used ==... I just typoed here. It depends on how many comparisons you have and how good your compiler is. If you have something that you're testing, and only one case can ever be true, you could write: code:
If you write code:
If you wrote code:
This is getting into the programming in c of the device more than you probably like, but "small" devices like microcontrollers need a different way of looking at things; they don't have gobs of memory or fast cores, so you, as a programmer, have to know EXACTLY how your code is going to get compiled if you want good performance. babyeatingpsychopath fucked around with this message at 23:10 on Nov 24, 2012 |
# ¿ Nov 24, 2012 23:07 |
|
SomethingLiz posted:Yeah, pretty much exactly like that. I'm looking into continuous rotation servos right now, it seems like they might be a good option because they're a little cheaper and don't require motor drivers which should cut down the price a lot. I'm not sure if they'd be strong enough though. How much granularity do you need? 4 steps? 32 steps? A number of tick marks on each rod and an optical sensor, and you can use literally any directional motor. Analog servos are also really cheap and reasonably easy to drive from 5v, although modifying "thousands" to be free-running would be tedious. babyeatingpsychopath fucked around with this message at 01:50 on May 7, 2013 |
# ¿ May 7, 2013 01:46 |
|
EDIT: Fixed! reset-en is cut, so it requires a manual reset every time a new sketch is uploaded. That's incredibly annoying. I've got an older Arduino Mega board with a problem: it won't program over USB. I've got an Uno that I programmed the ISP sketch onto, and now I can upload sketches using ICSP. However, I want to put that Uno back in the thing I took it out of. How do I get this Mega working with USB again? It seems to be recognized when I plug it into the USB port; a device FT232R USB UART shows up. I got the newest version of the Arduino IDE, too (1.05), but that doesn't seem to have changed anything. Could the FTDI chip be fried? Arduino IDE bitrate different than what the FTDI is set up for? I don't see any options for setting COM port baud rate or anything. The error is: code:
babyeatingpsychopath fucked around with this message at 05:39 on Sep 15, 2014 |
# ¿ Sep 15, 2014 05:00 |
|
Cheekio posted:I originally posted this to the electronics thread, and I think they're a bit out of my league. I have a nice 2A wall wort<>USB plug and an arduino project that simply uses too many servos. Assuming I can splice a USB cord correctly and wire it into the project correctly, can I just run the arduino and all the servos in parallel on the same input? That way the Arduino isn't trying to power all the servos. Is 2A going to be enough? Cheap wall wart power supplies get pretty bad at regulating their voltage near max current, and are also pretty bad at regulating when current changes wildly. It is, in fact, just that easy to wire everything in parallel, but like they said in the other thread, put some largeish capacitors near the board to keep the power clean. That being said, you can connect the arduino to the computer and all the servos to the power supply and then connect the ground pin of the arduino board to the - pin on the power supply. Clean power for all!
|
# ¿ Sep 15, 2014 17:19 |
|
Aurium posted:Simply wiring voltage supplies in parallel is generally considered a bad thing. So I'm going to skip that. (but one of the possibilities might be what you're thinking of anyway). I just want to clarify that I wasn't saying to connect the supplies in parallel. Just connect the grounds together to get both the servos and the arduino on the same voltage reference. This may create some ground current, but probably not. Wall warts are isolated supplies, and USB stuff usually is, too. If the computer is a laptop, then it's probably isolated. I'm doing stuff with arduinos and servos. I've got my servos on a 9v supply and my arduino on a 3.3V. I've got a wire going from arduino "GND" pin to the - rail on the servo the power supply board, and everything plays nicely. Without that wire, the servos jump around sporadically, probably because the pulse doesn't rise high enough or fall low enough to reliably be a 1 or 0. Not that I've tried to probe voltages or anything; I just connected the wire and continued working. babyeatingpsychopath fucked around with this message at 00:23 on Sep 17, 2014 |
# ¿ Sep 17, 2014 00:19 |
|
Cool Matty posted:So I'm currently working on a project that will involve two (or potentially more) Arduinos communicating over a distance of ~30 feet or less. I don't wish to use wireless, since the area will be heavily covered in existing wifi networks, and reliability is more important. 5-pin XLR is probably the most robust solution. It's used for all kinds of digitally-addressed lighting and stuff, so the cable is nice and shieleded, and it's good for tons of power. Looks like about $50 for 100' of cable with ends and $8 each for connectors. 4-pin XLR is also available, but it's 4x the price because it's uncommon. Cheapest is gonna be ethernet plugs.
|
# ¿ Oct 1, 2014 17:29 |
|
TerminalSaint posted:The button actually worked fine just routed from digital to ground. I scavenged some strips of surface mount LEDs out of an old keyboard and they work as intended wired up per the diagram, sans diode. They've probably got a 1.6V forward voltage, so that's enough. When I made a circuit like this, I just had the button connected directly to a pin and the LED connected to another pin that was turned on in software.
|
# ¿ Oct 10, 2014 16:31 |
|
PRADA SLUT posted:I thought it was just a problem with the loop, which is why I only posted it. It's actually a gigantic program (but under the sketch size limits). So the arduino has 2k of SRAM. This means all your variables have to be less than 2048 bytes. 1000 ints is 2000 bytes. Never ever ever use sparse arrays on an arduino. Try not to use floating point math, either, if you can help it. If you want it fast, precompute all the possible values you can. Historically you do all this stuff with #define to make it simpler since (presumably) none of this stuff changes. Saves some memory and can give some good optimization. C++ code:
babyeatingpsychopath fucked around with this message at 14:31 on Jan 31, 2015 |
# ¿ Jan 31, 2015 14:23 |
|
You can also get a long stick across the valve handle and use a motor and some fishing line wrapped around the shaft. The longer your stick, the more leverage you have. A couple of limit switches are also needed, but their implementation is left as an exercise for the user.
|
# ¿ May 1, 2015 17:49 |
|
Bad Munki posted:That'll have little to no torque as it approaches the fully open position, at least in that arrangement. Move the motor off to the side so it's pulling at an angle in all positions. The torque multiplication from this is really impressive. If you find you don't have enough torque, you can make the stick longer. Putting it at an angle so it goes from -45 to 45 works too. As with anything, mock it up. If it doesn't work, you can figure out what's wrong and make changes.
|
# ¿ May 1, 2015 18:46 |
|
Bad Munki posted:I don't mean torque at the optimal angle, I mean torque as you're trying to pull it the last couple degrees to shut. At that point, with the motor in that position, you're trying to pull it straight, instead of sideways. I understand what you meant. I'm saying that when I did this precise thing with stuff lying around, the depicted configuration worked. The valve handle didn't go all the way down to parallel to the pipe before the fishing line spun on the shaft, but the valve was closed, so good enough. I put the limit switch a degree or so before that point. To rant a little bit: I see a bunch of people trying to engineer the best possible solution to a problem instead of just finding stuff in their junk box and rigging something up to see if it works. I needed to turn a valve, so I got a random motor, some fishing line, a literal stick from the yard, and some tape. I lashed the motor to the pipe with the tape at what I thought might be an OK distance, taped the stick to the valve handle, and tied on the line. It worked. Not elegant, but I went from "have a problem" to "have a working solution" in about 7 minutes. If it hadn't worked, then I would have attempted to think about the problem and maybe come up with a more elegant solution. Pretty much everyone has a small motor of some kind. Trying to figure out what linear actuator to buy based on how much torque you need or figuring out which of dozens of servos to go with, trying to figure out how a mounting plate can work... you're a tinkerer and a hobbyist, not an engineer. If it's not life-critical or load bearing, then just slap something together and see where it fails and where it needs improvement. If nowhere, you're done and can move on to another project or spend your time engineering an elegant solution to replace your already-working project. Sure, in an actual industrial application you're going to have a rated-flow solenoid in parallel with a manual operator (or a manual operator on your solenoid), but that doesn't mean that's the only way to do things. Budget/hacky/rigged/ghetto/redneck solutions are only suboptimal for mass production. Rant over.
|
# ¿ May 1, 2015 21:13 |
|
Aurium posted:... I'd never really thought of this before. Why can't you use a regulator set for the correct voltage to directly drive an LED? edit: Duh. Linear regulators are constant voltage; LEDs require constant current. Teach me to post without thinking about something. babyeatingpsychopath fucked around with this message at 21:21 on Jul 31, 2015 |
# ¿ Jul 31, 2015 21:18 |
|
politicorific posted:Arduino Experts, how feasible would it be to build an intra-room pager system? (Or perhaps a multi-door doorbell might be a better description) TBH, this sounds like a perfect job for an ESP8266 and the arduino toolchain. Everything's done in wifi. The device address can be an IP that you stick over somewhere. The ESP speaks IP already, so you just send a ping or whatever and the thing on the other end blinks. No worries about 433MHz stuff.
|
# ¿ Oct 25, 2015 17:36 |
|
Combat Pretzel posted:So yeah, the input pins of the Arduinos don't draw unnecessary current, do they? Say if I connect an analog pin with a voltage divider to a RC battery (something with 5Ah capacity that can output 20-40C), this will not blow up my board, right? In regards to implementing voltage sensing and such... In normal digital or analog input mode, the input impedance is about 10MΩ. The input pullup resistors are 20-50kΩ on most boards.
|
# ¿ Nov 16, 2015 04:57 |
|
SkunkDuster posted:Why am I running into a 25 character limit with the liquidcrystal library when scrolling? I got the sunfounder super kit with an Arduino UNO and LCD1602 and my test messages shifts the cursor up or down a row every 25 characters even though I am telling it to shift at 33. If I increase it above 33, it still shifts at 25 and just adds garbage characters at the end. For example, I get this: my loop looks like code:
To contrast, using the same LCD library, I turned on lcd.autoscroll() and scrolling works like a champ. edit: I used lcd.setCursor(0,0) and lcd.setCursor(0,1) and there's no line tearing, so that's definitely the problem. babyeatingpsychopath fucked around with this message at 22:16 on Nov 28, 2015 |
# ¿ Nov 28, 2015 22:10 |
|
SkunkDuster posted:Can I see the code you used for autoscroll? I tried it and it is still jumping at 25 characters. code:
|
# ¿ Nov 28, 2015 23:34 |
|
A Yolo Wizard posted:anyone here messed with making custom device descriptors for teensy 2.0? I've done it with 3.0 boards, but it seems completely different for the 2.0. I just want a keyboard without the sd card initializing I've made custom device descriptors before. What's the chip on the teensy? Atmega32u4? Should be the same hassle as the Atmega8u2 on the Unos.
|
# ¿ Dec 17, 2015 01:21 |
|
TheresaJayne posted:Wonder if anyone can advise me how to sort this problem out - I can solder and program but Circuit Diagrams are just not in my stupid mind. 4-wire fans are pretty awesome. The TACH wire provides 1 or 2 pulses per revolution; it provides a ground to the voltage you supply it. You should be able to read from it with your arduino's pin set to INPUT_PULLUP. The PWM input is pulled high and expects a PWM signal at ~25kHz that pulls that pin low. +V and GND are obvious. Because the PWM signal expects to be grounded to modulate speed, if you don't connect anything to that pin, the fan runs 100% all the time. Once you can read from the tach, you should implement a PID controller for fan speed vs temperature. The hard bits are going to be calibrating your temp sensor and getting your PWM frequency right.
|
# ¿ Dec 17, 2015 12:32 |
|
The Dark Project posted:Yeah, that's what I was thinking. If I had my hands on a schematic of the kinds of gears they used, the arrangements and timing etc, I could probably look to making a smaller scale version for myself. I can't get a hold on anything like that, so my next thought was to use a series of stepper motors programmed in the right sequence to replicate the motions being carried out on the full sized machine. It's absolutely possible to replicate a cam-and-gears machine with steppers/servos/actuators. There's no question about that. It's even possible that the controller could be some flavor of arduino. The actual problem to solve is the mechanical actions needed to perform the barbed-wire-making. Once you have those mechanical actions, then you need to build a machine that can perform each of those steps. Then you need to automate that process, with all that involves. Lathe first, motorized lathe second, CNC lathe third.
|
# ¿ Jan 5, 2016 12:36 |
|
General_Failure posted:Hey people! You just need to drive a stepper. I went onto amazon, found something that ships prime, and hit go. I see a $.90US one on there. I think mine were $10 for 3, and they're fine. Use four pins from that and four transistors in an h-bridge to drive your stepper. Done. Solved problem. The arduino IDE works in linux. Of course, you could also just get a stepper driver breakout (pololu, a4988, etc), and wire up a 555 to throw a pulse at that thing's "step" pin every so often, with some limit switches to switch between forward and reverse. babyeatingpsychopath fucked around with this message at 01:19 on Jan 14, 2016 |
# ¿ Jan 14, 2016 01:17 |
|
General_Failure posted:Didn't realise there were actual breakout boards. What's this something you are speaking of? Also I'm in Australia so Amazon doesn't always work out so well for me. Look at stepper driver boards. They're commonly available on 3d printer sites. The commonest are Pololu-brand A4988s and pin-compatible clones using other driver chips. You feed in stepper motor voltage (12V, 24V, 9V, whatever), logic voltage (3.3 or 5V), then you assert three pins to make the thing go: Enable, Direction, and Step. Every pulse on the "step" pin moves the motor one step in "direction" if "enable" is on. The board handles current limiting and all kinds of other great stuff to make these braindead simple to use. There are typically jumpers on the board to enable 1/2, 1/4, or 1/8 microstepping for the A4988s, and 1/16 and possibly 1/32 stepping for other chips. This means if you've got a 200steps/rototation motor and you jumper the board for 1/8 microstepping, you get to send 1600 pulses to get one revolution. Downsides are more current draw and lower total torque.
|
# ¿ Jan 15, 2016 03:22 |
|
One Legged Ninja posted:Edit: Third and fourth question. I'm setting the four output Row pins to HIGH, setting the five input Column pins to INPUT_PULLUP, then pulling each row LOW in order and looking for input LOWs. (I had some bad floating issues going the other way.) Is this an acceptable way to do it, or should I work some external pull down resistors into my intermediate connection board and do it my initial way? Also do I need current limiting resistors on my four Row lines, or will it be ok without them? This is the way I did it. my main function looks like code:
Basically, the thing is updating all the buttons every loop as fast as possible, but it only dumps its data when the other end asks for it. It's possible there are some race conditions or something, and that it's ridiculously inefficient, but w/e. The software on the other end isn't super intelligent, either; basically just takes in byte values and translates them to useful stuff, then dumps that out to a UDP port for xplane.
|
# ¿ Feb 20, 2016 19:11 |
|
VelociBacon posted:Anyone have an idea where I could find code that would make an LED behave like a flickering candle? Thanks. A good hack I saw a bit ago just played "happy birthday" to an output, and hooked that up to an LED. It was flickery-enough. If you want something more actually true-to-life with random number generators and stuff then that's also an option.
|
# ¿ Feb 25, 2016 03:57 |
|
huhu posted:The code says vid should be 0x26 and pid should be 0x42. What could be the issue here? Well, if the VID and PID don't match what an OV2640 are, then you've got a counterfeit shield, I'd guess. Or there's a configuration error somewhere. You've gotta figure out where those VID and PID numbers come from. 0xAA, 0x13 may be useful information to you if your code is sending someother command to the module than "what's your VID/PID?"
|
# ¿ Feb 28, 2016 14:21 |
|
SkunkDuster posted:Arduino Uno questions: 1. That "line of code" is a variable declaration in C++, it's "code outside of a loop/function" in only the strictest and most basic sense of the term, but just fine in a high-level object-oriented language. 2. Yes. Look into fuse bits and using the internal clock, and realize that you're at half or quarter Arduino clock speed. 3. Learn #define and .h files with #include, and love them. If this makes literally no sense at all, read up on "C" programming language 4. If you're looking for BASIC's GOTO, then you need C's switch() C code:
|
# ¿ Apr 9, 2016 03:48 |
|
Fanged Lawn Wormy posted:I'm trying to remember if this is a thing I've figured out before or not... Are you talking about a constructor with values? class handyObject { public: handyObject(int port, int pin, int foo, int bar); handyObject(int foo, int bar); // for when you just want to use default ports } My apologies for horrible C++. I use other languages for OO stuff, and do everything on microcontrollers in standard C.
|
# ¿ May 13, 2016 00:49 |
|
Captain Hair posted:Sticking stuff to the glass is kind of a no, because it gets swapped around and rotated after cleaning, so I'd have to do each corner. The more I look at the problem the more I feel micro switch with long lever is the way to go. Cover the metal arm with heatshrink so it doesn't scrape the glass. Could work. You're looking for a limit switch. The industrial hard plastic operators and NEMA enclosures with weatherpoof wiring are probably overkill, but long-lever microswitches are a thing. I'm not sure how your doors are rigged; a picture would be very helpful.
|
# ¿ May 29, 2016 17:36 |
|
scandoslav posted:I'm stuck on killswitch relay selection. It's my understanding that the motors on the RC crawler I'm using as a chassis can draw ridiculous amps when stalled. My ESC is rated for 60 amps continuous, 360 amps peak. I have not been able to find relays (at least on the sparkfuns/polulus/etcs.) that can handle that sort of VDC current, and the ones on digikey that can are hundreds of dollars. I'm assuming the worst case scenario of a glitch/bug holding a stall long enough to fuse an inadequate relay before the ESC's automatic overheat protection kicks in. Do you want a killswitch or just overcurrent protection? A fusible link or a slow-blow fuse should be fine. Otherwise, you're looking at industrial contactor territory; they've got beefy springs to open contacts quickly, and arc chutes to throw the arc into catch cans so the arcs don't melt stuff. Look into medium-amp relays. I know there are 12-24VDC controlled relays that switch 24VDC loads@30A and aren't all that large. If you're doing killswitch-style stuff, then you just need the interrupt rating of the relay; that's what it can handle a couple of times without welding itself. Just looking at my maintenance manuals, ANL-xxx series current limiters or MS28937/MS28938 (bussman ACH series) fuses will hold crazy current for a little bit, then pop. Current limiters are slower-blow than fuses, but fuses have a faster response time to high-current shorts. Unfortuantely, my pubs are for aircraft manufactured in the 70s and 80s, so the relays are NLA by that part number, and I don't have the logins to get to the parts xref database to figure out who makes them now. babyeatingpsychopath fucked around with this message at 03:28 on Jun 7, 2016 |
# ¿ Jun 7, 2016 03:07 |
|
huhu posted:I want to be able to send text to an Arduino and have it write on a paper surface with a marker. My basic idea is to use two stepper motors to control x/y motion along with a system to mount the motors, markers etc. The part I'm completely lost on his how to create a way to send instructions to the Arduino. My original, bad idea, was to create a library that defines what each letter would look like (an O would be, move right 1, up 2, left 1, down 2). However I've seen much more complicated designs that can water color, print in cursive, etc. What should I be reading up on to get started? You're basically implementing a 3d printer/CNC router that renders its own gcode on the fly. This isn't all that hard if your character set is limited and fixed. Look at shapeoko/RAMPS for already-built-and-implemented arduino shields that understand gcode. From there, you can write a glorified wrapper that reads text and sends gcode strings to the base firmware to draw on paper. babyeatingpsychopath fucked around with this message at 04:36 on Jun 26, 2016 |
# ¿ Jun 26, 2016 04:06 |
|
What are you trying to do? Serial communication is really very very simple. Program A sends a string of characters to the arduino, which reads them. If program A is well-behaved, then you can just read a specific number of characters with the arduino every time. If not, then you loop over a state variable (while (Serial.CharacterAvailable())) and consume characters until there are no more, then do something. Treat it like reading a series of strings from the keyboard or wherever, if that helps you.
|
# ¿ Jul 2, 2016 20:45 |
|
Captain Hair posted:As genius as that is I really need all ten buttons easily available. It's running a couple of lcds so I did consider using an lcd keypad with osd, but it's much simpler for my user if she just has all options available as buttons. You can get to 4 pins with charlieplexing if you like diodes. edit: you can use (n * (n-1)) buttons with n pins. 3 pins = 6 buttons, 4 pins = 12 buttons, 5 pins = 20 buttons. If you use LEDs as your charlieplexing diodes, you get lit buttons for free. You don't even (necessarily) need to put a button on a state; you can just have a diode there, and if you want it on, then put it in your polling loop. babyeatingpsychopath fucked around with this message at 02:25 on Aug 13, 2016 |
# ¿ Aug 13, 2016 02:20 |
|
General_Failure posted:I mentioned it in passing in the magic smoke thread but I'm putting some hard labour into getting one of those little red fan modules working again for my little boy. A few days ago his Arduino Uno refused to turn the fan again beyond a twitch. I had a look at it today and the 5v regulator seemed to gave gotten flaky in a weird way. Any load seemed to result in a pretty good short circuit between VIn and GND. It still seemed to function on it's own but just using USB in avoided the bad smell I modified the proto / breadboard shield we were using to have a 5v linear regulator and input but it was too little too late. RIP Uno. Why not power the h-bridge from a completely separate 5V supply and not run all that current through the dev board and its linear regulator?
|
# ¿ Aug 13, 2016 19:42 |
|
Sagebrush posted:Using switch/case instead of chained conditionals is equally valid, yeah. I don't know which one is more cycle-efficient -- I haven't really run into a situation where it mattered. I bet they compile into pretty much the same thing. Looking at the generated code, a case is slightly more efficient. The case evaluates into a jump table, and the chained conditionals are all evaluated. You'd have to do some serious testing and actually NEED to find optimization for that to be worthwhile. I like doing things like this: C code:
|
# ¿ Sep 5, 2016 16:35 |
|
Spazzle posted:The strips are just individual ones linked together. I think you can actually cut singles off and use them. I was using the fast LED library for strips, but now I've got some panels. Is there an equivalent to fastLED for neoMatrix?
|
# ¿ Sep 4, 2017 18:49 |
|
Fanged Lawn Wormy posted:I have used fastled with the adafruit matrices - they work just like 8 strips of 8 pixels daisy chained like reading text, left to right, top to bottom. Yeah, I've got a bunch of individual strips, and they're wired differently than the tiles. I'm using the adafruitGFX library to draw lines and pictures and whatnot. It's nice that the neoMatrix library can just take my arbitrarily-wired strings and make them work right. I'd really prefer to not rewrite a graphics library in assembly for yet another platform.
|
# ¿ Sep 6, 2017 22:34 |
|
unpacked robinhood posted:I'm trying to output unmodulated IR codes when pressing a button, which works half the time. Here's my take on your code. I unwrapped the loop for clarity. I also like the "for(;test;);" construction instead of do;while(test); C code:
|
# ¿ Sep 13, 2017 02:32 |
|
unpacked robinhood posted:
try code:
|
# ¿ Oct 3, 2017 12:16 |
|
unpacked robinhood posted:I edited in your loop declaration and changed the condition right after. That just means it's not the for loop initializing that's causing your bit problems. Your program is just not sending one or two bits to begin with. Starting upshifted 17 just means you don't send the bits you're missing, so you always start correctly. Look elsewhere for this problem.
|
# ¿ Oct 3, 2017 22:27 |
|
|
# ¿ May 14, 2024 10:39 |
|
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 |