[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Arduino General
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /diy/ - Do It yourself

Thread replies: 253
Thread images: 38
File: ArduinoUnoSmd.jpg (702 KB, 844x597) Image search: [Google]
ArduinoUnoSmd.jpg
702 KB, 844x597
TELL US OF YOUR PROJECTS!
TELL US OF YOUR EXPLOITS!

in other news I have a wired programming question.

I have a rotary encoder that'll be reading tens of thousands of revolutions at a time and a device which will send signals at irregular intervals.
I need to record and export the number of revolutions(to the single or half revolution if at all possible) between signals(and between startup and the first signal) onto an Excel spreadsheet.


does anyone know of a good Arduino to Excel interpretation and recording software?
>>
>>895179

Do you need the spreadsheet to be filled out in real-time? If not, Excel is capable of reading text-based files just fine. I think if you give the file a .csv extension it might just work automagically.

Does the Arduino have a counter circuit? You might need to buy one to work with the encoder.
>>
File: FB_IMG_1446082572451.jpg (1 MB, 2592x1456) Image search: [Google]
FB_IMG_1446082572451.jpg
1 MB, 2592x1456
Made a standalone with built in ds1302, 74hc595 for driving a LCD and triggering triacs. Uses an atmega328 and I program it with an arduino mega as ISP.
>>
File: IMG-20151028-WA0000.jpg (623 KB, 2592x1456) Image search: [Google]
IMG-20151028-WA0000.jpg
623 KB, 2592x1456
Also OP, your best bet is to read up on C# and the APIs that exist to interface it with excel.
>>
How can I get an arduino to pull data from the internet and act as a hid at the same time, so that I can type remotely?
>>
File: buspirate.jpg (557 KB, 2025x1350) Image search: [Google]
buspirate.jpg
557 KB, 2025x1350
Ive been playing around with using the buspirate as a programmer, was able to set the fuses on a bunch of loose atmega168s i have lying around, got em to use the internal clock. I'm having a heck of a time getting the ide to play nice with it, trying to make a board entry for it but so far something keeps going wrong.
>>
>>895338
No, it really isn't. Offline processing and importing is much easier.
>>
>>895336
nice isolation milling ;)
>>
>>895305
>Do you need the spreadsheet to be filled out in real-time?
yes
>>
>>895557
Reminds me of one excel-filling gadget. It simply emulated a USB keyboard.
>>
>>895557
you need to write (or purchase) an activeX control to do that
>>
>>895581
don't think I'm budgeted for that...
where would I find instructions on how to write one?
>>
>>895588
https://support.microsoft.com/en-us/kb/279721
>>
Does anyone have a recommendation for what Arduino I should look into getting for a simple job of reading a sensor, starting a clock when it is triggered, stopping the clock when another sensor is triggered, doing a simple calculation, and displaying it to a 16X2 LED display? I dont know what the cheapest option for these tasks would be or what to look for, any help would be much appreciated.
>>
>>895652
Any microcontroller will do that. Depending on how accurate your timings need to be, clock speed might be something to base your choice on. I'd go with whatever cheapest I'm already familar with.
>>
File: 11114-01a.jpg (195 KB, 600x600) Image search: [Google]
11114-01a.jpg
195 KB, 600x600
>>895652
Cheapest arduino I know of is $10, pic related. If you wanted you could buy a plain microcontroller chip for $1.50 and wire it up, but that would require some programming chops and equipment costing more than $10 (so, only worth it if you're making a lot of these).
>>
>>895652
Atmega8, buddy
>>
>>895670
>but that would require some programming chops

The cheapest arduino clone can be a programmer

Well, maybe not the ones that come with the CH340 usb chip, they can be a pain in the ass to get working
>>
>>895670
Are you not counting clones? Cause you can get a clone for 3 moneys.
>>
So I am waiting on the parts, but I am experimenting for the first time with piezoelectric sensors and force sensitive resistors for my arduino. Has anyone played with these before? And if so what can I expect as a general what will happen kind of thing? Like will I be able to measure the force or is it a on/off kind of reading? And how difficult is it to use and program these things?
>>
>>895880
The whole point of a force sensitive resistor is that it's sensitive to force. Whether the part you bought is suitable for your needs is a completely different matter. They work pretty much like a potentiometer, there's plenty of Arduino example code on the net.
>>
>>895338
>Two empty IC sockets.
>IC Directly soldered to copper.

Por que?
>>
File: photo24633338705848660.jpg (93 KB, 720x1280) Image search: [Google]
photo24633338705848660.jpg
93 KB, 720x1280
What I'm trying to achieve here is to make this servo arm to turn on the lamp by flipping this switch.

I've written the code to make it so it turns at 6am everyday.

The problem is the switch is hard enough for the arm to flip it. Any other idea how to achieve this?
>>
>>895927
Instead of controlling the switch mechanically, take out the jbox and directly control the power electrically using Relays.

https://www.youtube.com/watch?v=2q59Kqw4gaM

WARNING: This part is going to get rough and dangerous and CAN, likely WILL kill you if you don't know what you're doing. So study everything you can on relays until you know everything there is to know about the subjects involved.
>>
>>895927

I would attach something to the end of the servo arm. Maybe something 3D printed to fit.

Will this be mounted go the side of the wall. That is going to be really unaesthetic but it'll wake you up
>>
File: Failure.jpg (93 KB, 620x468) Image search: [Google]
Failure.jpg
93 KB, 620x468
anyone here who has experience with Arduino, LED and microphones. Try to create a sound reactive light but failed so far- mainly on the coding side that is
>>
File: IMG_20151101_161502599.jpg (1 MB, 2592x1456) Image search: [Google]
IMG_20151101_161502599.jpg
1 MB, 2592x1456
>>895921

The one that is directly soldered to the copper is a 595. I have dozens of them.

The empty sockets were for an atmega and a ds1302 which I reuse.

Also, check out this metaboard I'm making. Does it look like the work of a complete retard?

Because it is.
>>
>>896375
Could you post the code you've got so far and a slightly more detailed description of the project?

Am I correct to assume that you basically want to make a VU meter?
>>
>>895179
Does it really need to be an excel spreadsheet? If not you can just write to a CSV file. Excel can open those. Each line is a measurement in that case.

Otherwise there are Python libs for opening and modifying XLS files.
>>
>>895652
>Does anyone have a recommendation for what Arduino I should look into getting for a simple job of reading a sensor, starting a clock when it is triggered, stopping the clock when another sensor is triggered, doing a simple calculation, and displaying it to a 16X2 LED display? I dont know what the cheapest option for these tasks would be or what to look for, any help would be much appreciated.
If you only one one or a few, and can buy cheap off aliexpress:
...an Uno copy costs $2.60 with no USB cable (if you already have one) or $3.60 with a USB cable included
...a "LCD 1602 keypad shield" costs about $2.80. This has the 2x16-character LCD plus 5 buttons that you can program functions into (the sixth button is a hard-wired reset button)

depends on what kind of sensors you want to run also, and how long the wires are connecting the arduino to the sensors.... arduinos can have problems reading their own analog inputs under some circumstances, and I dont know how the generic-China 1602 shields are wired as I only have a couple from Adafruit, who builds their own.... there is external 4-channel analog/digital converter boards around for <$2 tho (search aliexpress for "PCF8591 AD/DA converter")

If you don't know much about programming, consider spending more and buying from a mainstream place (in the US, this would be places like Adafruit or Sparkfun). Their stuff costs more but they have better support for it.

The cheap China hardware usually works just fine--but a lot of the China places don't help with documentation or code samples.... And any code samples they do offer may not even work.
>>
>real time excel
Do you niggers even google?
http://www.instructables.com/id/Sending-data-from-Arduino-to-Excel-and-plotting-it/
>>
>>896434
>Microsoft Windows 98
>Microsoft Office/Excel 2000 to 2003
>May not work with newer software; no longer supported

I still don't understand why OP needs it in a spreadsheet; the date being recorded is just a bunch of distances with accompanying times. What cross-computations would ever be done between entries?

The simplest way would be to just have the PC print the distances into a text file with the accompanying time, one entry per line. This way you would just quickly scroll down through until you got to the time or the distance you wanted.

The other way would be to have the PC print a "text" file, but make the text file as HTML code. This way you *could* put the results into HTM: tables with row and column headings, as well as break the entire listing up into smaller intervals. It would be simple to view since clicking on it would open it in a web browser.

And either of the above styles could be easily imported into a spreadsheet, if you still needed to.
>>
>>896398

here's the code part 1:
#include "FastLED.h"

#define NUM_LEDS 50
#define DATA_PIN 6
#define CHIPSET WS2811 // make sure you enter the correct chipset
#define COLOR_ORDER GBR // and RBG order
#define BRIGHTNESS 250
#define FRAMES_PER_SECOND 30
#define COOLING random(1,10) // controls how quickly LEDs dim
#define TWINKLING 250 // controls how many new LEDs twinkle
#define FLICKER 5 // controls how "flickery" each individual LED is

CRGB leds[NUM_LEDS];

static int beatInterval = 100; // the interval at which you want the strip to "sparkle"
long nextBeat = 0.01;
long nextTwinkle = 3000; // twinkling doesn't start until after the sanity check delay
unsigned int seeds = 1;
long loops = 0;
long deltaTimeTwinkle = 100;
long deltaTimeSparkle = 300;
boolean beatStarted = false;
static byte heat[NUM_LEDS];


//// PIN and int for mic////
const int analogPin = 0;
unsigned long startMillis= millis(); // Start of sample window
unsigned int peakToPeak = 0; // peak-to-peak level

unsigned int signalMax = 0;
unsigned int signalMin = 1024;

///////////////////////////////////////////////////////////////////////////////////////////

void setup() {
// sanity check delay - allows reprogramming if accidently blowing power w/leds
delay(3000);
FastLED.addLeds<CHIPSET, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS);
LEDS.setBrightness(BRIGHTNESS);
Serial.begin(115200);
delay(100);
Serial.flush();
while ( Serial.available() ) Serial.read(); // this helps to clear out any junk in the UART
}

// Vocablulary lesson:
// Twinkling - when individual LEDs "ignite" then slowly burn out
// Sparkling - when a whole mess of LEDs "ignite" at the same time then burn out
// Flickering - when a lit led modulates it brightness to simulate the flicker of a flame
>>
>>896493
part 2:
void loop()
{
// Wait for something in the serial monitor before "Sparkling" the first time.
// This lets you time the sparkle to a particular beat in music.
// In practice, just type a letter into the serial monitor and press enter
// when you want the first sparkle to start.
if (loops == 0 && mx>1) {
nextBeat = millis();
}
else {
if (loops == 0 && beatStarted == false) {
nextBeat = millis();
beatStarted == true;
Sparkle();
}
else {
long deltaTimeSparkle = millis() - nextBeat;
if ( deltaTimeSparkle > 0 ) Sparkle(); // if more time than
}
}

deltaTimeTwinkle = millis() - nextTwinkle;
if ( deltaTimeTwinkle > 0 ) {
Twinkle();
}
FastLED.show(); // display this frame

while (millis() - startMillis < sampleWindow)
{
sample = analogRead(0);
if (sample < 1024) // toss out spurious readings
{
if (sample > signalMax)
{
signalMax = sample; // save just the max levels
}
else if (sample < signalMin)
{
signalMin = sample; // save just the min levels
}
}
}
peakToPeak = signalMax - signalMin; // max - min = peak-peak amplitude
double volts = (peakToPeak * 3.3) / 1024; // convert to volts

Serial.println(volts);
}


// This Twinkle subroutine creates a slow "twinkling" of the strip.
// It uses the same "heating" methodology as Mark Kriegman's "Fire2012"
// where pixels are "heated" and "cooled" and then the tempreature of
// each pixel is mapped to a color and brightness.

void MicReader()
>>
>>896494
part 3:
//////////////
//serial read mic
{
unsigned long startMillis= millis(); // Start of sample window
unsigned int peakToPeak = 0; // peak-to-peak level

unsigned int signalMax = 0;
unsigned int signalMin = 1024;

// collect data for 50 mS
while (millis() - startMillis < sampleWindow)
{
sample = analogRead(0);
if (sample < 1024) // toss out spurious readings
{
if (sample > signalMax)
{
signalMax = sample; // save just the max levels
}
else if (sample < signalMin)
{
signalMin = sample; // save just the min levels
}
}
}
peakToPeak = signalMax - signalMin; // max - min = peak-peak amplitude
double volts = (peakToPeak * 3.3) / 1024; // convert to volts

Serial.println(volts);
}
/////////////
void Twinkle()
{
>>
>>896495
part4:
// Step 1. Create a randome number of seeds
random16_add_entropy( random()); //random8() isn't very random, so this mixes things up a bit
seeds = random8(10,NUM_LEDS-10);

fadeToBlackBy( leds, NUM_LEDS, 150);
int pos = beatsin16(5,0,NUM_LEDS);
leds[pos] += CHSV( 130, 100, 200);


// Step 2. "Cool" down every location on the strip a little
for( int i = 0; i < NUM_LEDS; i++) {
heat[i] = qsub8( heat[i], COOLING);
}

// Step 3. Make the seeds into heat on the string
for ( int j = 0 ; j < seeds ; j++) {
if (random16() < TWINKLING) {

//again, we have to mix things up so the same locations don't always light up
random16_add_entropy( random());
heat[random8(NUM_LEDS)] = random8(50,255);
}
}

// Step 4. Add some "flicker" to LEDs that are already lit
// Note: this is most visible in dim LEDs
for ( int k = 0 ; k < NUM_LEDS ; k++ ) {
if (heat[k] > 0 && random8() < FLICKER) {
heat[k] = qadd8(heat[k] , 10);
}
}

// Step 5. Map from heat cells to LED colors
for( int j = 0; j < NUM_LEDS; j++)
{
leds[j] = HeatColor( heat[j] );
}
nextTwinkle += 100 / FRAMES_PER_SECOND ; // assign the next time Twinkle() should happen

}

// Sparkle works very much like Twinkle, but with more LEDs lighting up at once
void Sparkle() {
// Step 1. Make a random numnber of seeds
seeds = random8(NUM_LEDS - 20 ,NUM_LEDS);
// Step 2. Increase the heat at those locations
for ( int i = 0 ; i < seeds ; i++) {
{
int pos = random8(NUM_LEDS);
random16_add_entropy( random());
heat[pos] = random8(10,255);
}
}
nextBeat += beatInterval; // assign the next time Twinkle() should happen
loops++ ;
}

//Play with this for different strip colors
CHSV HeatColor( int temperature)
{
CHSV heatcolor;
heatcolor.hue = 50;
heatcolor.saturation = 40;
heatcolor.value = temperature;

return heatcolor;
}
>>
>>896496
the issue I have, is that the code without reading the mic is working fine. But somehow I can't bring the mic reading together with the LED -dohh. Thanks for any help or direction with that.

The idea is the following: To have a random low frequency sparkle (x-mas light) when the mic is registering sound it should create hot zones of brighter and more intense sparkle that's kind of the idea....thanks a lot
>>
File: pixy_arduino-290x195.jpg (13 KB, 290x195) Image search: [Google]
pixy_arduino-290x195.jpg
13 KB, 290x195
>>895179

For my University mechanical engineering undergrad capstone project, i am constructing a machine that can play ping pong. There is freedom to do lots of things, but i want to try and make it automated. We have a ridiculous budget of 250$ but i was planning on using a raspberry pi with a camera attached to an arduino controller. I'm hoping to program it to track ping pong balls and move a paddle to hit the ball.

This hasn't started yet and i have relatively novice arduino/pi programming skills. I've found guides where people have tracked ping pong balls using similar setups , and i'm pretty confident it cna be adapted to the device.

I haven't begun but i will soon. Feel free to input any advice you have.
>>
>>896683
I should note that if this doesn't work out, i'm just going to opt for remote control
>>
>>896683
The robotics to move the paddle will be your biggest issue, especially with only $250.
>>
>>896696

Yeah, I'm not planning to create a swinging arm. Just something with side to side and up and down mobility, probably using stepper motors.

We're allowed to exceed budget if we have our own money, and there are multiple teams in my class that opted to go for a catch and release system and as far as I know, mine is the only team designing a strictly hitting system.

We're in academia and we wanted to have a little fun with the design so we went with what i guess people perceive is the tougher option. I personally see benefits and drawbacks of both. I know the professors will be a little more likely to provide extra funding for a more exciting project that doesn't involve a net funneling balls to some kind of launcher.

The goal is to return ping pong balls into a basket on the other side of the table. The basket location on the table will be known as well as the origin of the incoming balls (aka the angles)

Basically im hoping to program the device to track and move the paddle to the ball. The hitting motion will be provided by a quick-return reciprocating motion mechanism. I want to control paddle angle by somehow programming it to track its location vertically and horizontally on the table so the angle can be adjusted automatically based on the location of the basket, the origin location of the incoming balls, and the physical position of the paddle.

Having to return the ball to the basket is tough, especially when hitting the ball, but I'll honestly be happy if the ball gets returned to the other side of the table.
>>
>>895880
You can do a lot with piezos but you have to do some analog interfacing, a preamp or such
>>
>>896400
>Does it really need to be an excel spreadsheet?
not really, those are just easier to manage.

>Python libs
what now?
>>
>>896498
>the issue I have, is that the code without reading the mic is working fine. But somehow I can't bring the mic reading together with the LED -dohh. Thanks for any help or direction with that.
I'm guessing here........
one possible thing--
I have a arduino mega reading some tmp36 temperature sensors through about 3 feet of cable, and (as far as I can see) if you want to use any the analog inputs, it is best not to use any of the other analog pins as outputs at all. You set the unused analog pins to digital-out and to a "low" state, so that they are grounded internally. The analog pins are multiplexed, and a digital input or output on any of the analog pins can mess up the analog reading you want to be accurate.
...additionally, when you change from one analog pin input to another, the first reading is often wildly inaccurate. So you take one reading, have a time delay of some sort, and then take a second reading. There is info about this on the arduino.cc forums as well as elsewhere.
...Also I set the four analog input pins apart, separated by an unused pin (set to digital out:low)... This seemed to help with the analog read interference. I spent a couple weeks trying to figure this out. No place says to do all this stuff, and I still have to throw out the wild readings (way too high) and adjust the zero-voltage offset value but I get useful results now.

TMP36's work just fine when connected directly with 3 inches of wire, I have another machine like that and it works 100% as expected.... but I needed about 4 feet of wire here, and the wire had to go through a slip joint as well. The TMP36 sensors and the arduino both have issues with analogRead() when you have longer wires involved.

...are you using a microphone breakout? all the "arduino" sound sensors I see have a little amp on there for the mic. You can't just connect the mic directly (apparently?)...
>>
File: unduino.png (528 KB, 589x584) Image search: [Google]
unduino.png
528 KB, 589x584
Hey guys, whats your experience on these chinese "Arduino" starter kits?
I would like to start with arduino but Im cheapskate. Is it worth to save some money on these? They are like 35 bucks. Is there any problem with IDE?
>>
>>896845
I've bought 7 chinese arduinos (5 Uno and 2 nanos) and all of them work pretty much perfectly.
>>
>>896845
I have a clone. It works.
>>
>>896845
That set? Most if those components are pennies each. The servo and stepper motor are $2 each, but you'll find lots of projects that use that servo because it's cheap. The MPU 6050 is a good gyro. And a breadboard is a breadboard. For the right price it would be worth it.
>>
File: IMG_20151103_242620323.jpg (939 KB, 2592x1456) Image search: [Google]
IMG_20151103_242620323.jpg
939 KB, 2592x1456
>>896397
Finished my board and managed to get the USB port in it working.
>>
>>896683
This is cool but going to be really hard. The vision component will be fairly hard to implement. Are you using OpenCv? You'll have to detect the speed of the ball, as well as predict its trajectory to anticipate the movement of the bat. Also what is going to hold/move the bat? You'll probably need some sort of large robot arm, the main challenge will be fitting this in your budget.
>>
>>895929
>directly control the power electrically using Relays

Solid state relay. Has all the zero crossing detection and thyristor drive built in. The low voltage input is basically the input to an LED in a built-in opto-isolator.
>>
>>896790
Have you tried reading the atmel datasheets or app notes? Confining yourself purely to the arduino world is extremely limiting. There are specific procedures necessary to get optimum results out of the ADC's (sleep mode, sampling frequency, source impedance).
>>
>>896498
finally got it working
with an adaption of a Mark Kriegsman's code:
http://pastie.org/10525963
thanks >>896790
>>
>>897177
as a mic I used the one from Adafruit....
>>
Im making a laser tag program. And something to help me stop walking on my toes. the laser tag has been being difficult. Im not even sure what is wrong with it, but it wont work...

The toe walking one consists of a shoe with a sensor on the toe and a sensor on the heel. if the toe is pressed three consecutive times without the heel being pressed, it beeps a piezo and (later versions) will add to a counter that tells me how many times it has been triggered. Cant get it to work right. I have the buttons set up as interupts. there is a variable "heelCount" and "toeCount" that is incramented in the ISR's. in the main program, it continuous.ly checks for toeCount to be above 3. but I cant get the variables to incrament.


tldr: tfw when nothing you do with arduino actually works, but the code makes perfect sense and you cant find out why it wont work
>>
>>897334
post code anon otherwise it only makes sense in your head
>>
>>897093
Can you program it with the usb or do you need to use an ISP(another arduino)?
And if you can use the usb how did you pull it off?
>>
File: fps-controller.jpg (25 KB, 500x500) Image search: [Google]
fps-controller.jpg
25 KB, 500x500
I'm trying to make a IIDX controller. Currently I'm using a leonardo to translate button presses into keyboard inputs but I'd like to transfer it to a breadboard/perfboard.

What should I use in place of the leonardo if I don't trust myself to solder anything SMD?
>>
>>897156
>Have you tried reading the atmel datasheets or app notes? Confining yourself purely to the arduino world is extremely limiting. There are specific procedures necessary to get optimum results out of the ADC's (sleep mode, sampling frequency, source impedance).
yea but it didn't help much. The main issue was that I needed the temp sensors 4 feet from the board. Also the sensors are mounted on a rotating drum and the slip joint added an unknown amount of capacitance to the lines.

Most of the 'digital' temperature sensors are I2C or onewire (that are timing-dependent) and I didn't want that either (didn't know about running it through the slip joint, and didn't want the primary task of the board being interrupted to read I2C data).

If this hadn't worked, next I would have just used another arduino mounted on the drum and wrote a wired communication scheme that was non-timed. This would be much slower and takes 5+ pins but works where many others won't. And it can be run as a secondary task in the code, since it doesn't use hardware interrupts.
>>
>>895929

The last time I checked, 120 only gives a brief shock. Why is it brief? because it hurts and you recoil away. The odds of it killing someone are slim.

Sounds like YOU don't know what you're doing.
>>
File: ctm64[1].gif (78 KB, 400x301) Image search: [Google]
ctm64[1].gif
78 KB, 400x301
>>897582
i would recommend using a midi interface. you can probably find one that uses USB instead of the 5 pin connectors
>>
Another option is to get a separate lamp, and splice a relay into the cord for the lamp. Or a box with its own cord, and a controllable socket to plug the lamp into... This avoids having to do anything to the building's wiring, since there may not be much room to work in the switch box or the wall behind it.

>>895929
>WARNING: This part is going to get rough and dangerous and CAN, likely WILL kill you if you don't know what you're doing. So study everything you can on relays until you know everything there is to know about the subjects involved.
I think the bigger risk here is.... burning your house down...
If you use a mechanical relay, the relay needs to be wired so that if the arduino/whatever controlling it shuts off or fails, the relay goes back to it's "off" state. Most of the mechanical ones are a SPDT switch, so you can wire it either way.

The Sainsmart relay boards require that the control pin be "high" to hold its relay -off-; I dunno why they thought that was better. It's more intuitive to have the LED turn on when the relay is turned on, == when the pin for it goes high. At least, IMO........ ?:>|

It is *possible* that the controlling board could fail and keep the relay turned on, but you can't plan for everything.

>>898100
>The last time I checked, 120 only gives a brief shock. Why is it brief? because it hurts and you recoil away. The odds of it killing someone are slim.
Yea, it's practically harmless. Nobody ever died from that.
>>
>>895652
if I had one and only piece of advice, it would be to never fucking use an arduino. It WILL stab you in the back.
>>
working on a webcam shape tracker. RPi finds the target with opencv, arduino drives servos and an actuator to aim a laser pointer at it and fire.

No real motivation other than wanting to see if I could do it.

Quick question if anyone is familiar with servos- I'm mounting a disc on a servo motor with its center axis parallel to the axis of rotation. I need a quick a dirty way to figure out how the weight on this disc (pressing down on the axis of rotation) will affect the torque. My guess is that it depends on the coefficient of friction of some internal gear, but I have no idea what sort of ballpark value to use. I'm using an all-metal gear mini servo rated for 1.5kgfcm at minimum voltage of 4.8v.
>>
File: second.jpg (67 KB, 599x597) Image search: [Google]
second.jpg
67 KB, 599x597
>>897482

It can be programmed through the USB connector.

I used the USBTinyBoard version of the USBAspLoader. I compiled it in Atmel Studio 7 after changing a few things (like the pins the bootloader uses for interfacing with USB), made a custom board profile in the boards.txt and uploaded it with an arduino I use as a programmer. When the PD7 pin is low and you reset it, the board will be recognized as an USBAsp programmer by the computer. It's pretty cool.

Now I made a second board just for fun and to learn how to make two atmegas talk via the RX/TX ports. I'm squeezing the PCB design so it'll be the same size as a regular arduino, or even smaller. it's currently the same size as a Mega.
>>
>>897482
By the way, the schematic I used is the same as the Metaboard.

The firmware code came from here:

http://matrixstorm.com/avr/tinyusbboard/
>>
Could you make a roomba clone using an arduino?

The basis idea I have would be to modify an existing vacuum cleaner with motorized wheels and somebody manually program a route so that the robot-vacuum follows this same path every time.
>>
>>896683
From experience, I can tell you that the RPi will struggle a bit with tracking. You will be able to track it but it will lag at the speeds present in a ping pong game.

Maybe consider an alternative in a foosball or air hockey game - you can exploit the single plane of motion to project the path of the ball and play at higher speeds.
>>
>>899552
>>896683
Is using a small crappy embedded processor a requirement?

If not, spend $50 of your budget on a second-hand Core2 or (if you can find one at that price) Sandy-Bridge.
>>
Like my ghetto arduinos, /diy/ ? They can even talk to each other through the serial pins.
https://www.youtube.com/watch?v=0yYvFPfD0N0
>>
>>895927
Mechanical leverage
>>
>>895179

What is the easiest way to get remote notifications from an Arduino for free.

I was thinking SMS via email but I am not sure how to send an email.

Or maybe a Twitter account that DMs me.

A lot of the straight SMS tutorials I have seen look to use non free solutions.
>>
File: 20151114_123152.jpg (4 MB, 3264x2448) Image search: [Google]
20151114_123152.jpg
4 MB, 3264x2448
Who /Duemilanove/ here? Stand aside Uno Rev3 newfags.

As for tricks/exploits, my advice is to abuse the stack locality of objects, this way you can save SRAM space and smash together bigger libraries.

Also, is it possible to use a Ultrasonic interferometer as some kind of radar?
>>
>>901699
>Stand aside Uno Rev3 newfags

Arduino in general is for fags
Grow the fuck up and use PIC
>>
File: low_quality_bait.jpg (2 KB, 125x125) Image search: [Google]
low_quality_bait.jpg
2 KB, 125x125
>>901965
>>
>>899929

Nevermind, I figured it out. I set up my server to send an email using PHP and just told the Arduino to call the file.
>>
File: 1366800928821.gif (704 KB, 245x230) Image search: [Google]
1366800928821.gif
704 KB, 245x230
>buddy's wife got him an arduino uno
>sits around unopened for two years
>one day us three are hanging out and we start talking about a robot that can cook food
yes i know there are robots that do that already
>decide to work towards making a robot arm that can cook eggs
>agree to meet on tuesdays to make progress towards this interim goal

We have finished the project book it came with and have been playing around with other parts we've bought. We think we are at the point where we can look for a robot arm to start playing with.

First off.... is this too much of a jump, are we going to fuck something up and ruin it? We are both engineer-types and he's a career programmer so we can handle a fair amount of complexity, but still...

Secondly, if we should be ok to handle this, what am I looking for? We only have an arduino uno board and the little bread board it comes with. Can we hook up an arm capable of lifting a spatula with an egg on it to what we have or to we need to get something more capable?

Third, what specs of this arm should I be looking for? Robotshop has a bunch of different arms with wide ranges of price. I dont want to have to buy & return like 4 or 5 to get the right one but I'm totally not in the know as far as... compatibility or... god I dont even know what I dont know


>trying to avoid pic related please
>>
>>903005

My suggestion with the Arduino.

A lot of the basic example code can be reused for larger projects.

The key thing is to consider what you need to do at its most basic level.

My example from the project I am working on. I am building a window alarm that will notify me via SMS or email if the screen is removed from the window. I bought some little wired magnetic sensors for this project.

The core, is identical to the sample "push button LED". A switch is triggered, an action is taken.

So I started with the push button LED, then replaced the "button" with my window magnet. They are both just toggle switches.

Then I replaced the LED On action with some code to get the Arduino to pull a PHP page on my server that was set up to send an email. Both are simply "an action to take".

A lot of things you do are like this. Like the robot arm.

"On Input, turn a servo".
You mentioned cooking, so you would need some delay timers, or maybe the input is a reaction to a temperature probe. The probe reaches a temperature, toggles a software switch, causes an action to happen.

Etc.
>>
>>903009
yeah, we expect to start with general timing of things like... let skillet heat for Q time, dump liquid egg, let sit for R time, spatula motion UVW to flip egg (or stir, whatever), delay S time, spatula motion XYZ to push egg off skillet (with a plate to catch it) theres more to it than that but you get the idea.

but we quickly, from there, want to then implement things like... infrared temp sensor to know when pan is at perfect temp, and when egg itself is at correct temp, or compare temp and moisture content of egg and then move on to next step, etc

We even considered stereoscopic camera setup to determine texture (maybe not for eggs but like... I dunno a cake or brownies or something) or a color sensor to detect when pancakes hit the correct 'golden brown' color.

Essentially we want to duplicate the process a human uses to determine when a certain step is accomplished
>>
>>903011
I am told by the internet Kinect 2 has a fairly robust computer vision kit, but you'd have to modify it and make some new rather clever software.

Which you totally might be able to do and that'd be great.

Judging cooking time is gonna be real hard. First goals would be identifying target position and coming up with a tool path to flip it, and a contingency if the egg is sticky or not flipping like it should.
>>
>>903011

I would think the idea would be to start with

> delay(xx)

Be for an action to adding a sensor, poling it, the adding something like

> if(eggtemp>xxx)

To trigger the flip. That sort of thing. Also you would add some general trigger variables to keep the action from repeating.

Call it "eggflipped", start it at 0, put a toggle that changes it to 1 when the flip routine runs.

You would also modify your if to include a check on what the state of eggflipped is (or maybe nested if statements, I don't remember if Arduino has an if(x && y) style feature.

This way, the senor reads the temp, once the temp is over what you want, then flip the egg, toggle the variable, so next round it says "yep, temperature is good to flip but the trigger says I already flipped it".
>>
>>903012
>kinect
lol thats exactly what we were thinking, thats excellent it can (seemingly, without researching into it yet) be worked with through a computer.

>Judging cooking time is gonna be real hard
you might be right but hopefully it'll be a matter (once we get the proper sensors in place) of telling it "when sensor hits X temp, do Y". Another example would be if we stuck a thermometer into a steak and know when it hits 145º it has hit 'medium' doneness, so remove it from heat.

>if the egg is sticky or not flipping like it should.
this is an excellent point (and further excites me to get to try this!) we hadnt thought of but this is gonna be triiiicky. This might be a good part of this project to impliment the kinect... if it can see there is still a certain amount of material stuck to the skillet, something like that?
>>
File: yep.gif (1 MB, 161x250) Image search: [Google]
yep.gif
1 MB, 161x250
>>903017
>mfw all that

i like it. not 100% sure on the answer to the code x & & y question but truth be told my buddy is the code pro. We just discuss the logic and he turns it into code lol.
>>
>>903011
I smell feature creep. Stay with the basics and iterate. Get your am working correctly with some triggers like timers (with maybe ultrasonic distance judging) and you can go from there. By the time you get that working, openMV might be commercially available. If you can't wait, you can use the OV7670 or an RPI instead.
>>
They force me to use it at school because programming individual chips is to complicated for baby engineers
>>
>>903180

Its the future, technology advances grandpa.
>>
>>903005
So, I called up robotshop and told them what I'm trying to do.

Even at $4000 they dont have an arm capable of moving the weight of a spatula/egg.

My mind is kinda blown desu. Am I mistaken the think that an arm is basically a handful of servos linked together by metal rods? How the shit does it cost more than 4 grand to accomplish this? A dinky little servo costs a couple of bucks. A more powerful servo just needs more robust components, its not like it needs fuckin diamond gears or something?

Am I looking at having to make my own arm??
>>
>>904081
.... and why is the abbreviation of 'to be honest' filtered to 'desu'.
>>
>>904081
>Am I looking at having to make my own arm??
probably, but it isn't that hard.
all you do is buy stepper motors with gear reductions on them. Each of these is used for a pivot of the arm. Base/rotate, shoulder, elbow, wrist X and wrist Y. All you would make is the "straight" metal parts of the thing, and the base....

You could use servo motors with gearboxes too, if you are rich. Outside of the RC world, servo motors cost a lot more than steppers. On aliexpress: a stepper nema23 single-axis kit costs ~$45, and the same-motor-size servo kit costs ~$150. (the motor and the controller for a servo are different than a stepper) If you want servos not-made-in-China, figure they'll cost at least 3-4 times as much.

Do note that an arm with gear-reduction motors won't move real fast. if you want a arm that is strong and can move fast, that gets a lot more expensive since the only way is to use bigger motors that don't need gear reductions, or use servos that can run the motors at much higher RPMs accurately. Either way costs $$$...

To control each stepper easily/directly, you need at least two pins for each (the step and direction pins). One enable pin can work for enabling all the motors. But that is 11 pins already, and an Uno only has 14 digital pins, only 12 if you want to use USB serial port monitoring. It might be good to move up to a Arduino Mega for this reason. It has 54 total pins, so running out of pins wont be a problem. Arduino Megas cost ~$9 on aliexpress, and the prototype shields are $3 (use one!). And you still may find a use for the Uno in this project.
>>
I bought an arduino kit (inb4 bad value) and I'm loving it all... until I got to the 8x8 dot matrix tutorial. The circuit is a lot more complex (so I'm sure I messed up somehow) and there's no description or instructions on what the IC chips do.... you just follow a schematic and plug things in and hope it works (it's not working)

I could look up the datasheet but this is just so much more complicated than the previous tutorials, the learning curve is fucked up. For the previous ones, I could follow the code and what was happening and I understood the theory, but the pdf explains nothing for this one.

What do I do?
>>
Could you post
without a trip
>>
>>904081

Actual, non-toy robots currently have two markets:

Manufacturers who don't really care if something costs $4,000 if it can keep them from paying a human $20,000+ a year to do it, and researchers who generally have budgets capable of buying your house several times over.

The rest of buyers for this kind of thing are fairly niche, which itself roughly translates to "expensive". It wouldn't cost you that much to make one...assuming you already have the equipment and skill to do so. You also have to remember that hobby servos aren't really very strong at all. The biggest readily-available ones top out at like 30kg/cm (or ~400oz/in). That might be huge for a flap or wheel at the end of a tiny lever arm, but that's barely 2lb of force, maxxed-out, at the end of a 12" arm.

You want manly arms, you need bigger motors. Either geared steppers or industrial servomotors. Neither is terribly cheap. Not super expensive, necessarily, but not cheap.
>>
>>904081
Something like this?

http://www.aliexpress.com/item/robotic-arm-6-rotating-machinery-mechanical-robot-smart-car-structure-pieces/867292620.html?spm=2114.031010208.3.38.SG1908&ws_ab_test=searchweb201556_6_79_78_77_80,searchweb201644_5,searchweb201560_9

If one isn't strong enough, have multiple working together or something stupid like that.
>>
>>904162
that type is still just using RC toy servos as the joints. It will be small and weak.

I would suggest using the stepper worm gear drives, they tend to have less backlash than the planetary drives and most places offer a range of reduction values, from 5:1 to 50:1 or more.
on aliexpress,,, figure ~$100 for a nema-23 and $150 for a nema-34 stepper motors. If you want servos, they would be at least $100 more each.
expensive, yes--but that's robotics for ya

>>904116
>I bought an arduino kit (inb4 bad value) and I'm loving it all... until I got to the 8x8 dot matrix tutorial.,,, (it's not working) ,,,What do I do?
Which kit is it?
>>
>>904116

The kits really are not a bad value for starting out.

You generally get a board, a bunch of components, and most importantly, some direction.

Yeah, you could go out and buy a cheap knockoff board and all the individual components online and find some free tutorials, bit just starting, there is a lot of value to having it all together and the convenience factor.

You wouldn't want a kit for every project, but to start fresh, the kits are great.
>>
>>904136
Youre forgetting tye assembly line choke points. Robots and people happily work together. But where a robot is needed to allign parts quickly and then the next stage takes a minute then moves on, you end up with the slowest stage in an assembly line becoming the coke point. For example, robots suck at installing consoles but excel at installing windscreens. Sure you can simply double up sections but space is also limitted.
>>
>>904083
No clue but it's hilarious "desu" "senpai"

>>904116
Is it a shift register? Those take parallel inputs and turn them into a serial output (or vice versa).

>>904136
Does he really need a nema 34 or even 23? This thing is just flipping eggs, =< 17 and reduction gears should be enough, no?
>>
File: IMG_20151021_114509~01.jpg (670 KB, 2006x2304) Image search: [Google]
IMG_20151021_114509~01.jpg
670 KB, 2006x2304
>>895179
This is basically something I came up with while reading a book on AVRs
It's essentially a clock, it counts till 9999 seconds, then it turns the all the D pins high. Just something I made without any use in mind, I am more of a software guy, just trying out micros for fun

Also is there a good book to learn serial communication? The book I have explains it really shit so I can't understand anything
>>
>>904608
Where does this sempai come from?
>>
>>904656
what board is that
>>
>>904661
Top left corner says ultra_avr.
http://exploreembedded.com/wiki/Ultra_AVR
>>
>>904656
Cool, why don't you bring it to the Whitehouse?
>>
>>904670
just as the syrians deliver the C4, i am headed straight to the white house :^)
Just hold it in your hands for 9999 seconds Mr Obama
>>
>>904608
>Does he really need a nema 34 or even 23? T
at least on aliexpress--almost nobody makes gear reductions (or rotary encoders) for nema17 motors, but a lot of places offer them on nema23 motors. so nema23 is kinda the starting point for better motor setups.
>>
Discovered that using a formula with exponents requires using the pow(xyz) syntax, otherwise it just ignores them. And the compiler doesn't catch this particular fuck up.
>>
>>904659
F a m
>>
>>904675
It always helps to know the language you're programming in.
>>
File: navigation_lights_figure_1[1].jpg (44 KB, 340x467) Image search: [Google]
navigation_lights_figure_1[1].jpg
44 KB, 340x467
>>904083
>desu
The more ornery boards saw it as a reddittism, and were getting really pissed off when people used it. Meanwhile, regular people were just using it and not trying to be le ebig bait. Thus every time that particular acronym got used, it derailed the thread into a massive argument about whether it was bait or not, and whether or not using it should be considered acceptable.

Easiest way to stop people using something? Wordfilter it.

(frankly, I like random desu appearing everywhere. It still works in context, and it makes the sentence cute and funny.)
>>
It's not an arduino, but I have a Raspberry Pi sitting around gathering dust and I don't have any ideas what to do with it.

I don't want to do the generic "make a file server" project, that's just lame.

Do any of you have a cool idea that can be done without spending money, like contacting ghosts using python and tinfoil antennas?
>>
>>904845
Same boat here. My model is an A+ (256MB, no Ethernet, but I have a working ethernet dongle for it). I also managed to get a 2600mAh battery pack for it. I was just going to get a couple of those LCD screens and run the Game of Life on them or do some realtime stuff, but I don't have the screens yet and all of the local RadioShacks closed down.
>>
File: 2015-11-22 13.49.41.jpg (3 MB, 4160x3120) Image search: [Google]
2015-11-22 13.49.41.jpg
3 MB, 4160x3120
>>904116 here. I forgot I made this post! I stepped back from the 8x8 dot matrix display as a whole and focused on understanding how a shift register works by itself. It's surprisingly easy!

I built this circuit to test it. I originally had buttons but I don't know how to debounce them so I was getting double/triple hits. I just replaced them with outputs from my uno and everything is working really well, except I think my breadboard is faulty. The output LEDs will erratically flicker in and out and I can "fix" it by touching the breadboard and/or the register.

I want to move on to the 8x8 dot matrix display but I think my second shift register is faulty, and I really don't trust this breadboard.

>>904464
It's Sunfounder's RFID kit. It's got a ton of neat shit but the PDF with the tutorials is garbage. Figuring out how a shift register works on my own was a billion times more insightful.

>>904577
I like my kit! I've just heard from a few people that ordering the components on their own and pirating an already solid book is a better plan, so I figured typing out that stuff in my original post would stop people from shitposting.

>>904608
Yeah! It was a shift register, and they're really great now that I know how they work.

>>904464
>>
File: ss (2015-11-22 at 07.02.06).png (67 KB, 1061x382) Image search: [Google]
ss (2015-11-22 at 07.02.06).png
67 KB, 1061x382
>>904936

HILARIOUS

Turns out 2 lessons later (after having you use shift registers blindly to control the dot matrix) they then teach you how the damn shift registers actually work by having you control a 7 segment display with them.

JOKES ON YOU I LEARNED IT MYSELF YA FUCKIN TERRIBLE KIT MANUAL.
>>
Has anyone used USBKeyboard.h? I'm having trouble getting it to... do anything?
>>
I want to make a robot that I can control with the gyroscope in my phone. Where would I start? I have 0 experience with arduino or robotics
>>
>>906737
With the basics. Divide you project into achievable goals that build up until you master all the necessary skills.
>>
>>904936
There is two ways you can do this: through hardware or through code.

There are discrete circuits for denouncing buttons. Look around online for schematics.

There are chips specifically made to de-bounce digital switch inputs. One is the PDN2008 or EDE2008.
Jameco sells them for ~$5 each, they are easy to use and each chip will debounce and stabilize 8 input lines ("stabilize" means that it holds them either very-low or very-high).

The code way is you use a timer to make certain that some certain amount of time has passed between presses.
There is the "semi-official" one here that relies on comparing the current button state with the previous one--
https://www.arduino.cc/en/Tutorial/Debounce
I don't like this example because it is mixing features--the "lastButtonState" variable is really the LED state, and storing the previous button state isn't necessary.
I prefer to use a single "gatekeeper" variable instead, since that way multiple buttons can use the same debounce function and you don't need to store every button's previous state.
I could put an example on github if anyone gives a shit.
>>
>>906785
A good overview of debouncing techniques:
http://www.ganssle.com/debouncing.htm
http://www.ganssle.com/debouncing-pt2.htm
There's tons of different ways to do it, especially on the software side.
>>
Hey, this thread isn't dead! I've done so many things since I last posted!

>>906785
Thank you kindly for this post. I'd really appreciate posting it if it wasn't too much of a hassle.

How... do I use github? I want to post the code for the project I'm just about to post. (read below)

-----------------------

I've made a rudimentary gamepad to control flash games, NES emulators, etc. using an arduino uno. I couldn't initially get HID to work so I'm using my arduino sketch to output strings to the serial on event triggers, and have a Java program to monitor the serial to then make keypresses with Robot.

It lags. Slightly, but noticeably. If you make a lot of inputs in a short amount of time, it gets backed up and executes them in order, which is generally after they've been triggered.

I can't tell if this is an issue that could be fixed in my code or if I need to ditch serial and move to HID entirely. HID would probably fix it but I want to make serial work!
>>
>>907144
https://gist.github.com/
https://help.github.com/
https://git-scm.com/book/en/v2
https://www.sourcetreeapp.com/

If you're sending long strings, serial can be slow. It also depends on the serial transfer rate, how the serial-to-USB converter packetizes the data, and how the Java serial interface works. What's the latency like if you use eg. PuTTY to view the serial data?

Also, if your Arduino program reads a single input, converts that into a string and immediately sends it over serial using polling, it'll probably be slow.
>>
>>906737
use one of those cheap bluetooth addons (ESP8255 IIRC)
look here http://www.instructables.com/howto/arduino+rc+car/
if you're really lazy, buy 1sheeld: http://www.instructables.com/id/Hacking-my-RC-Car-using-Arduino-and-Android-Smart-/
>>
>>895338
Any scripting language that has OLE support will work for that though. It's a lost saner dealing with it in python ruby or even perl IMO.
>>
File: FV74MKMGYH33EI6.LARGE.jpg (63 KB, 794x712) Image search: [Google]
FV74MKMGYH33EI6.LARGE.jpg
63 KB, 794x712
>>895670
>>895684
If you have a socketted arduino board, you can use it to program your chips, then:

http://www.instructables.com/id/The-RRRRRRRRRRBA-or-What-They-Dont-Teach-You-in-/

You can get a baggie of cheap chips then. Very cheap
>>
>>895927

just buy a phillips hue :^)
>>
>>895670

I bought a whole pile of Uno clones for $3 each on Aliexpress.
>>
>>907144
>Thank you kindly for this post. I'd really appreciate posting it if it wasn't too much of a hassle.
>How... do I use github? I want to post the code for the project I'm just about to post. (read below)

not github, srry. I meant pastebin. you can just copy & paste it off the page.
http://pastebin.com/bm8BjyT4

I get my generic arduinos on aliexpress as well, unos are $3 and megas are $9. All I've ordered have worked perfectly. They're even a bit cheaper if you don't need the USB cords with them. the unos are the SMD chips (not socketed DIPs) but at only $3 each they're basically disposable anyway.

the only 'bad' things I've gotten off aliexpress so far are the little MOSFET boards: they use an IRF520 or IRF540 mosfet that requires 10v to switch on--that an arduino can't put out.
You can use a 'mosfet driver chip' (for various reasons) but it's easier for casuals to just be able to hook the mosfet sig line right to an arduino pin.
I cut the IRF520 mosfet off and solder on an IRLZ34, and then they work like I want (the arduino can control them directly).
>>
>>908069

I had definitely considered aliexpress but the 4-6 weeks of shipping really turned me off. I might just fire off a mega order and forget about it, cuz I'm already experiencing the limitations of an uno. :(
>>
>>908096
>I had definitely considered aliexpress but the 4-6 weeks of shipping really turned me off.
they tend to estimate on the high side I think.
I live in the central US and don't think anything so far has taken longer than two weeks. A lot of stuff arrives in ~10 days.

The problem is in China--it can take a package 10 days to get out of China, and then only 3-4 days to get across the ocean and then halfway across the USA.

The shipping is hit-or-miss unless you specify the shipping method; I've bought $300 parts that were left on the doorstep and $2 parts that were shipped signature-required. Package tracking inside China tends not to work--or at least, not until the item *leaves* China.

The longest wait I've had was about a month, but this was an expensive part from the manufacturer and they had warnings about the wait time for small orders.
>>
>>908096
BangGood and DX have loads of cheap arduino stuff as well, and they tend to ship a little faster.

Usually. Not always
>>
>>908156
>>908165
I live in Canada, which might be worse. Thanks for the info, though!
>>
Hey, I am picking up how to use an arduino pretty quickly and am doing a really simple project to start off and was wondering about parts. For a section of this project I am making a chronograph for slow moving projectiles, like below 100 fps, and am using ir emitters and photoresistors. I have had no luck with the photo resistors part, the IR LED's light up fine but I cannot get the other half to work. Is there any other method to measure if an object has passed by a sensor for cheap?
>>
Hey guys gonna do an aquaponics project. Whats the best way to communicate between the raspberry pi and arduino?
>>
>>910126

I'd say the serial ports through a level converter, since Pi runs on 3v3 and arduino on 5v. Or just run arduino on 3v3 if you can.
>>
>>910126

I would say it depends on what you need them to say.

The serial mentioned is probably good. The temperature logger I built dumps data into an SQL database and I found the easiest way was to male the Arduino call up some PHP on the other end.
>>
Currently working on completely automating my homebrewing settup
>>
>>895684
>CH340 usb chip, they can be a pain in the ass to get working
they are not.
google ch340 and install the drivers.
just like ftdi.

the clones with the ch340 costs almost nothing.
the nanos are so cheap i hardly ever bother setting up a standalone anymore.
>>
>>907544
What about crystal & caps? Do these have built in osc.? Also decoupling caps are nice.
>>
>>910420
They have and indeed, decoupling caps would be nice. You can do without them pretty often, though.
>>
anyone know if there's a torrent of the recent humble bundle MAKE books?
>>
>>911842
You can pay a cent for like half of them. Quit being a cheap ass.
>>
>>911842

Oh sweet, a new one.

I get constant emails over their stupid subscription bundle but I never get emails for these Make Book bundles I will always buy. Way to go HB.
>>
I'm looking to get some home automation done over the holidays here. I want the garage door to be controlled via RFID, as well as relay all of my outdoor and garage lighting. Hopefully controlled via a small tft touchscreen inside the garage.
>>
>>912995

For the door, you should be able to relay off the opener you have. Attach some wires from the contact pads inside and run them to some pins on your board, throw some code on that closes the circuit on an external input.

Probably the sameish for the lights except you likely don't already have a button of some kind that you can relay off of.
>>
I actually have an arduino trinket that I am going to use to make some neato stage light things for my band.

Im incredibly new to electronics, but i've byoc'd a couple effects pedals and have a little understanding of how electronics works. I also code for fun as well so that part is coming easy.

Basically gonna use a 4 button foot switch hooked and use a 5 din cable to send the signals to the trinket, which will change the pattern which of the 4 buttons was hit. button 1 switches to all on, button 2 is alternating between front back, 3 is fast and random etc. The trinket will be hooked up to a 4 channel relay which will send the power to the LED lights. We'll see how this pans out.
>>
How would I get an arduino nano to control
a NTC 100k thermistor and a 12v 40w ceramic
heater cartridge. This is for a chicken incubator
so it will need to stay at a constant 37.5 degree
celsius
>>
File: IMG_20151212_232928.jpg (3 MB, 4208x3120) Image search: [Google]
IMG_20151212_232928.jpg
3 MB, 4208x3120
>>895179
What the fuck am I doing wrong here? It's just the included 'hello world.'
I changed a few pins around, following adafruit tutorials to the T. Checked all connections. Checked my shitty soldering.
>>
>>914141
> Read output of thermistor on an analogue input pin.
> Get relay rated to switch the total load of the heater.
> Use digital output pin to switch relay.
> Code mega so that if thermistor measurement falls below preset the relay is activated, if it goes above the relay is switched off, thus controlling the heat.

The individual routines to do each part are covered in the tutorials, shouldn't be too hard to kludge it all together into a workable program.
>>
>>914282
>mega
Oops, arduino, I was using megas before they started wrapping them in dev boards, force of habit.
>>
>>914279
can't see shit in that picture. looks like your screen is powering on? soldering looks okay. probably has something to do with the wiring but your photo has wires covering the pin labels.
>>
>>901699
>Also, is it possible to use a Ultrasonic interferometer as some kind of radar?
Not radar, but sonar. And maybe. Do you have more information on the interferometer in question?

I was toying with a similar idea; I wanted to try making an Arduino-based sonar/echolocation rig capable of ranging, direction determination and perhaps even doppler analysis. My first idea was to hook up a speaker and two microphones directly to the Arduino and drive/process everything on-board, only to realize that the Arduino really isn't capable of sampling fast enough to read ultrasonic waveforms directly. On top of that, although I'm quite familiar with radar/sonar concepts, I'm fairly new to Arduino and such a project would likely be too much for me anyways. So instead I went and bought an SR-04 ultrasonic rangefinder module to screw with for the time being (quite limiting compared to what I had originally hoped, but it's a start).

I also found a REAL 10.5 GHz doppler radar (not sonar) module (https://www.openimpulse.com/blog/wp-content/uploads/wpsc/downloadables/HB100_Microwave_Sensor_Application_Note.pdf) for fairly cheap (~$10), which apparently has a signal mixer built in so that all the interferometry happens internally and only the doppler shift itself is output (<1 kHz, easily sampled by Arduino). The catch is that the signal is very low voltage and requires a good bit of custom circuitry for amplification and filtering before it can be made readable. Additionally, there is documentation on operating it in pulse-doppler mode, but I'm unclear on how one would extract range/time-of-flight data from the module, or if it's even possible.
>>
>>914303
Thanks, will take a better picture after in done with my 10 hour masturbation session.
>>
what potentiometer would i need to be able to change the temperature a 12v 40w ceramic heater cartridge or how could i use an arduino to control the temperature of it ??
>>
>>914677

The analog PINs of an Arduino can do that if you hook up a solid state relay to it.
>>
Soldered the Trinket Pro (Weird hackaday.io version I found on amazon). I'd say my solders aren't nearly as bad as I thought they were going to be considering how little experience I have.
>>
I'm building a digital accelerometer from an ADXL335 chip, a 128x64 graphical LCD display, the arduino UNO and some buttons I have lying arround. Will be my first arduino project. Any ideas / tips / uses for this? There is very little seismic activity in my area (germany) so using it as a seismograph would be pretty pointless
>>
>>914929
Not bad for a first time.

A3 and A5 pins could use some touch-up though. Try not to leave open holes.
>>
File: IMAG0585[1].jpg (1 MB, 1836x3264) Image search: [Google]
IMAG0585[1].jpg
1 MB, 1836x3264
>>895179
well, since I'm done with finals, and have nothing with work until tomorrow, I'll try to finally get this running.
>>
>>915528

and A4 has all the characteristics of a cold solder joint, based on shape and color.
>>
so i'm making a circuit involving leds as outputs and pushbuttons as digital inputs

I want to use the pushbuttons as a counter, so if you press one 5 times it counts 5, and the other counting every 1 push as a ten. I've done really basic stuff so far but nothing involving many parts.

So my question is do I connect every part to an individual digitalinput pin, and then to ground? or am i doing something wrong. I just want to know since I don't want to end up ruining any parts or my arduino for that matter.
>>
File: 20151216_173133.jpg (2 MB, 3264x1836) Image search: [Google]
20151216_173133.jpg
2 MB, 3264x1836
>>915884
pic related
>>
File: smile-07.jpg (2 MB, 4264x2800) Image search: [Google]
smile-07.jpg
2 MB, 4264x2800
>>915885
>pic
>>
>>915885
You shouldn't need external pull-X (down/up) resistors for microswitches on the Arduino, since it has internal pullups.

See the Arduino tutorial on how to use the DigitalPins. Should give you info on the Arduino's internal pullups and how to use them.
https://www.arduino.cc/en/Tutorial/DigitalPins

As far as making the physical connections, what I would do is use the Arduino internal pullup configuration, then with the microswitches, connect one end directly to ground, and the other directly to the Arduino.

One trick to learn: With those microswitches, they have four legs, and it may be difficult to know which legs make a connection when the button is pressed. Follow this simple rule: Opposite corners.

For example, on the switch on the left: E20 and F18 will connect when the button is pressed, also E18 and F20. On the right, E15-F13, E13-F15.
>>
>>915917
whats wrong with saying pic
>>915921
thanks for the lengthy reply, ill try and fix it
>>
So I am trying to make a simple circuit with IR LEDs and a few other pieces and they output things to an led display. I am individually testing the pieces and coding but I can't get the IR code to work. It is currently set up that when the IR is disrupted an led on the side turns on. When I try and do a simple code to return a 1 if obstructed it ends up not reading anything. I am just doing a digital read and don't know if there is a better method for this or if there is a better circuit to use or anything.
>>
>>896375
you technically don't need an arduino for this. I was able to get away with doing with an amp some relays and some christmas lights
>>
>>895179
i explained it here >>916522
>>
>>895336
>curved tracks
It's 2015
>>
>>895179
I did a very basic weather station a few weeks ago. For logging I just formatted the data on the arduino for a tsv file, sent it through the serial port, and wrote a simple python script to dump what it receives into a tsv file.

Then I'd just make a copy and open in excel and save a copy as xlsx if i needed to do anything complex.

Not very slick, but simple and got the job done.
>>
File: inhand_zpsb2d6b768.jpg (90 KB, 700x525) Image search: [Google]
inhand_zpsb2d6b768.jpg
90 KB, 700x525
>>896683

I have updates for this project!

Things have changed. I've decided to opt for a Pixy. Pixy can process video at 50 FPS. It's pre programmed to track colors. Which is great because the ping pong balls are bright orange. It's also meant for arduino. Weeee.

However, I need to give Pixy depth perception. Well to do that I need to calibrate it with the ping pong balls. Basically to find out how many pixels a ping pong ball takes up at different distances from the camera. I will do this and develop an algorithm for pixy to see X, Y and perpendicular to the plane of view.

Using this I hope to predict the final point of the ball within the plane of contact using projectile motion analysis in real time. This step will take 4-5 frames or about 100 ms. Then the paddle will take this input prediction and use stepper motors to move in X and Y and position the paddle. Encoders may be needed but i'm hoping i size the motors right and can just use inputs to track robot location.The Paddle is a belt driven rod mounted large square and will have a 6-8 inch throw at about 4-5 ft/second which is enough to return the ball to the farthest point on the table.

If anyone is even following this. Kudos. I may start a thread later as we start building and testing. Maybe ill make youtube videos. Who knows, I'm planing on wiring up a few motors over break and calibrating the Pixy so details will follow!

TLDR
Pixy sees and thinks fast. Making a robot that will see and play ping pong (maybe poorly but somewhat capably)
>>
>>915548
>>914929

Drop a small .... droplet of flux on A4 and touch it with the iron. The joint will look nice and shiny. If you don't have flux, go get it.
>>
File: IMG_20151219_215005174.jpg (1 MB, 2592x1456) Image search: [Google]
IMG_20151219_215005174.jpg
1 MB, 2592x1456
>>916771

They were just regular 45 degree tracks and then I applied Eagle's version of "fillet" on them. The real curved tracks of the past are a thing of beauty, but they're a bitch to make.


Alright, /diy/, let me tell you what I'm thinking.

The first thing I want to do is just a small project to test out the cheap ass NRF24L01 modules. I'll build a board to host the radio module. It will contain an AMS1117-3.3 regulator and a few other things. It will be connected to the main board (my home made arduinos) very much like what you see on the board on the left. Then I will use that first assembly to control a second board, but this one will in turn be connected to a board with a few relays or some thing else. The board with the relays will also transmit sensor information to the controller board. They're both based on the Atmega8 MCU, but I have a few 328's in case the flash memory isn't enough for the program.

The second thing I want to do is the following: I'll buy some DIN rail supports for PCBs. Maybe a DIN enclosure as well. I'll make an Atmega PCB where I will connect an USB to serial converter, and a few triacs. The triacs will then be used to switch big ass AC relays or contactors. The board will then be connected to an old laptop or netbook computer, and that thing will run a server, and it will allow me to control the relays/contactors over the interwebs and so on. Maybe I won't use a netbook, maybe I will use a raspberry PI but old netbooks can be had for free. I think you get it, don't you? Yes you do do, you're pretty smart. Now, since everything is mounted on DIN rails, I'll be able to sell it as a solution for controlling/automating an hydroponic installation. If add a slot for a 2.4ghz radio on the relay-controller-board, I'll also be able to use that radio to receive information from other 2.4ghz devices (that I still need to design), like temperature, lighting, humidity, water level and pH sensors. It will be so cool, guys.
>>
>>917039
Given how ping pong balls travel (curves ect) you will probably need to calculate trajectory continuously. There is also the matter of the bounce on the table. You have to inflect your calculation

Another thing to consider: Will the ball have any blur in the frames at its travelling speed?
>>
Still waiting for my stepper motor drivers :^(
>>
File: ssr.jpg (118 KB, 1200x1200) Image search: [Google]
ssr.jpg
118 KB, 1200x1200
>>917341
these are the shit, don't need any relays and switch them with low voltage.
>>
>>917399
Depending how quick the robot itself is, a simple linear extrapolation repeated over and over with each new measurement might be good enough. Heatseeking missiles effectively do this using proportional navigation (since they can't measure range to target, only direction), and it's still more than good enough to score direct hits on maneuvering targets.
>>
>>897334
The volatile keyword is important in C for embedded systems.

Any variable that is modified in an ISR (or otherwise external to the main body of the code) should be specified as volatile so that the compiler does not look at the rest of the code, see that no modifications are made to the variable, and then optimise it to just be a constant. The volatile keyword lets it know that YOU know it will be changed elsewhere.

I know you probably won't see this but it is was first occurs to me as the likely issue and this might help others as this is something many tutorials etc skip over.
>>
>>918159
It can do worse than that: it can notice that none of the code that depends on the variable changing from what it's first set to actually does anything, and outright remove it. Then remove any code only it calls. Then remove any constants only that code accesses.

http://blog.regehr.org/archives/213 should be required reading.
>>
>>918159
Also, if the variable is wider than the CPU registers (eg. a 16-bit int on an 8-bit AVR), interrupts must be disabled when accessing it, to prevent the ISR from modifying the value in the middle of an operation.
>>
>>914279
That soldering doesn't look good to me. It should form a tent on the pin, not a blob beside the pin. Did you use flux?
Take a look at >>914929
>>
File: 190qxjgphytnfjpg.jpg (49 KB, 800x445) Image search: [Google]
190qxjgphytnfjpg.jpg
49 KB, 800x445
Anyone here use a water sensor?
I was thinking of making a device that detects and alerts me when basement is about to flood so I can either turn on the sump pump on or even better turn it on automatically.

Thoughts?
Pic semi related, I don't want to ride a moose in my flooded basement to get to stuff lol
>>
>>919627
Why doesn't your sump pump already have a float built in?
>>
>>919636
Yeah, but the pump is unplugged until we need to use it. The reason is because is we have to connect and then run the hose outside and down part of the hill. We can't leave that thing chillin it in the yard all year.
>>
>>917039
Wouldn't it be easier if you place second camera above the table ?
>>
>>896397
How did you get a dog on there
>>
>>917399

What will cause curves is the spin. Projectile motion analysis can account for the bounce (coefficient of restitution) and the final location of the ball but it cannot accurately predict a balls trajectory with significant spin. In hopes to mitigate the effect of spin, the "paddle" on the robot will be much larger than a traditional paddle. Ultimately the professors will dictate the spin setting so I may need to figure out a way to account for it real time if they decide they want a lot of spin. I don't have a solution for that yet.

The trajectory may not be be able to calculated continuously because the camera will be mobile after the prediction stage. I haven't thought of a way to program it to continue prediction while it's moving. It's not impossible but I believe it will require a lot of feedback from encoders at the motors.

I have not mentally accounted for blur yet at this stage. It may be a problem but the largest velocities seen by the camera will be in the direction towards that camera so hopefully blur will be minimal in terms of pixel count variation. It may mess with calibration though on the extreme ends of the spectrum where it can blur such that the ball appears bigger and closer than it actually it. I'll need to investigate more camera specs.

>>919644
It would definitely be easier to track the ball that way for sure. This would even solve the above problem and account for curvature of the ball realtime. However, I don't believe my budget would allow a second camera and also no part of the device can extend beyond one quarter length of the table. This camera will need to be at the halfway point over the table high in the air. There are also size constraints on the device. It must initially fit in a 24"x18"x18" box. It may fold out or extend afterwards however. Under the project constraints, a second camera is not feasible.
>>
>>895179
Had to do this exact thing for a project in school. We just used LabView to record the data and then plopped the generated csv file into excel
>>
>>917039
What university are you at? I'm in a Bachelor of Technology program at McMaster University and I have a capstone project to do next year with the exact same budget. I'm still not sure what I'm going to do for mine. Best of luck to you, it sounds awesome!
>>
just got a vilros Ardiuno kit.

I really don't know what to do with it.
>>
Im building a green house next year and thought of using one of these to make an automated watering system
>>
>>917767
>use a *relay
>dont use a relay!
>>
>>920396
They're not actually relays, dumbass.

Just like resettable fuses don't have fuses in, and flash disks don't actually have disks in.
>>
>>920471
>resettable fuse
circuit breaker
>flash disk
flash drive

>dont have relays in them
but they are themselves relays, they relay a signal between two circuits.
>>
I'm helping my dad out with his orchard. It's a pretty sizable orchard with a bunch of different types of trees. I'm designing the irrigation system and will probably control it with an arduino.
>>
>>920471
It says relay right on the side of it..
Fucking illiterates trying to act like EE's
>>
Hey guys, I am about to get into this stuff pretty soon, but I wonder what kit should I order, is there something to look out for before purchasing ?

Also can I do some coding in C# ?
>>
>>920880
No C#. There's some Arduino-like board that uses the .NET micro edition framework, but you'll have to do the research on that yourself. If you want to get into microcontrollers, learning C/C++ is pretty much mandatory outside of some very niche platforms.
>>
I've been getting to grips with the HD44780 LCD. I've been generating custom characters - I made an LCD class with the functionality, including a function to create a character, that took an "address" (multiplied by 8, then combined with the CGRAM address, then two unsigned longs for the 8 bytes of the graphics. This was called 8 times at the start, to define some characters.

A strange glitch appeared, where the second character was corrupted. One line (5 bits) had been duplicated.

I played around a bit and discovered that changing the type for the address argument from byte (it's only between 0 and 7 anyway) to unsigned int moved the error along to the third character.

I then randomly changed the order of the calls (the 8 calls that define the characters), same definitions, just now executed in a different order.

The error moved to another character - it was always the second call, no matter what order they were done in. Everything I did, just seemed to make the error simply move to another character, but never eliminating it.

I finally changed the function to accept four unsigned shorts, rather than two unsigned longs, but I'm not happy with this. It's almost defeating the purpose.

It seems to be some sort of error in the function calling but I'm stumped. Any ideas?
>>
>>921054
I should add that, before I made this function, I was defining the same characters by explicitly sending each byte to the module - and it worked fine. The error only emerged when I made a specific function for it.
>>
>>921054
Show the code.
>>
File: code.jpg (106 KB, 500x733) Image search: [Google]
code.jpg
106 KB, 500x733
>>921059
I'd deleted the old code, so I just quickly rewrote it and compiled - same error. Here is the "reconstructed" offending code.
>>
>>921067
When I changed it to four unsigned short ints, then it seemed pointless having four for loops that each iterate twice, so I just made it explicit with each byte.
>>
>>921067
>>921070
I realise masking them with 0x1f is unnecessary but it's not the source of the problem. I actually put that in to see if it would make any difference. The things you do when you're stumped eh...
>>
>>921067
Would this not be a great use-case for a byte array, initialised using byte literals, and indexed by, well, indexing?

What's with all the bit-bashing in code that's run precisely once? Why use two parameters to represent what's actually one parameter? Why not delegate the grunt work to the compiler?

>Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?
-- Brian Kernighan
>>
>>921085
I don't want to pass an array. I want to do it this way and I should be able to.
>>
>>921054
Are you absolutely, positively sure you're following the timings in the datasheet?

Because this is sounding like the computation is correct, and the interface with the peripheral is racing.
>>
>>921080
Where's the code for setCgRamAddress?

ps. Shifting by 3 will not be faster than multiplying by 8 (the optimizer will produce identical code). Prefer clarity over useless micro-optimizations.
>>
>>921088
>Are you absolutely, positively sure you're following the timings in the datasheet?
I did a lot of playing around with the millisecond delays, even adding some here, taking some away there, etc. Nothing changed.

>>921090
Fair enough, I do have a lot of strange habits. I did wonder if it would produce identical code actually.
>>
>>921090
>Where's the code for setCgRamAddress?

void setCgRamAddress (byte addr)
{
writeLCD (CMD, (0x40 | addr));
}

Provided that addr < 64 (it can only be as high as 56 as 7 is the highest "address") then it should be fine right?
>>
>>921090
>Prefer
It's weird when people use the word "prefer" in the imperative.
>>
>>921092
It's probably better to make "disp" statically allocated. Dynamically allocated memory should be used with care in embedded systems, and on something like an Arduino there's probably not a lot of heap memory anyway.

Also consider putting the initialization data in const arrays and just passing the pointers around.
>>
>>921090
nothing wrong with shifting when you are trying to achieve a bit shift
aren't you anon?
shifting to move address bits or something?
its the comment that is misleading.

not that i can help your issue i don't understand what you are doing, you are defining custom characters but one nibble should be the row address and one nibble should be the row data?
i'm too drunk sorry.
>>
>>921102
>you are defining custom characters but one nibble should be the row address and one nibble should be the row data?
I'm trying to send 8 bytes over 2 32 bit integers. The first parameter sets the cursor to the custom memory bit you want , then the 8 successive writes all increment the cursor automatically.
>>
>>921102
>nothing wrong with shifting when you are trying to achieve a bit shift
If the OP felt the need to add a comment next to the shift, explaining why it's there, the implementation is masking the intention of the code. Replacing the shift with a multiplication makes the intent clear, and removes the need for the comment.

>>921099
It's a perfectly valid use, and it's also a guideline rather than an absolute rule.
>>
>>921107
i disagree, the comment refers to the addresses themselves being multiples of 8 rather than explaining that he is multiplying by 8.
saying multiples of 8 was pretty much the most concise way to get this across, arguably vague but if you read the datasheet its clear.
i would go so far as to say that the sole reason its there is for the authors piece of mind because of the difficulty he is having in getting it to work and not really to explain functionality at all.

criticise the comment if you want but changing this to a multiply confuses the intent rather than clarifies it.
>>
>>921115
You're arguing just to be contrarian.
>>
>>921087
Why do you want to do it that way?

It's not a 32-bit processor. You're needlessly making the compiler do 32-bit emulation, when it would be simpler and clearer to use the native word-length.
>>
>>921115
They're really offsets into an array of character RAM. You're effectly writing

offset = index * sizeof(glyph)

It just so happens that sizeof(glyph) is 2^3.

You usually multiply array offsets, because most of the time they're not a nice power of two, and there's no point doing it differently when they are.
>>
>>921087
You can, but it's inefficient. The compiler will have to generate a lot of unnecessary extra register-shuffling code. It's worth having some idea of what kind of code the compiler will generate for different constructs.
>>
>>921126
no im arguing because i would write it as a shift and i would advise others to if asked.

>>921136
>most of the time they're not a nice power of two
its a bit offset
so yes it will always be a power of two.

my understanding is that adr is the high bits of the address, i was under the impression that the low nibble was set by the user but anon kindly clarified that the low nibble was incremented automatically.
so essentially the operation serves to move the high bits of the address to the correct offset in the address register.
if you were doing anything else, as you suggest calculating an offset, then i would agree with you but thats not the way i think of this particular operation as functioning.
>>
>>921165
You have poor taste. Code that needs comments is code that should be improved.
>>
>>921173
i shan't repeat myself
>>921115
>>
>>921165
>its a bit offset
>so yes it will always be a power of two.
No, it's a sizeof() offset, so it's only coincidentally a power of two.

If the characters were nine lines tall, it would be a power of three.
>>
>>921131
>It's not a 32-bit processor. You're needlessly making the compiler do 32-bit emulation, when it would be simpler and clearer to use the native word-length.

Ah really? Yeah I wish I knew more about the Arduino in that sense, but the "manual" that comes with it is useless for anything. There's the official site, but everything is spread around. I just want one page with all the relevant tech info.

Still though, I should be able to do it this way. This code gets called at max 8 times once (at startup), and I honestly prefer it to using an array. If the system allows unsigned longs, then I should be able to use them.

Oh, and I managed to fix the error by adding a dummy int parameter after the addr. Bit of a botch but hey.
>>
>>921115
>i would go so far as to say that the sole reason its there is for the authors piece of mind because of the difficulty he is having in getting it to work and not really to explain functionality at all.

No it's that I'm normally quite an anal commenter. But I usually wait til the code is working before I go all-out.
>>
>>921323
i suppose
but it would never be done that way
because thats fucking retarded
characters are 5x7 or 5x10 but mapped as 5x8 or 5x6
hmmmm i wonder why. possibly because that's how pretty much every digital (binary) system ever invented works
what a fucking rigmarole it would be to have to raise to an non binary power just get a high byte to address memory? in an embedded system? are you out of your mind?
>>
>>921353
>5x6
5x16
>>
While we're on the subject, why can't I see any difference between 5x8 and 5x10 modes?
>>
File: image.jpg (33 KB, 570x751) Image search: [Google]
image.jpg
33 KB, 570x751
>>921356
I would imagine it's because your display only has eight physical rows.
>>
>>921353
>what a fucking rigmarole it would be to have to raise to an non binary power just get a high byte to address memory? in an embedded system? are you out of your mind?
That's why you don't use l/r shifting in the first place.

If you want to save ~40% on your storage requirements for a 5x10*, you throw out the six blank lines, and generate the the address by (<base> + <offset>*10).

Multiplication is not expensive. Even if you use a precomputed lookup table, you're still only wasting two bytes per character instead of six.


*(ON AN EMBEDDED SYSTEM!!!!1!!1)
>>
>>921366
Remember that this is an eight-bit processor, so memory access is granular on eight-bit word boundaries, not thirty-two bit words or 4k cache-lines like on x86.
>>
>>921366
>If you want to save ~40% on your storage requirements
but that isn't how this particular ic operates, it clearly divides memory into banks of 8 or 16. why does it do that? because the hardware to increment the address pointer is no doubt implemented on chip as a shift because its cheaper in both processing time and on chip space even when the wasted memory is accounted for.

there is no point in bringing up memory storage efficiency because it is not supported with this particular peripheral controller

if you want to do a multiply then nobody is going to stop you, all i said was that for this particular application i find it misleading to prefer a multiply syntax over a shift because of reasons of clarity. the reason being the shift better represents how the addressing is manipulated and handled by the display controller.
>>
>>921378
How the controller arranges data internally is an implementation detail. You can't make it more clear that you're generating a multiple of eight than multiplying a value by eight.
>>
>>921384
the entire class is an 'implementation detail' when we are talking about communication with this device.
if multiplying the value was the intention then of course, but it was not, the intention of the operation was to move the high address pointer to the correct position and allow the driver to control the low nibble.
>>
>>921363
Ah right, that's probably it, looking at it. Don't know why I didn't think of that. Probably too busy thinking about the Arduino's call stack.
>>
I'm making a byteOut class, which is a base class from which two other classes are derived, one to use a shift register to emit a byte, the other to use 8 Arduino pins in parallel.

I've made the output method virtual, so each derived class creates its own, specific to how the byte is output.

Thing is I keep getting this "undefined reference to vtable" on the base class.

I found a page where someone fixed it by declaring an empty method for the baseclass but A) that doesn't work on mine, it just does nothing when out () is called and B) isn't the whole point of a virtual method that you leave the implementation to the derived class?

Why does it complain that I haven't defined a method that, by definition, will never be used?
>>
>>921870
you should implement the function in your base class then override it in the derived classes

if the base class function doesn't do anything because it wouldn't make sense to then thats fine, its called a pure virtual method or function.

but it needs to be there.
>>
>>921965
>implement the function in your base class
not 'implement'
just define.
you know what i meant
>>
File: IMG_20151229_215851187.jpg (1 MB, 1456x2592) Image search: [Google]
IMG_20151229_215851187.jpg
1 MB, 1456x2592
>>917341
Weee! My plan worked on the first try! Now I only need to do something useful with the rf24 radios
>>
>>921986
Those esp boards are a blast. I'm still stuck on changing the pwm modes though. Not sure if the toolchain/docs have improved in that area lately.
>>
>>922010
Just got a better look, and realized that's not an esp8266. Silly me.
>>
>>921965
But when I do that, it compiles, yes, but the whole thing malfunctions. It's to control an LCD and all the black squares appear. I've worked around it, code wise, for now. The classes barely differ code wise, so I just made 2 variants copy/paste.
>>
>>922028
>but the whole thing malfunctions
well that's probably because you wrote it wrongly then?
post code.
>>
>>922043
It's on the other computer. I do that tomorrow but I'll say this: it's like the functionality is being "underridden" - ie the empty method in the base class seems to overwrite the one in the derived class.

I know the display logic works, it's just when I try to object orientate it, it goes funny.

Until tomorrow...
>>
>>922080
You have to declare the method in the base class virtual. It is not enough to do it just in the derived class (in fact, if the method is declared virtual in the base class you don't need to repeat it in the dervied class - but you should, because it makes the code easier to read.)
>>
>>895927
No X10?
>>
File: 1432226315429.jpg (42 KB, 500x352) Image search: [Google]
1432226315429.jpg
42 KB, 500x352
Uh for school I made a barcode Reader and Uploader, I could get the barcode information uploaded as a status to thingspeak but I never got it to go to IFTTT and print the status out on like evernote or somethign
>>
Why are you still using Ardweeno when the Raspberry Pi Zero is 5 dollars
>>
>>924270
They're two different things
>>
>>924318

not really

I mean they are both just boards built around a chip that have unpopulated I/o, right?

the only difference is the raspberry pi has a 1 ghz clk and a HDMI port
>>
>>895557
.csv format. Comma separated spreadsheets, Excel compatible.
>>
>>924322
Arduino is for prototyping circuits. Rpi is a computer
>>
>2016
>still using 8bit μCs
>not using based ARM Cortex-M
stay pleb, /diy/
>>
Former Arduinoer here, wondering if there's a board with beefier specs similar to the Arduino? I guess a board suited for physical computing projects?
>>
>>924946
raspberry pi would be the first suggestion.
then the Intel Galileo
when CHIP comes out for real, it'll be a good option as well.
Thread replies: 253
Thread images: 38

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.