text:
Mac OSX Yosemite no serial ports showing for Uno R3
I have a MacBook Pro running OS X Yosemite (10.10.3). I connected my Arduino UNO R3 to my computer for the first time after the Yosemite upgrade - it worked fine before this!
When I opened the Arduino IDE I selected Tools > Board > "Arduino UNO", but when I try to choose a Serial Port the only options are:
/dev/tty.Bluetooth-Incoming-Port
/dev/cu.Bluetooth-Incoming-Port
/dev/tty.Bluetooth-Modem
/dev/cu.Bluetooth-Modem

I have followed several tutorials and threads on how to 'fix' this issue, all to no avail:
I've installed the latest version of the FTDI drivers (even though, from what I recall the UNO doesn't even need them): FTDIUSBSerialDriver_v2_3.dmg
Downgraded to a prev. version of the FTDI driver hoping that would clear it up: /Volumes/FTDIUSBSerialDriver_v2_2_18
I followed a tutorial of how to remove the existing Apple drivers and removed the kext files, etc...
Tried connecting arduino to both USB ports.
Tried various cables, including the one that a I used before the Yosemite upgrade.
Tried installing updated Silabs drivers:
Arduino compatible's serial port not showing Mac OSX
Walked through the entire Arduino Mac OSX guide:
http://www.arduino.cc/en/guide/macOSX
After looking into the system info of my Macbook Pro, I can see the USB Controller is Broadcom based, in case that helps. I searched for Broadcom USB drivers but got hits for Silabs one instead.
Under my Tools > Port menu.. I can see these options:

clicking the Serial Ports option doesn't do anything.
Running ls -1 /dev/tty.* or ls -l /dev/tty.usb* from terminal gives me:
/dev/tty.Bluetooth-Incoming-Port
/dev/tty.Bluetooth-Modem

The Board does NOT show up under system networking (as it has for others), so it's not recognized as an incorrect device.
I'm at a complete loss. The board powers up... but I cannot connect to it.
SIDE NOTE: This is a legit Uno R3, not a clone.

If it is a legitimate Uno, then all of the FTDI and SiLabs efforts are an irrelevant distraction at best.  Ideally, test the board and cable on an another machine to make sure it has not been damaged in the meantime, and try a different USB port on the Mac (especially try connecting through a keyboard or hub if you tried directly, or directly if you had tried a hub).  I believe if you look in system information you can get a listing of all USB devices, which would be good to include in your post.

That's what I was thinking - regarding the FTDI drivers - but those were the only solutions I could find claiming to 'solve' this issue. I have tried other USB ports on the Macbook and will fire up my Apple keyboard since it has a USB port and reply back. I did write in my post the USB devices recognized in terminal.

Ok, tried my Apple YSB keyboard - connecting Uno to USB port === no dice

Moved the Apple USB Keyboard back to my iMac and tried to connect to Uno there.. selected Uno from the Board menu and still only shows bluetooth modems from the Serial Port menu.

After updating the Arduino app to 1.6.4 the Port menu now shows the same options as my Macbook (shown in the image in Orig. Post)

You really should look not just in the Arduino IDE but in system information or whatever they call it (get there from the about this mac, and advanced, etc) and see what USB devices it is seeing.  And again, test the board on another machine to make sure it is still good.

I've checked for 'visible' USB devices in both the System Info screen and via the Terminal.. both show the same.. and only bluetooth are present (aside from keyboard and my external HDD).  2) I have now tried this on both my Mackbook Pro and my iMac .. neither of which 'see' the USB connection.

Post a complete list of the raw USB (not serial) devices (ie, VID/PID) the system (not IDE) sees connected.

I did. I copied the LS from Terminal as well as identified, through the system settings screen, that there are only the USB to Bluetooth, Keyboard and Internal Memory Card controller. I checked both the IDE and the System screen after: 1) changing cables, 2) adding an Apple USB keyboard and using it;s USB port, 3) trying the same sequence on my iMac (keyboard usb and main usb).. nothing. The board is not listed. Period.

@ChrisStratton If there is another way to do this, to get the info you're asking for.. please let me know. But at this point, I've looked/checked everywhere that I know how to.

Until you have demonstrated that the board still works on some system (at this point probably not a Mac) you will have to consider it to be damaged.

Well, looks like the board might very well be shot. I fired up my wifes Windows laptop, installed Arduino, etc.. attached power and USB to Uno and it doesn't show in either the Arduino app or File Explorer. Not sure what/how it happened as the board was stored in an air tight, dry, cool container within a static free bag - the one it shipped it. And, I'd already ran this sketch once to perfection... bummer. Any other thoughts or possibilities?

After reading this I just tried out some of my Arduino machines, which worked properly so far, and indeed after upgrading to Yosemite yesterday, now none of my machines and none of my cables are recognized. I suspect a driver incompatibility...

Just wanted to add that I was having this same issue and switching to a different USB cable worked for me. I did not even know there was such a thing as a power-only USB!

I come back to the first question. I think I have the same problem. Basically I tried to install FTDIUSBSerialDriver v2_3.dmg on OS X Yosemite 10.10.5
The installation succeed But if I am looking in the /System/Library/Extensions/ I can see no FTDIUSBSerialDriver.kext if I go ls /dev |grep usbserial
no cu.usbserial-A9GBBDLL
or
tty.usbserial-A9GBBDLL Please help

This posted question has shown me the truth after a good 12 hours of absolute bupkis trying to get my V3 to show up in the serial ports. Thank you OP, for the release from hell.

This is the best solution and drivers I've found: https://github.com/adrianmihalko/ch340g-ch34g-ch34x-mac-os-x-driver

Probably, you have Chinese Uno analog which works on CH340 USB-to-serial chip, so you need to install driver for it.
Steps to fix:

Install the CH340 driver
Run the command in Terminal: sudo nvram boot-args="kext-dev-mode=1" (disable kext signing introduced in Mac OS X 10.9 Yosemite)
Reboot

Also you're right according to Uno and FDTI:

Differences with other boards
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial converter.

Thanks for including the CH340 chip number right in your answer.

On OSX 10.11.6, installing the driver and rebooting solved this for me.  No need for step 2.

This worked on 10.9.4 without step 2. Now I expect my private SSH keys to be located on some chinese servers though :)

@polym - was the second half of your comment really necessary?

Unfortunately the driver causes a kernel panic as soon as I plug in the Arduino. I'm on macOS Sierra 10.12.2.

@Colin did you manage to get it working?

@Ronny-AndréBendiksen No I didn't get it working. I just moved the upload step to my Raspberry Pi. :P

OSX 10.12.4 gives the following error when trying "sudo nvram boot-args="kext-dev-mode=1" " => nvram: Error setting variable - 'boot-args': (iokit/common) general error

If you're on Sierra, use this patched version of the driver. Worked like a charm: https://github.com/adrianmihalko/ch340g-ch34g-ch34x-mac-os-x-driver

When I run nvram, I get an error: nvram: Error setting variable - 'boot-args': (iokit/common) general error

@IgorGanapolsky - Starting with macOS Sierra, you must be booted to the recovery partition to run the nvram command.

This solution didn't fix the problem for me.  However, since it seems to work for some people, the new v1.4 version of the driver that supposedly works for High Sierra is here. :  https://drive.google.com/file/d/1lUYkw-mCOekJjY1MVA5YuEbERHNWNCZW/view?usp=sharing

I was able to get a new /dev/cu.wchusbserial1410 to show up by following the instructions from https://github.com/adrianmihalko/ch340g-ch34g-ch34x-mac-os-x-driver , didn't need nvram. Thanks for the link

I get the following after installing the driver from github.com/adrianmihalko and executing the sudo kextload /Library/Extensions/usbserial.kext step.  Then I get this: /Library/Extensions/usbserial.kext failed to load - (libkern/kext) system policy prevents loading; check the system/kernel logs for errors or try kextutil(8).

The cable that shipped with my Arduino Uno worked for power but not data transmission so the /dev/tty.usbmodem was not showing up in the Tools --> Port menu. After I switched to a different cable, the /dev/tty.usbmodem port showed up and it worked beautifully.

The same thing happened to me.  I was trying to connect my Arduino with a power-only cable.  Once I switched USB cables, the USB device appeared.

I had this same problem and all it took was a different cable

This is definitely the solution for me! Thanks a ton!

I have had this problem before, with Circuit Playgrounds, but forgot all about it. Switching the cable should always be the first attempt.

Same, I got the elegoo mega 2560 kit and the little usb c cable seemed to only work part of the time. Odd...

This fixed the problem for me:
http://blog.sengotta.net/signed-mac-os-driver-for-winchiphead-ch340-serial-bridge/
... and the direct link to download.
EDIT: I have one of the cheap clones with a CH340 USB chip. So this might not solve your problem, but could be beneficial to others.

The board in question does not have a ch340

Cheap clones do have CH340.

The question however, is quite specific about which board is involved, and it is quite specifically one which does not have a ch340.  The poster is answering a different question than the one which was asked.

Good point. I edited my answer with a clarification. I wanted to post it anyway though, because I spent a lot of time googling for a solution to my problem and stumbled onto this thread among the rest. Maybe it'll help others.

This is the answer I was looking for, unaware that my cheap clone had a different chip from the genuine Arduino.

Thanx a lot, it works for me =)

Yosemite 10.9 (and OS X 10.10 and newer) requires a signed USB driver kext (kernel extension).  You can find one on the FTDI web site here: http://www.ftdichip.com/Drivers/VCP.htm
Use version 2.3 for 64-bit OS X 10.9 or later.  Install and reboot.
Plug in your Arduino, and the Terminal command:

/usr/sbin/kextstat | grep FTDI

will tell you if the FTDI VCP driver actually loaded.
Also a /dev/tty.usbserial-xxxxxxxx entry should appear in your /dev directory.
If not, the Mac USB port isn't talking to your Arduino.  So it's no use trying the Arduino IDE application.
Also make sure your USB cable isn't for power only, but fully connected.

Note that the Uno R3 does not use an FTDI chip.

This site fixed the problem for me:
http://kiguino.moos.io/2014/12/31/how-to-use-arduino-nano-mini-pro-with-CH340G-on-mac-osx-yosemite.html
...somebody else has made an alternative to the ftdi drivers, and this website show you how to install them correctly.

This exact same thing happen to me on my mac running the same operating system. I had to restart this system a few times to get it to work. I restarted it with the arduino plugged in; and that worked rather than my previous attempts when i rebooted then plugged in.

Will try this power cycling and try again this evening.. thanks for the response!

Check this video https://www.youtube.com/watch?v=0zuRukW7o0A

Reboot and press CMD+R immediately after reboot to enter in Recovery Mode
Open Terminal from Recovery mode
Run the command csrutil enable --without kext
Reboot
Install driver

I have an osepp r3, seemingly an accurate clone. Computer is Mac os10.10.5.
A lot of sites claimed that the mac osx.* does not require FTDI drivers, but.....
After an awkward, google searching beginning, where the board only accepted a new sketch after being physically unplugged and replugged, I downloaded the latest FTDI driver, installed, and RESTARTED the mac. Now, joy and peace reigns. No side-effects with other mac functions, thankfully. Hope this helps.

Stumbled across this. It worked for Mac OS X Yosemite 10.10.5
install the CH340 driver
Run the command in Terminal:
sudo nvram boot-args="kext-dev-mode=1"
Reboot
However, I installed:
MAC system：www.wch.cn/downfile/178
so YMMV
a user here:
http://forum.makeblock.cc/t/mac-os-x-yosemite-arduino-1-0-6-doesnt-recognize-makeblock-orion/728
found the solution, there:
http://forum.arduino.cc/index.php?topic=261375.15
so kudos - to all that sweated out the driver, uninstall, install, and activation...
Ted

In my case, there was some kind of incompatibility with the ESP8266 connected to the Nano board. As soon as I removed it the Serial Port appeared again.

The OP does not appear to be using a ESP8266

First, check the USB cable - I had the same problem. If you have checked it, try the HoodLoader2:
I am using it and it works with Arduino Leonardo.

Can you please elaborate on your answer? Link-only answers are frowned-upon. What if the link goes down?

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Communication between Arduinos using USB Host Shield
I'm working on a project that needs to use USB to pass serial messages between Arduinos (I can't use I2C or SPI for a few reasons – I especially need USB's support for hot-swapping and address allocation). So far I have the USB Host Shield set up on one Arduino Uno, connected to the standard USB port on another. It appears to be working, as can be seen when I run the board_qc:

The 'slave' Arduino is just running the following code:
void loop() {
  Serial.println("Hello");
  delay(1000);
}

On the master, I create a USB object from the USB Host library (https://github.com/felis/USB_Host_Shield_2.0).
USB Usb;

void setup() {
    Serial.begin(115200);
    Usb.Init();
}

void loop() {
    if (Usb.getUsbTaskState() == USB_STATE_RUNNING)
    {
        Usb.ForEachUsbDevice(&PrintAllData);
    }
}

void PrintAllData(UsbDevice *pdev)
{
    UsbDeviceAddress adr;
    adr.devAddress = pdev->address.devAddress;
    Serial.println(adr.devAddress, HEX);

    uint8_t msg = 0;
    uint16_t len = 0;
    uint8_t rcode = Usb.inTransfer(adr.devAddress, pdev->epinfo->epAddr, &len, msg);

    if (rcode && rcode != hrNAK) {
     Serial.print(F("\r\nData rcv: "));
     Serial.print(rcode, HEX);
   } else if (len > 0) {
     Serial.print(F("\r\nData Packet: "));
     Serial.print(msg[0]);
   }
}

I'm not getting any data through though. Does anyone have any suggestions? Or know of any helpful sample code?

It would be orders of magnitude simpler and cheaper to use the UART's possibly with a software protocol for addressing and tristating the drivers if you need to connect more than two.  If you really wanted to use USB, you would have to do a lot more than that - you would need to actually implement CDC/ACM protocol or whatever the slave talks, and if it is using a bridge chip, configure the baud rate, etc.

@ChrisStratton Are there any good Arduino libraries you know of for creating a simple USB slave device?

An ordinary modern Arduino already is a simple USB slave device, implementing either a vendor-specific USB serial protocol or a standard CDC/ACM function for the same purpose.

@ChrisStratton Yeah, I'm using Arduino Unos. It looks like the ACM class in the USB Host Shield will help.

Perhaps, but USB is still just about the worst idea I have ever heard of for communicating between ATmega-based Arduino boards...

@ChrisStratton Well, as I said in my question, I need the plug-and-play abilities of USB. I also would like to avoid needing more pins on the Arduino as more devices are connected. Both I2C and SPI don't support auto address allocation, and SPI needs an extra pin per device. This is why I'm trying USB. If you have any better suggestions, it's be great to hear them though.

No.  USB supports multiple devices even less than those two or uarts do - to support multiple devices with USB, you need an additional HUB which is not required with the others, and substantial additional software complexity too.  Add unique wiring to any of the others and it is easy to make them support auto-address assignment; but with a little cleverness they can support it without that too.

Can I point out that UART and USB use the exact same pins on most boards? In fact, USB is implemented by sending messages from the main chip to the serial chip using UART on most boards.

I'm voting to close this old abandoned question because it is based on a fundamental misunderstanding of USB and Arduino, and after two years of inactivity the poster seems unlikely to return to either accept an answer or revise their plans to something actually practical.

Have you tried this lib's documentation? It looks like just doing init() and then checking the task state is not enough.
Looking at the source code makes me think you might want to add a call to the main task/state machine, e.g. add a call to Usb.Task(); to your loop, before your if statement.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
How do I use the prototyping area on a SparkFun MicroSD Card shield?
I'm having trouble figuring this out. I'm using this popular shield: https://www.sparkfun.com/products/12761
There is a breadboard area in the middle of the shield. But what confuses me is the lack of lines (order). On normal breadboards you can tell which row would be at the same voltage. If I wanted to put something on this prototyping area, how would I connect it? For example an LED, which would have a resistor attached to the positive side going to 5V and the negative side going to ground?

By soldering it.

This type of board, "pad per hole", has no pre-made interconnects. If you use thin enough wire sometimes you can push two pieces of wire into the same hole before you solder, say a resistor lead and another wire to connect to the next component. You can also solder an interconnect wire to the protruding leg of a DIP chip. You can make a buss for ground or 5v by assigning a whole row for that purpose, on the top side wire everything that needs to connect to that buss, and on the bottom side solder a straight piece of bare wire to all those wire ends in that row.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Reusing LED from RC helicopter controller
I have an old RC helicopter controller, but not the helicopter.  I recently purchased an Arduino Uno and would like to do something with LEDs(beside the on-board one built-in). Can I use an LED from the controller, that is already soldered in, cut it free and plug into my breadboard.
Side Note
I have no experience in soldering and don't own a soldering iron.

Yes, you can. For convenience, cut a bit shorter the lead on the side of the package where the flat part is so that you can identify the leads easier.

Yes you can. Make sure you have a resistor in series with your led. It is much, much better to guess and use the wrong resistor, than not to put a resistor in at all. I use http://led.linear1.org/1led.wiz to calculate my resistor. Your source voltage will be 5v. Each thing you have to fill has help on what value you're likely to want to put here.
It doesn't matter which side of the led you put the resistor.
If you can cut the led out, it should be fine, so long as you have long enough legs to go into the breadboard.

Ignacio's drawing shows you how to connect a LED. If you don't have any soldering tools you can use a solderless breadboard. This small one from Adafruit is ideal for small circuits:

(They exist in all sizes from very small to very large). The holes in each 5-hole row are all internally connected.
The problem with cutting the LED from the board may be that the remaining wire length is too short to fit in the breadboard. (You'll need at least something like 6 mm.) LEDs are a nice way to start with electronics, since you need minimal part count to make something visible. If you can't cannibalize the LED from the controller, just buy one from your local electronics shop. They're dirt cheap.


text:
Fingerprint sensor with external memory source
I am building a door lock that we will use at a local MakerSpace-club in my city, and we had this idea about building a fingerprint lock with parts compatible with Arduino.
What we are aiming to do is create a database that holds all our customers and their associated information. Fingerprint data being one of them.
So my question is: Is it possible to have a fingerprint sensor store and compare fingerprint data with an external source such as a MySQL database, instead of using the on-board memory?
So basically: When a customer puts his finger on the sensor, the Arduino board grabs the fingerprint data and queries our database for a match through its WiFi shield. If match is found: Log entry and unlock the door.
Google is not helping me out here.

Yes, all you need is a computer or another device that grabs the data via wifi and store it in a database.
You can simply send requests from arduino to computer and the PC does the search and returns the info back.
If you use XBees for communication, just install some serial communication with your preferred language and start sending and receiving data. The database will be accessed through that high level program and data will flow via XBees.


text:
MQTT Arduino add quality of service
I'm making a project with MQTT Arduino, but on publish messages i read that it's not possible to publish with qos 1 and 2? It is true? If is not, how can i put qos on publish messages?

What MQTT client are you using?
Paraphrased from the MQTT spec http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718099

The MQTT protocol provides three qualities of service for delivering
  messages between clients and servers: "at most once", QOS0; "at least
  once" QOS1; and "exactly once" QOS2. For QOS 1&2: The message must be
  stored locally at the publisher, until the publisher receives
  confirmation that the message has been delivered to the receiver.
  However, for QOS0 there is no storage requirement.

The problem with the Arduino is that there is no large quantity of storage available. If the client is disconnected from the broker while using a QOS of 1 or 2 the client must store the messages until a connection is reestablished and the message transfers are acknowledged. On an Arduino there is no guarantee all the messages can be saved. Consider a sensor node collecting 16-bits (int value) every second. Then supposed the broker goes down over the weekend and a repair person isn’t paid to work on the weekend. That’s two days’ worth of data or 172800 readings or about 1/3 MB (without overhead). The Arduino does not have that much storage.


text:
Using Browser window to display sensor values in realtime
The title pretty much says it all:
What would be the most obvious way to setup the Arduino (shields?), the Sketch (libraries?) and PC (webserver, ajax, plain html?) so that I get the following system working:

I open some page in a browser. The page has some labels/fields/values;
I power up Arduino, which is connected to some sensors (or even potentiometers);
The sensor values display keep being constantly updated in the page, with a sensible refresh rate (the fastest as possible, as to control some browser-based game for example);

The fundamental idea here is to use the Browser, and not some other GUI toolkit, or Processing, or the command line.

The most obvious way? Not what is the best way? It is a subjective question. The most obvious way would be to do it in a way you know how to. I am sure there are at least 20 ways to do this.
The way I know, and that I would do it is write a PC service that establishes serial communications with the Arduino, transfers data using JSON, and presents a web server I could connect TCP to.  Knowing C# and using existing code I have, it would take less than 15 minutes.

I don't know much about web servers, and I have previously used UDP to transfer data from Android to C#. There is also the HTML/Javascript part, which I have not experience either. I asked the question not because I think it is difficult (I believe it might even be trivial depending on the implementer's background), but because I don't know even where to start, and I think it makes a good canonical question

I guess there are a number of ways to tackle the problem. Using the Ethernet shield is probably the most intuitive option, but this isn't something I have explored in too much detail - I would usually opt for other micros at this stage and I am confident you will get an answer from someone else detailing this.
To get the most out of the Arduino and leverage what the Arduino is good at, I would probably make a C# console application or Windows service which communicates with the Arduino over serial, and use the 'System.Web.Http.SelfHost' assembly to make the data available through a RESTful web service which a html page could use JQuery to poll for information. It would be pretty easy to extend this to push the data to the page using SignalR.
The fundamental drawback of this architecture is that your device isn't serving the website, so these must be hosted somewhere else, or run from flat files. Also a PC must be attached to facilitate the data transfer over serial and provide the web service.
To get started you will want to familiarise yourself with c# and the SelfHost module, and WebApi 2.0 if you aren't already, this is all covered here, and of course you will need Visual Studio Community edition or greater to start creating projects.
Next, write a Windows Service or Console Application which implements an object model holding your data, and updates this periodically with the Arduino via serial.
The Self Host module is pretty incredible in that it allows you to add a web interface to any .Net application very easily, and directly manipulate your model. The tutorial linked above is very easy to follow, and can easily be adapted.
For testing and development purposes, I would highly recommend Postman, which can be used to test and trigger your API endpoints. It's a comprehensive and well polished tool specifically for this job.
In terms of the network logistics, I would then use JQuery to make periodic posts to the self-host service in the same fashion that Postman would. You can use the function call backs to trigger successive queries on completion to maximise the data refresh rate without causing excessive consumption. A time interval would be another option you could consider between requests, and is discussed in this article on polling.
The typical Ajax request structure would look something like this:
$.ajax({
    url: 'yourApiMethodAddress',
    type: 'get',
    error: function (jqXHR, status, ex) {
        /* Something went wrong. Maybe you could stop
           the update process and show a message and
           a retry button. */
        console.log("Error: " + status);
        console.log(ex);
    },
}).done(function (data) {
    // Update page with information stored in 'data'. View console for hints
    console.log(data);
});

I would recommend using Twitter Bootstrap in your webpage file to pretty things up and maintain readability. Don't forget to include the javascript and css files for both Bootstrap and JQuery in your html document (if used).
In summary, I would recommend implementing an application which runs on a computer attached via USB/Serial to the Arduino, with the .Net Self Host module utilised to provide a RESTful API. This API can then be polled from a html page using javascript and JQuery to obtain the information and update the page.
I hope this information helps, and as there a lot of moving parts I didn't provide many code examples for simplicity sake. If you find this useful and would like more information adding, mention it in the comments and I will update my answer.

Your question actually exists out of multiple questions...
1. How to connect arduino to network/internet.
I would suggest using a cheap WIFI module or Ethernet module
2. How to send values from arduino over ethernet.
The fastest would be using a direct connection (TCP/IP or UDP?)
3. How to receive values from arduino over ethernet on a PC.
The problem with this would (I think) be that a webserver usually does not enable a direct TCP/IP connection, but instead would use HTML to transfer data/webpages. But I'm not a web-developer at all. I would create a dedicated program in processing/c++/python or something similiar.

The first two parts I think are not difficult, I guess. But the third part is the part I am actually interested (although I must agree it's not an Arduino question...)

I'm actually also interested in this, (I'm at 'work' now) but I suggest you check out some similiar projects on the internet.
You're not interested in running the webserver on arduino are you? http://www.arduino.cc/en/Tutorial/WebServer
You want to make the arduino a controller/client from an online game?
The last part is indeed a bit off-topic, but there might be people on here who have knowledge on it or have done a similiar project with arduino.
You should check if you can receive raw tcp/ip on a webserver. As webserver vs dedicated program is quite a difference


text:
Running a servo and tone() won't compile? "multiple definition of `__vector_32'"?
Im using Spark fun pro micro:https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/hardware-overview-pro-micro
I am controlling a servo motor which reads its data from a pot connected to A0, and then writes to the servo on D9.
A speaker is connected to A5. Im using tone()
If I comment out the servo part of it, the tone() works out just fine and vise versa..
The error message I get is "multiple definition of `__vector_32'"
Got a clue??!
Thanks!

What version of the Arduino software are you using?

The link you provided shows a board built around the ATmega32U4.
On this chip, “__vector_32” is the low-level name of an ISR
(Interrupt Service Routine) named “TIMER3_COMPA_vect”. Your problem
comes from having two libraries trying to define an ISR for the same
interrupt, which is generated by the timer 3 of the chip. Merging
the ISRs is actually unlikely to work, because since each library
configures the timer in its own way, the timing of the interrupts will
be wrong for at least one of the libraries. You really have to use
different timers.
On my copy of Tone.cpp I can read:
#elif defined(__AVR_ATmega32U4__)

#define AVAILABLE_TONE_PINS 1
#define USE_TIMER3

const uint8_t PROGMEM tone_pin_to_timer_PGM[] = { 3 /*, 1 */ };
static uint8_t tone_pins[AVAILABLE_TONE_PINS] = { 255 /*, 255 */ };

which shows that the code is configured to use timer 3 on this
particular chip. In Servo.h I have:
#elif defined(__AVR_ATmega32U4__)
#define _useTimer1
typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t ;

which shows it should use timer 1, and not conflict with Tone.cpp.
It seems we have different versions of Servo.h. Mine is from Arduino
1.0.5. You may try to fix the problem by modifying the relevant section
of either file (just after #elif defined(__AVR_ATmega32U4__)) and
have them use different timers.
Edit: It appears this issue has already been fixed... on June 2012!
See this diff: Avoid TIMER3 conflict with Servo and
tone()
on the Arduino GitHub repository. The simplest fix in your case may be
to just upgrade your Arduino software. You could also manually apply
that (really small) diff to your current copy.

@downvoter: care to comment?

An upgrade did the job! Thanks a lot!!
But a new problem occurred, I had a timer interrupt connected as well which now is conflicting with the servo... gaaaah!! =) Guess I´ll have to modify or change the timer which interrupts

The problem you're seeing arises when two codes (e.g. libraries) try to use the same interrupt.
If you look at the source code of the two libraries, you'll find that they both make use of a number of ISRs (interrupt service routines): Tone.cpp uses
ISR(TIMERn_COMPA_vect) {...}

for n = 0..5, while Servo.cpp uses
ISR(TIMERn_COMPA_vect) {...}

for n = 1, 3, 4, 5.
Now what happens when you compile this code is that they both libraries generate identical symbols (the __vector_32 part) which then clash when the compiled code is linked to give the final binary you'd upload to your Arduino.
There is no simple way around this because the interrupt handlers need to be  registered at certain fixed positions in flash memory and there can only be exactly one interrupt handler for each of these slots (these slots are simply entries in a look-up table with the addresses of the interrupt handlers in flash, cf. Table 9-1 in the datasheet).
Now to solve this problem you would need to find a way to either merge the interrupt handlers of the two libraries (not so easy I guess), or make them use different interrupts (without looking further into what options the pro micro offers, the code suggests that there are several TIMER interrupts which could be assigned one to the Servo, one to the Tone, if that is supported by the hardware).
In any case you'll not get around modifying the libraries (or writing your own code for one functionality or the other).

Why the downvote?

The libraries are not compatible with each other, welcome to Arduino.
I dont use either library, and usually avoid libraries altogether because of things like this. I will assume you want a solution, not a clue.
The quickest route is to pick one of the libraries, and globally modify __vector_32 to something like __vector_32x.
That probably is not the best solution but the quickest. The best solution would be to understand how it is used in both libraries, and modify them to work together. In the end it might be as simple as wrapping it with some #ifdef, but that requires understanding it enough to get to that conclusion, and it will take some time.  Maybe someone else already has.

ok thanks!
You know of any other way of generate simple sounds that IS compatible with servo.h?
And another Q: Im pretty used to computers but I can't find my servo.h on my mac?!?! Freaks me out!!
You know where to look??

You are unlikely to find __vector_32 in any of those libraries. More likely something like ISR(TIMER3_COMPA_vect) or so. And renaming one of those won't help: you have to merge their contents.

@MrHaze: It's “Servo.h”, with a capital ‘S’.

@MrHaze You will find Servo.h in /Applications/Arduino.app/Resources/Java/libraries/Servo/src.

Great!! Found it!  Its weird I can't find it with spotlight though. Thx a lot.


text:
Arduino Uno questions
Anyways cutting to the chase I am pretty good at C++ as I have been doing it for over 6 months pretty much 1-2 hours each day and I am looking for cool things to use my knowledge on ,I have heard of the Arduino's but the problem is I don't know my arse from my elbow when it comes to electrical engineering and all that so I have a couple of questions.
1. Do I need to have a background in engineering to use an Arduino.
2. Is there any cheap alternatives to the quite costly starter kit.

There are clones available but the drivers for the USB<->Serial chips may be suspect.

I don't understand why you would need a starter kit when you want to program an Arduino. Why not just buy an Arduino (or clone)?

Or if you're willing to learn, the MCU and a programmer.

@Spehro actually the realy cheap ones ones that use an SP230x seem to be ok. It is the ones that claim to use an FT232 that might turn out to contain a knock-off chip.

@WoutervanOoijen I had some issues getting the Mac driver to work, but admittedly didn't try all that hard. The FTDI clones have a well known issue as you imply.

I don't know my arse from my elbow when it comes to electrical engineering and all that so I have a couple of questions. 1. Do I need to have a background in engineering to use an Arduino.

The answer to your first question: it depends on what you want to achieve, and how much time you are willing to spend stuck.
A bit of electrical/electronic background can help you a lot.  Basics such as Ohm's, Kirchhoff's.  Semiconductor devices (diodes, transistors, OpAmps).  It's very useful to understand what kinds of test&measurement equipment exists and how it can be used.
You can pursue C++ for 6 months 1-2 hours a day.  You can pursue electrical knowledge in the same way as well.  A solid book like "The Art of Electronics" will help you a lot (doesn't have to be the latest edition).
Then you can pursue more exciting things: sensors (for example).

If you are the "hacker" type (i.e. you are good at self-learning and you like to explore things) even if you are an absolute newbie I advice against those starter kits. They usually contain lots of overpriced parts, which you can get much more cheaply ordering directly to digikey, mouser or the like for your country (or maybe at your local shop).
On the other hand I strongly recommend buying an original Arduino board (for beginners an Arduino UNO is optimal, IMO, and comes at a reasonable price around 20-25EUR). This because the quality is guaranteed and you risk less problems. There are really good clones out there, but also tons of crappy ones, so I'll leave them to when you get more experience. Nothing is more frustrating while learning that wasting hours to debug a supposedly idiotproof project only to discover that it was not your fault, but the board's!!!
Note: if you go for an Arduino UNO choose the version with a socketed plastic DIP package MCU (that big, long chip with two parallel rows of pins), instead of the SMT version, using an MCU packaged as a tiny plastic square. The version with the socket may come handy if you accidentally fry the MCU: a new one will cost you less than 4EUR and it's easily replaceable (it is not soldered on the board). The SMT, on the other hand, is a PITA to replace and you'd need special hardware to do that. Moreover, the socketed version can be used as a "poor man's" programmer for ATMega328 MCUs. You program it on the board and then place it on an external circuit.
If you are an absolute beginner at EE, you can find lots of beginner tutorials on the Internet. Concentrate on key basic aspects. Most electronic projects can be handled with less math than you expect. You absolutely need to know Kirchhoff's laws and Ohm's law and a couple of related formulas if you want to begin learning electronics, but nothing more fancy. The rest can be learned on the way. Keep in mind that there are people out there that know much less than that and that are able to put together an electronics project successfully only by following "instructables" found on the Internet (really hardcore tinkerers! :-)
BTW, one thing you may find interesting, given your C++ background, is that what they call the "Arduino language" is really true C++! The Arduino environment "enhances" the source program (the "sketch", as they call it) and inserts all the boilerplate code needed to configure the MCU and other low-level stuff a beginner would have hard time digesting. Then the source program so enhanced is fed to AVR-GCC, in its G++ incarnation, which is nothing more that GNU GCC configured as cross-compiler for AVR MCUs. You can even use templates and derived classes, if you dare :-) Of course they don't tell you, otherwise the poor Arduino beginner would be scared away :-D
Very advanced Arduino users can bypass the Arduino environment completely and write directly C++ code and use the board as a simple prototyping board for the MCU it is based upon (ATMega328P for the Arduino UNO), exploiting all the features of the MCU without all the abstraction layers which comprises the Arduino environment.
A note of caution: when I talk about C++ I mean what is technically known as a freestanding C++ implementation, as opposed to a hosted implementation like on PC's. This means that the implementation doesn't need an OS to work, but also that it doesn't have all the standard libraries that you expect to find on a hosted implementation (sorry, no std::vector or std::cout !!!). A freestanding implementation must only provide a very limited subset of the usual standard libraries (those that handle lower level stuff, like memory allocation), and normally relies on implementation-specific libraries to do other stuff. In particular with the Arduino environment and the underlying AVR-GCC comes the AVR-LIBC library. But this is needed only when you do advanced stuff. The basic Arduino library will keep you busy for a nice amount of time until you reach such a level of expertise.

1) You do not have to have engineering background. You only need to know basics such as what a resistor is, what a transistor is, how an led works etc. (Of course the answer depends on what you want to do. For instance, if you want to work on a robotic project then yes, you need a little knowledge.)
2) Shopping questions are not answered here, but since you are asking something about "cost" then I have two answers. You can find cheaper solutions, but I, personally, always support original products for two reasons. First, you need to support the people who serves your work. Second is that original products are generally more reliable.

First question, no. Tons of tutorials for a from scratch beginner online. Second question, Google Arduino clones.

I am having loads of fun with Arduino from a background of programming with no electronics experience.  From simple "flash some LEDs" in the early days (back in Feb) through to making my own "games console" using a 32x32 LED matrix, FRAM memory chip, piezo buzzer and a home made controller for input.  I found that once I got started and browed various relevant sites, ideas started to flow.
I would suggest using straight C rather than C++, especially if you are working on one of the particularly low memory devices (such as the Uno).  I ran out of working RAM more times than I care to remember.
As for starter kits, if you search, you should be able to find cheap kits.  I got a pretty decent starter kit for around £20 but there were cheaper ones with a few less components.  Mine included (amongst other things) 30 LEDs, various IR and flame sensors, photo resistors, a 7 segment LED, a 4 digit 7 segment LED, an 8x8 LED matrix, a servo, a stepper motor, a stepper motor control board, a couple of breadboards and an Arduino Uno.


text:
Cannot receive and transmit at the same time
I have 2 arduinos I made some code and I managed to send from the first to the second and from the second to the first with two different pairs of code. What I want to do is to send from the first to the second and from the second to the first with no code change. I added in my current code some monitoring commands but what I can see in my Serial monitor is that not all characters are passed thru. I attach something like my code below only more simplified because it is a big project.
1st arduino:
radio.stopListening();
  for(int i=0; i<lnth; i++){
      chartosend=data.charAt(i);
      radio.write( &chartosend, sizeof(chartosend) );
  }
  radio.write(&endchar,1);
radio.startListening();
  if(radio.available()){
    radio.read( &inchar, sizeof(inchar) );
    inradio+=inchar;
    //Serial.println(inchar);
  }

2nd Arduino:
radio.startListening();
  if(radio.available()){
    radio.read( &data, sizeof(data) );
    inradio+=data;
  }
radio.stopListening();
  if(analogRead(0)>20){
     for(int i=0; i<6; i++){
      chartosend=pir1.charAt(i);
      radio.write( &chartosend, sizeof(chartosend) );
    }
    radio.write( &endchar, sizeof(endchar) );
  }

Where is the problem and how I could solve this?

Why do you only send one character at a time? (You can send 32 bytes per package, if I remember correctly.) This will create problems, because you are sending lnth packets per loop, but only read one packet per loop. So the buffer will never become empty. You might like to try while( radio.available() ){ instead of the if statement, to partially fix it.

Big part of the code is missing. What if the radios are misconfigured?  Also what if this is a hardware problem (missing cap to smooth the voltage on the nrf24l01+)?

I dunno know about the radio interface you are using. But I can see something which will break your code for sure.
The sections, where you read data from the interface on both Arduinos are passed without a delay, interrupt, polling loop or something else.
Which means: your "read" code section is in no way synchronised with the write code section on the other arduino and vice versa. At the point when you call the function "radio.available()" (which probably tests if there's any data available at the receiver fifo) there is possibly one or any number of bytes available, but not necessary the whole transmission from the other arduino. You have to make sure — somehow — that the transmission is finished, before you can call it a day and go on with processing the received data.
To do this you have to

synchronise the beginning and the end of your transmissions on both Arduinos
poll the data on the respective receiver side, until you are satisfied
or run into a timeout you have to apply in case there's a byte or more lost by chance.

I hope this gives you a little bit of orientation where to start.


text:
Verify a code for Traffic Signal
void setup() {
  pinMode(13, OUTPUT);  // Red
  pinMode(14, OUTPUT);  // Yellow
  pinMode(15, OUTPUT);  // Green
}

void loop() {
  digitalWrite(13, HIGH);
  digitalWrite(14, LOW);
  digitalWrite(15, LOW);  // Stop
  delay(20000);           // Wait 20 seconds
  digitalWrite(13, HIGH);
  digitalWrite(14, HIGH);
  digitalWrite(15, LOW);  // Listen
  delay(20000);           // Wait 20 seconds
  digitalWrite(13, LOW);
  digitalWrite(14, LOW);
  digitalWrite(15, HIGH);  // Go
  delay(20000);            // Wait 20 seconds
}

How good is this code and is there any error ?

Other than that it goes from green to red without intermediate yellow it looks alright.

Replace all literal values with named constants. Instead of 13 define "const int RED_LIGHT = 13". It might be difficult to use this code for all traffic lights at a crossing. Define the use case.

There is nothing wrong with your code. But it could use some cleaning to make it efficient.
The code at the moment will be 'deaf' to any user inputs for twenty seconds between light changes.
This can be fixed by using a timer interrupt and changing the lights every 20 seconds and listen for other inputs or do other things. You can use the arduino timer library, this is well documented and you should be able to find examples of its use. Basically you would monitor a variable until it reaches a point and then trigger the lights.
The other option would be to use the millis() and every 20 seconds change a light, but do stuff between those 20s. This can be done like this:
unsigned long previousMillis;  //hold the previous time
unsigned long currentMillis;   // hold the current time

long threshold = 20000;
int count = 0;

int pins[] = {13, 14, 15};

//setup code stuff

//put the following at the top of loop()

currentMillis = millis();

if(currentMillis - previousMillis > threshold){

    previousMillis = currentMillis;

    for(int i = 0; i < 3; i++){
    digitalWrite(pins[i], LOW);  //turn off all

    }

    if(count > 2) count = 0;

    digitalWrite(pins[count], HIGH);

    count++;
}

I don't think this works as a traffic light sequence, I might be reading it wrong, but I think this just switches a light on every few seconds.

@Matt - the code does switch a light on every few seconds, 20s, but that is as it is an example based off the OPs code where they used 20 second delay for each transition. The code does not change the sequence to match traffic lights but that would be each with a few if() statements to change the delay and keep the amber on.

I have a similar requirement, this gives you a little more flexibility , My traffic light code is controlled by a PIR outside my door , if the PIR detects an individual the lights turn to stop when the PIR clears the lights turn to green.
the code and hardware are still in the test phase.

#include <EasyTransfer.h>

int D_Status_Word = 0;
int Status_Word = 0; //sets all bits to  zero
int Light_Threshold = 150; //the light level that constitutes an unusual entry
int Active = 0;
int Passive = 100;
int Counter = 100;
int Green_Pin = 7;
int Amber_Pin = 8;
int Red_Pin = 9;
int Photocell_Pin = 1;     // the cell and 10K pulldown are connected to a0
int Photocell_Reading;
int Sensor_Frequency = 0;

struct SEND_DATA_STRUCTURE {
  //put your variable definitions here for the data you want to receive
  //THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO
  int Out_Word;
  int LDR_Level;
};

SEND_DATA_STRUCTURE My_Tx_Data;

//create an object for themessage
EasyTransfer ETout;
int D_Sensor_Pin [] = {
  2, 3, 5, 6
};
// pin hallwaypir, 3 doorpir, 5 door sensor, 6 hallpir

void setup() {
  Serial.begin (9600);
  // put your setup code here, to run once:
  ETout.begin(details(My_Tx_Data), &Serial);
  for (int i = 0; i <= 3; i++)// read the two state sensors
  {
    pinMode(D_Sensor_Pin [i], INPUT);
  }
  pinMode(A1, INPUT);//set the analoge u ldr pin ot input mode
  pinMode (Green_Pin, OUTPUT);
  pinMode (Amber_Pin , OUTPUT);
  pinMode (Red_Pin , OUTPUT);
}

void loop() {
  Scan_Sensors();
  if (D_Status_Word != Status_Word)
  {
    Sensor_Frequency = Active; // high frequency sampling because a sensor has activated
    //send a data packet to the mega with mem card via serial.
    Send_Data_Packet();
  }
  if (bitRead (Status_Word, 1) != bitRead (D_Status_Word, 1))
  {
    if ((D_Status_Word, 1) == 1)
    {
      Traffic_Light_Stop();
    }
    else
    {
      Traffic_Light_Go();
    }
  }
  Status_Word = D_Status_Word;

  delay(Sensor_Frequency);// 1000= waits for a second
}

void Scan_Sensors()
{
  byte readings = 0;
  Photocell_Reading  = 0;
  for (int i = 0; i <= 3; i++)// read the two state sensors
  {
    bitWrite(readings, i, digitalRead(D_Sensor_Pin [i] ));
  }
  //test to see if any sensors have trivggered (readings>0)
  if (readings > 0)
  { // a 2 state sensor has triggered, reset the Counter to 100
    Counter = 100;
  }

  //read threshold sensors
  Photocell_Reading  = analogRead(Photocell_Pin);
  {
    bitSet(readings, 4); // 4 becaus there are 4 2 state sensors (0 to 3)
    //we write 1 because thelight is below the threshold
    Serial.print ("photocell Reading = ");
    Serial.println(Photocell_Reading);
  }
  D_Status_Word = readings;
  Counter -= 1; //decrement the Counter
  if (Counter <= 0)
  { //the Counter has counted 100 scans since a 2state has triggered
    //rest freqenvcy to Passive
    Sensor_Frequency = Passive;

  }
}
void Send_Data_Packet()
{
  My_Tx_Data.Out_Word = D_Status_Word;
  My_Tx_Data.LDR_Level = Photocell_Reading;
  Serial.print ("photocell Reading = ");
  Serial.println(Photocell_Reading);
  Serial.print ("status word = ");
  Serial.println(D_Status_Word);
  ETout.sendData();
}

void Traffic_Light_Stop()
{
  //lights turn from green to yellow to red
  digitalWrite (Green_Pin, LOW);
  digitalWrite (Amber_Pin, HIGH);
  digitalWrite (Red_Pin, LOW);
  delay(750);
  digitalWrite (Green_Pin, LOW);
  digitalWrite (Amber_Pin, LOW);
  digitalWrite (Red_Pin, HIGH);
}

void Traffic_Light_Go()
{
  //lights turn red to red and yellow to green
  digitalWrite (Green_Pin, LOW);
  digitalWrite (Amber_Pin, HIGH);
  digitalWrite (Red_Pin, HIGH);
  delay(750);
  digitalWrite (Green_Pin, HIGH);
  digitalWrite (Amber_Pin, LOW);
  digitalWrite (Red_Pin, LOW);

}

There is nothing wrong with the code that I can see although you do have some redundant statements:
When you go to "Listen" you set the red and green pins high and low respectively, but they are already high and low from the previous state.  Not a big issue, being verbose adds clarity so there is some argument for leaving it as is.
I would consider using #define macros to number the ports and set the delay times.  This adds readability and also means you can make changes easily without having to search through the code and match up appropriate instances of the port number that you want to change, for example:
#define RED_PIN 13
#define DELAY_BETWEEN_CHANGES 20000
...
digitalWrite(RED_PIN, HIGH);
delay(DELAY_BETWEEN_CHANGES);

This also means that you can get rid of comments in your code as it becomes pretty self explanatory.  I personally believe that comments are bad.  If you write code and put a comment explaining what it does, when you have to modify the code you also have to modify the comment.  Make the code understandable in the first place, no need for comments.
Final point (not related to code): What happens after "Go"?  I'm from the UK so we have another phase after Go.  It reminds me of an old driving test joke:
Instructor: What is the sequence of traffic lights?
Student: Red, red and amber, green.
Instructor: What comes after green?
Student: How would I know?  I've always gone by then!

also in this case not so important but in large projects where you reuse the information, the variable can save some space, specially if you use the ATTiny85 that only have 8 kb flash memory


text:
Cannot print the first number of the date with RTC module
I am using this real-time-clock module to keep track of the time for a project:
http://www.dfrobot.com/wiki/index.php/Real_Time_Clock_Module_(DS1307)V1.1(SKU:DFR0151)
I have hooked up the respective pins correctly to the Arduino.
Below is the code I'm using. This first one is the code used to set the time on the module. It writes the initial time you specify to the RTC module.
#include "Wire.h"
#define DS1307_ADDRESS 0x68
byte zero = 0x00;         //workaround for issue #527

void setup(){
  Wire.begin();
  Serial.begin(9600);
  setDateTime();         //MUST CONFIGURE IN FUNCTION
}

void loop(){
  printDate();
  delay(1000);
}

void setDateTime(){          //Set the time to a minute or two ahead. After upload has completed, simply press the reset button to start the time while watching another clock.
  byte second = 0;     //0-59
  byte minute = 56;     //0-59
  byte hour = 13;     //0-23
  byte monthDay = 26;     //1-31
  byte month = 5;     //1-12
  byte year = 15;     //0-99
  Wire.beginTransmission(DS1307_ADDRESS);
  Wire.write(zero);     //stop Oscillator
  Wire.write(decToBcd(second));
  Wire.write(decToBcd(minute));
  Wire.write(decToBcd(hour));
  Wire.write(decToBcd(monthDay));
  Wire.write(decToBcd(month));
  Wire.write(decToBcd(year));
  Wire.write(zero);       //start
  Wire.endTransmission();
}

byte decToBcd(byte val){
return ((val/10*16)+(val%10));        //Convert normal decimal numbers to binary coded decimal
}

byte bcdToDec(byte val)  {
  return ((val/16*10)+(val%16));        //Convert binary coded decimal to normal decimal numbers
}

void printDate(){
  Wire.beginTransmission(DS1307_ADDRESS);        // Reset the register pointer
  Wire.write(zero);
  Wire.endTransmission();
  Wire.requestFrom(DS1307_ADDRESS, 7);
  int second = bcdToDec(Wire.read());
  int minute = bcdToDec(Wire.read());
  int hour = bcdToDec(Wire.read() & 0b111111);     //24 hour time
  int monthDay = bcdToDec(Wire.read());
  int month = bcdToDec(Wire.read());
  int year = bcdToDec(Wire.read());
  Serial.print(month);        //print the date, EG: 3/1/11 23:59:59
  Serial.print("/");
  Serial.print(monthDay);
  Serial.print("/");
  Serial.print(year);
  Serial.print(" ");
  Serial.print(hour);
  Serial.print(":");
  Serial.print(minute);
  Serial.print(":");
  Serial.println(second);
}

//http://projectsfromtech.blogspot.com/2013/06/arduino-rtc-tinyrtc-v1-with-arduino.html

And this next block reads the time from the RTC module. It has an onboard battery, so it keeps time even when disconnected from the Arduino.
#include "Wire.h"
#define DS1307_ADDRESS 0x68

void setup(){
  Wire.begin();
  Serial.begin(9600);
}

void loop(){
  printDate();
  delay(1000);
}

byte bcdToDec(byte val){
  return ((val/16*10)+(val%16));          //Convert binary coded decimal to normal decimal numbers
}

void printDate(){
  Wire.beginTransmission(DS1307_ADDRESS);          // Reset the register pointer
  byte zero = 0x00;
  Wire.write(zero);
  Wire.endTransmission();
  Wire.requestFrom(DS1307_ADDRESS, 7);
  int second = bcdToDec(Wire.read());
  int minute = bcdToDec(Wire.read());
  int hour = bcdToDec(Wire.read() & 0b111111);     //24 hour time
  int monthDay = bcdToDec(Wire.read());
  int month = bcdToDec(Wire.read());
  int year = bcdToDec(Wire.read());
  Serial.print(month);          //print the date, EG: 3/1/11 23:59:59
  Serial.print("/");
  Serial.print(monthDay);
  Serial.print("/");
  Serial.print("20");
  Serial.print(year);
  Serial.print(" ");
  Serial.print(hour);
  Serial.print(":");
  Serial.print(minute);
  Serial.print(":");
  Serial.println(second);
}

//http://projectsfromtech.blogspot.com/2013/06/arduino-rtc-tinyrtc-v1-with-arduino.html

The weird thing is, when I open the serial monitor after I upload the getTime sketch (the second one), every thing works except that the dayOfMonth only shows the last digit. For example, if the day was the 23rd, it would only print 3. Or if it was 31, it prints 1. I've gone through the code, but can't find anything that I think would cause this. Any tips?
To get started, I followed this tutorial: http://projectsfromtech.blogspot.com/2013/06/arduino-rtc-tinyrtc-v1-with-arduino.html

You forgot
int weekDay = bcdToDec(Wire.read()); //0-6 -> Sunday - Saturday

just before reading monthDay. Even though you may not be interested in
this piece of data, the RTC chip has no way of knowing that, and it will
always send the date and time in the same format. You can replace that
line by
Wire.read(); // discard day of week

if you want to make clear that you are discarding this information.
Ah, BTW, decToBcd() and bcdToDec() are ill-named: they convert
between BCD and binary, not decimal.


text:
Adrudio Due: How do MCU components USARTx & UART relate to board pins TXn/RXn?
I'm making USART support for SAM3x8e based Arduino Due board.
I looked into arduino source code, exactly
arduino-1.5.7/hardware/arduino/sam/variants/arduino_due_x/variant.cpp

and see that for Serial0 UART component is used, for Serial1 USART0 is used, for Serial2 - USART1 and for Serail3 - USART3. The USART2 is not even mentioned.

Why is this done that way?
I would like to realize what those comonents (USARTx & UART) are? Is UART is the subset of one of USARTs?
What is relation between USARTn & UART components and arduino board's TXn/RXn pins? Exactly, what pins are those component mapped to?

Thanx.


text:
Is crystal mandatory on attiny84?
I am trying to make a mini project with attiny84 and I searched the web so I can make an arduino on breadboard. What I saw on the internet is that they didnt use crystal. Is it mandatory if I want to use 1 pwm pin and the SPI interface on the attiny84?

Only if you need crystal accuracy. If the internal RC oscillator is accurate enough then feel free to use it instead.

Is there any way that i should anable the internal oscillator from the arduino IDE?

The Arduino IDE has no way to manipulate the fuses without using a programmer. And even with one, you can only modify them to the values set in boards.txt.

Just to add. The internal oscillator runs at 8mHz, while most arduino boards have a 16mHz crystal. So you lose half the processing speed. In most cases this is not a big deal. On the plus side, it reduces the power usage a bit, and you can use those 2 crystal pins for something else.


text:
Arduino DUE Interrupt 1MHz
My Due is interfaces with a DAC which I need to update with freq 1MHz. The nice solution seems to be a timer interrupt. I found a thread here called "Arduino Due - creating an 8Mhz clock signal". I tried the following code to see if I can get 4MHz on P41. No luck. Any help will be greatly appreciated. Thanks.
volatile boolean l = false;

void TC6_Handler()
{
    TC_GetStatus(TC2, 0);
    digitalWrite(41, l = !l);
}

void startTimer(Tc *tc, uint32_t channel, IRQn_Type irq) {
    pmc_set_writeprotect(false);
    pmc_enable_periph_clk((uint32_t)irq);

    TC_Configure(tc, channel,
    TC_CMR_WAVE |
    TC_CMR_WAVSEL_UP_RC |
    TC_CMR_TCCLKS_TIMER_CLOCK1|
    TC_CMR_ACPA_TOGGLE );  // RC compare TOGGLES TIOA);

    TC_SetRA(tc, channel, 1); //50% high, 50% low
    TC_SetRC(tc, channel, 1);

    PIO_Configure(PIOC,
    PIO_PERIPH_B,
    PIO_PC25B_TIOA6,
    PIO_DEFAULT);

TC_Start(tc, channel);

}

void setup(){
pinMode(41,OUTPUT);
startTimer(TC2, 0, TC6_IRQn);
}

void loop(){
}

Generally you should try to do something like this with DMA, creative use of some other on-chip peripheral, etc rather than the main processor core - at least if you want your MCU to be useful for much else.

I'm not 100% certain without my Due in front of me to test this, but as far as I can see, you are configuring your clock to run at 42MHz with "TC_CMR_TCCLKS_TIMER_CLOCK1" and are getting the timer to trigger when the count is "1" with "TC_SetRC(tc, channel, 1);", which would give you 42MHz, not 4MHz.
Since the clock timer still increments during the TC6_Handler() function, I'm guessing that the interrupt triggers a second time before it has exited the function the first time causing a hang.
Try changing your code to "TC_SetRC(tc, channel, 42000000 / 4000000);" to see if that works.  Your interrupt will still be triggered every 10 ticks of the timer which will only give you 20 ticks of the CPU clock to do your work and exit.  I suspect this may still be too little time to exit before the next interrupt is triggered.  If you still don't get the result you want, try reducing the frequency considerably to see if your timer is actually getting configured correctly.  I don't think you can get exactly 4MHz as the Due timer frequencies are not divisible by 4000000, unless my brain is a little fuzzy this morning and I'm missing something obvious...
If you do need to optimise the code inside your handler so it can run faster, let me know and I'll post some ideas when I can get near my Due and my source code for reference.
You could always check out this link that I used when I needed to understand how to set up a timer for my own projects:
http://2manyprojects.net/timer-interrupts
Should that link go dead before you have a chance to read up, this is the example source from that page I modified for my own purposes:
// These are the clock frequencies available to the timers /2,/8,/32,/128
// 84Mhz/2 = 42.000 MHz
// 84Mhz/8 = 10.500 MHz
// 84Mhz/32 = 2.625 MHz
// 84Mhz/128 = 656.250 KHz
//
// 42Mhz/44.1Khz = 952.38
// 10.5Mhz/44.1Khz = 238.09
// 2.625Hmz/44.1Khz = 59.5
// 656Khz/44.1Khz = 14.88 // 131200 / 656000 = .2 (.2 seconds)

// 84Mhz/44.1Khz = 1904 instructions per tick
const int led_pin = 13;
int state = false;
int interruptCtr = 1;
int S = 0;

void setup()
{
  pinMode(led_pin, OUTPUT);
  /* turn on the timer clock in the power management controller */
  pmc_set_writeprotect(false);       // disable write protection for pmc registers
  pmc_enable_periph_clk(ID_TC7);     // enable peripheral clock TC7

  /* we want wavesel 01 with RC */
  TC_Configure(/* clock */TC2,/* channel */1, TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK4);
  TC_SetRC(TC2, 1, 131200);
  TC_Start(TC2, 1);

  // enable timer interrupts on the timer
  TC2->TC_CHANNEL[1].TC_IER=TC_IER_CPCS;   // IER = interrupt enable register
  TC2->TC_CHANNEL[1].TC_IDR=~TC_IER_CPCS;  // IDR = interrupt disable register

  /* Enable the interrupt in the nested vector interrupt controller */
  /* TC4_IRQn where 4 is the timer number * timer channels (3) + the channel number (=(1*3)+1) for timer1 channel1 */
  NVIC_EnableIRQ(TC7_IRQn);
}

void loop()
{
  // do nothing timer interrupts will handle the blinking;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// INTERRUPT HANDLERS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void TC7_Handler()
{
  // We need to get the status to clear it and allow the interrupt to fire again
  TC_GetStatus(TC2, 1);
  state = !state;
  digitalWrite(led_pin, state);

  if( interruptCtr++ >= 6 )
    {
     interruptCtr = 1;
     S = !S; // are we flashing S or O
     if( S ) // set time till next interrupt
        TC_SetRC(TC2, 1, 131200); // 131200 / 656000 = .2 seconds
     else
        TC_SetRC(TC2, 1, 656000); // 656000/ 656000 = 1 second
    }
}

I just noticed the title mentions 1MHz as does your question, before it mentions 4MHz. Using "TC_SetRC(tc, channel, 42);   // 42MHz / 1MHz" will give you the 1MHz timer you desire.  This will give you approx. 80 ticks of the CPU clock to complete your interrupt.  Still pretty low, but definitely doable to flip an IO line - you may need to avoid digitalWrite() though.

i didnt read your answer, just vote up to bump it above comment-answers of the OP

When I'm working with timers on my Due I always keep my code low level so my solution for your problem would be:
// These are the clock frequencies available to the timers /2,/8,/32,/128
// 84Mhz/2 = 42.000 MHz
// 84Mhz/8 = 10.500 MHz
// 84Mhz/32 = 2.625 MHz
// 84Mhz/128 = 656.250 KHz
//
// 42Mhz/44.1Khz = 952.38
// 10.5Mhz/44.1Khz = 238.09
// 2.625Hmz/44.1Khz = 59.5
// 656Khz/44.1Khz = 14.88 // 131200 / 656000 = .2 (.2 seconds)

#define SPEED(x) 42 * x

// 84Mhz/44.1Khz = 1904 instructions per tick
const int led_pin = 13;  //PB27
int interruptCtr = 1;
int S = 0;

void setup()
{

    pmc_set_writeprotect(false);       // disable write protection for pmc registers /**always the first thing to do*/

    // Enable pin 13 with direct port manipulation
    REG_PIOB_PER = 1<<27;
    REG_PIOB_OER = 1<<27;
    REG_PIOB_OWER = 1<<27;

    /* turn on the timer clock in the power management controller */
    pmc_enable_periph_clk(ID_TC0);     // enable peripheral clock TC0

    //Enable interrupt in NVIC before starting interrupt
    NVIC_EnableIRQ(TC0_IRQn);

    //Wavesel on rising edge with timer clock1 (42MHz)
    REG_TC0_CMR0 = TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK1;

    //Enabel RC compare interrupt
    REG_TC0_IER0 = TC_IER_CPCS;

    //Set the timer register c
    REG_TC0_RC0 = SPEED(200000);  //SPEED() converts us to clock ticks

    //Start timer
    REG_TC0_CCR0 = TC_CCR_SWTRG | TC_CCR_CLKEN;
}

void loop()
{
  // do nothing timer interrupts will handle the blinking;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// INTERRUPT HANDLERS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void TC0_Handler()
{
  // We need to get the status to clear it and allow the interrupt to fire again
  REG_TC0_SR0;

  //get curretn pin state (REG_PIOB_ODSR & PIO_PB27) and invert it. AND this result with the pin bit to only set pin 27 to high/low
  REG_PIOB_ODSR = (~(REG_PIOB_ODSR & PIO_PB27)) & PIO_PB27;

  if( interruptCtr++ >= 6 )
  {
    interruptCtr = 1;
    S = !S; // are we flashing S or O
    if( S ) // set time till next interrupt
      REG_TC0_RC0 = SPEED(200000); //0.2 seconds
    else
      REG_TC0_RC0 = SPEED(1000000); //1 second
    }
}

With this code you should be able to increase the switching frequency to theoretically 42MHz. But due to the time the interrupt needs to run it will be reduced to something about 10MHz or less but even this is much higher than your 334KHz.

This works
int unsigned A[2500];
int unsigned S;
void setup()
{
  Serial.begin(9600);
  //pinMode(30, OUTPUT);
  REG_PIOB_OWER = 0xFFFFFFFF;     // Enable PORT B
  REG_PIOB_OER =  0xFFFFFFFF;     // Set PORT B as output port
  REG_PIOD_OWER = 0xFFFFFFFF;     // Enable PORT D
  REG_PIOD_OER =  0xFFFFFFFF;     // Set PORT D as output port
  REG_PIOC_OWER = 0xFFFFFFFF;     // Enable PORT C
  REG_PIOC_OER =  0xFFFFFFFF;     // Set PORT C as output port
  /* turn on the timer clock in the power management controller */
  pmc_set_writeprotect(false);     // disable write protection for pmc registers
  pmc_enable_periph_clk(ID_TC7);   // enable peripheral clock TC7

  /* we want wavesel 01 with RC */
  TC_Configure(/* clock */TC2,/* channel */1, TC_CMR_WAVE | TC_CMR_WAVSEL_UP_RC | TC_CMR_TCCLKS_TIMER_CLOCK1);
  TC_SetRC(TC2, 1, 42);// 1 MHz
  TC_Start(TC2, 1);

  // enable timer interrupts on the timer
  TC2->TC_CHANNEL[1].TC_IER=TC_IER_CPCS;   // IER = interrupt enable register
  TC2->TC_CHANNEL[1].TC_IDR=~TC_IER_CPCS;  // IDR = interrupt disable register

  /* Enable the interrupt in the nested vector interrupt controller */
  /* TC4_IRQn where 4 is the timer number * timer channels (3) + the channel number (=(1*3)+1) for timer1 channel1 */
  //NVIC_EnableIRQ(TC7_IRQn);
}

void loop()
{
int unsigned MSBs = 0;
int unsigned LSBs = 0;
int unsigned C = 0;
int unsigned B = 0;
int unsigned i = 0;
//int unsigned long B1 = 0;
//int unsigned B2 = 0;
int unsigned MSBMask = B11111111;
MSBMask << 8;

 //Serial.println(base, DEC);
//delay(100);
 //Serial.println(ratio, DEC);
//delay(100);
for(i=0; i<2500; i++)
{
  //C = 20000/2*sin(2*PI*(90000/0.0025*i+10000)*i);
  C = 20000*sin(2*PI*i);
 // A[i] = sin(2*PI*(10+90/25*i)*1/1000);
   //A[1] = sin(2*PI*(10+90/25*i)*1/1000);

  MSBs = C >> 8;
  LSBs = C & MSBMask;
   //Serial.println(C, BIN);
  //Serial.println(MSBs, BIN);
 // Serial.println(LSBs, BIN);
MSBs = MSBs << 12;
LSBs = LSBs << 1;
B = MSBs+LSBs;
A[i] = B;
 //Serial.println(B, BIN);
 //Serial.println(A[i], BIN);
//delay(100);
}

NVIC_EnableIRQ(TC7_IRQn);
while(1){}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// INTERRUPT HANDLERS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void TC7_Handler()
{
 TC_GetStatus(TC2, 1);// We need to get the status to clear it and allow the interrupt to fire again
  //int i=0;
  REG_PIOD_CODR = 0x1 << 9;// clear pin 30 on due
 // REG_PIOD_CODR = 0x1 << 10;// clear pin 32 on due

REG_PIOC_ODSR = A[S];//set outout pins to array entry

REG_PIOD_SODR = 0x1 << 9;// set pin 30 on due, commanding DAC to take commended Analog output,
   S++;
   if(S>2500){S=0;}

}

I need to update with freq 1MHz. ...No luck.

no kidding.
think about interrupt overhead. and how much it takes away the processing power if you interrupt at 1 million times a second.
think DMA if available on your chip. If not, think a faster chip or compromise on your 1Mhz expectation.

Indeed, unless the processor needs to do essentially nothing else, using DMA to feed the DAC is probably necessary.


text:
Programmatically Upload Arduino Sketch From Android App
I am attempting to build an Android app from which I can can upload a .hex file to my Arduino(Leonardo). I am aware of a few apps in the Google Play store that are capable of this functionality but I can't seem to find any actionable resources on how to go about doing this. I am aware that the desktop Arduino IDE uses AVRDude to perform the upload but I don't believe AVRDude is available on Android so I'm at a complete loss here. Does anyone know how I would go about accomplishing this?
After some more searching I now know that the Leonardo(ATMega32u4) uses the AVR109 Protocol to flash new programs onto the hardware but I'm still at a complete loss as to what that process is and how I'd reproduce it in Java.

If you need the result, use one of the existing apps or see if its author will license the key parts to you.  If you want something of your own, then you may end up having to do most of the work of creating (or at least porting) it yourself.

@ChrisStratton I need a solution which I have full insight/control over. I have no problem doing the work and would actually prefer it, but I have very little understanding of the work that needs to be done which is why I'm here. I've been in contact with one developer but the interaction hasn't been as helpful as I thought it might be. I am unfortunately fairly new to this side of things so I don't know the right things to look for, search for, etc.

If I wanted to do this for a conventional Arduino I'd start by figuring out the operations against a serial API to talk to the bootloader, and perhaps test it against something exposing desktop serial ports to Java, as debugging Android host mode stuff is a pain given you have to use ADB-over-wifi.  You might try to figure out how avrdude works, for example.  Then I'd try to combine that with existing code that is out there for talking serial-over-USB to Arduino boards with the various device-side chipsets.  For a leonardo type board the two pieces may be more tightly coupled.

Solid tips. I'll start looking through all of that, thanks a bunch!

Try the Physicaloid library for Android which seems to be a complete AVRdude implementation on Java.

If I wanted to do this for a conventional Arduino I'd start by figuring out the operations against a serial API to talk to the bootloader, and perhaps test it against something exposing desktop serial ports to Java, as debugging Android host mode stuff is a pain given you have to use ADB-over-wifi. You might try to figure out how avrdude works, for example. Then I'd try to combine that with existing code that is out there for talking serial-over-USB to Arduino boards with the various device-side chipsets. For a leonardo type board the two pieces may be more tightly coupled.
Copy of Chris Stratton's comment which was acknowledged as an answer.


text:
ATTiny to drive LEDs
I'm installing some daylight running lights in my car and I have purchased 2 LED bars, each with 8 white LEDs. They use 12V and I need to make some effect when they turn on. Like in some modern cars, when I turn on the key, LEDs should blink(shake like when old fluorescent tubes turns on) and then turn on slowly(brightness from 0-100).
I can do this with Arduino-Uno and I need to put this in a smaller chip. What would be the best suitable ATTiny chip for this project? Because using an ATmega328 is not worth for a small project like this.

The ATtiny85 is an 8-pin AVR device with 3 PWM channels available in DIL and SO packages. The Arduino core can be downloaded from arduino-tiny. It can be programmed via ISP using either ArduinoISP or a dedicated programmer.

I have done a similar project, and can verify it works well. Make sure you have a transistor between the attiny and the LEDs (and a resistor between the attiny and the transistor!), so the high amps & 12 volts aren't drawn through the attiny. If you step down the voltage from 12v to 5v, make sure you check that they have a common ground - measure the voltage between the car battery's ground (negative) and the attiny's ground.


text:
How do I use two I2C LCDs with 4 pins?
I have two I2C LCD screens:

one with 2 lines
one with 4 lines.

Both have 4 pins each: GND, VCC, SDA, SDL. I connect SDA and SDL to A4 and A5 respectively, and I display text on each one of them with:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,4);

But how can I use both of them at the same time?
I connected the second one's SDA and SDL to A2 and A3, but apparently I have to provide the right address for them (like 0x27), right?
However, while both are connected, using I2C_Scanner only shows one device:
Scanning...
I2C device found at address 0x27  !
done

What am I missing?

With the I2C backpack there are three pairs of landings, A0, A1, A2, which determine the 3 LSB of the device's address, using inverted binary.
Left alone, they generate part of the F or 7 part of the address.  0x3F is common, as is 0x27.
To use more than one device it is necessary to jumper them all uniquely.
The upper bits that generate the 0x3 are hard-wired.  So is the highest bit of the lower byte.  Only the three lowest-order bits can be changed.
Since these address bits are inverted, jumpering the A0 will subtract 1 from the address.  0x3F will become 0x3E, 7 will become 6.
You have control enough to make up to 7 LCD modules on the same I2C bus.
The only caveat is that if you have more than one device writing to the various LCDs you might get collisions, which can mess up the display pretty good.
There are questions on I2C collision avoidance and detection on http://RaspberryPi.StackExchange.com if that is your situation.
Jumpering one or more of them is pretty easy - just pre-tin some wire and solder it quickly then cut off the excess.
Wire the SDA and SCL wires of the LCDs in parallel and to the SDA and SCL pins on the Arduino, usually A4 and A5.  (I always begin with a breadboard for this).  Make sure you have discrete pull-up resistors (10K is common) on each, in only one place on the bus.
If you have a DS3231 RTC module in the system, you do not need to add pull-ups because it has them internally.
If one LCD is already working then you know you have proper pull-up voltage on the bus.  (The signals are switched to the ground state to send data on the I2C bus)
So, to Summarize:
If you have two LCDs in your system you can use LCD modules that already come with different addresses, like
LiquidCrystal_I2C lcd1(0x27,....);

for the first one, then
LiquidCrystal_I2C lcd2(0x3F,.....);

for the second one.
Note that the parameters for these definitions are
LiquidCrystal_I2C lcdname(addr,en,rw,rs,d4,d5,d6,d7,bl,blpol);

0x27 and 0x3F are the most common stock addresses and 0x27 modules are getting harder to find.
If you have a 0x27 then it is very likely that if you buy a newer one it will be 0x3f. Problem solved.
The d4 and d5 in the definition specifies the pins to use for I2C.
You can run the i2cscanner program to see what it finds, once they are wired together.  If you see two different addresses, say 0x27 and 0x3F, then you are good to go.
If only 2F shows, then you want to consider soldering A0 together on one module then run the scanner again to make sure it worked.
Here is how I usually do it when both come set as 0x3f:
I have a Yellow one which is a stock 0x3F and a Blue one where I jumpered A0 to make it 0x3E.  They both are 20 x 4 displays.
Here are my definitions:  (remember, the 4,5 define SDA, SCL pins)
LiquidCrystal lcdblue  (0x3e,2,1,0,4,5,6,7,3,POSITIVE);
LiquidCrystal lcdyellow(0x3f,2,1,0,4,5,6,7,3,POSITIVE);

Then in setup() I use this:
lcdblue.begin(20,4);
lcdblue.backlight();
delay(250);
lcdblue.nobacklight();
delay(250);
lcdblue.backlight();

lcdyellow.begin(20,4);
lcdyellow.backlight();
delay(250);
lcdyellow.nobacklight();
delay(250);
lcdyellow.backlight();

And it's good to go, using pin A4 as SDA and A5 as SCL.
You know they are working as they wink their backlights at you.
If one of yours is 20 x 2 then use lcd2.begin(20,2); of course.
If you REALLY want to use other pins for your I2C bus then just change the 4,5 in the LiquidCrystal_I2C definition to the pins you want to use.  I never have met anyone who would want to do this.
Hope this helps.

You can't hook up I2C devices to arbitrary pins; they must either be connected to SDA and SCL and given different addresses, or you must use software I2C. Figure out how to give the second device a different address, and then instantiate another LiquidCrystal_I2C with the new address in order to be able to use it.

I found out that I can connect to A4, A5 up to 121 I2C devices. There aren't other ports for SDA, SCL. There must be a way to change the address, but I can't find it. Some other LCD displays have A0, A1, A2 pins: jumpering them changes their address. However, both of my display do not have them. (info at http://forum.arduino.cc/index.php?topic=158312.0 ) Will keep searching...

Do you have a link to a product page?

Yes it's this: http://www.ebay.co.uk/itm/181722213160?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT The other is from a Sunfounder kit and I can't find a specific link, only that it is a "I2C LCD 1602".

Don't waste your time on that though, I'll figure something out and let you know. :)

Can you see any jumpers or resistors on the underside of the board?

You mean like C1, C2 on the right or C3-4, R6-8 on the lower left? http://s4.postimg.org/6h8ajc21p/lcd.jpg

On the adapter board, not the display itself.

By adapter board you mean the other side of the small red board? Well I can't remove it to have a closer look, but it seems that there is nothing underneath it.

Pins 1, 2, and 3 select the I2C address of the device. If you lift one of them off the board and solder a wire to ground then you can change the address.

Ok, I'll get a soldering iron and will do it. So I will disconnect one of them and ground it. Then use I2C Scanner to find the new address. By the way, how did you know that?

A page on the web said that most of these modules use a PCF8574 (which your photo confirmed), and from there it's just a matter of reading the datasheet.

In the LiquidCrystal definition you can specify the pins to use for SDA and SCL.  Take a look at my answer about changing addresses on the I2C backpack.  A0, A1, A2 can be shorted together to change the least-significant-bits of the I2C address

Specifying the pins as something other than SDA and SCL only makes sense if you actually have I2C running on those other pins. Very few Arduinos have hardware I2C on more than one pair of pins.

You may be able to wire them in parallel, if you can hold the clock (SCL) high (for one at a time).
Put a diode in to stop the other one going high as well.
Pick a spare pin on your arduino (I will use digital pin 7 for device A, 8 for device B, but it doesn't matter which). When you want to talk to device A, make sure pin 7 is in high impedance mode, and 8 is high. Talk to device A. Stop talking to device A. Put pin 8 in high impedance mode, and pin 7 to high. Talk to device B. Wash, rinse, repeat. So long as a device sees it's clock as high, it won't listen or talk.


text:
How do I install a library in Arduino Yun cross compile environment?
A few days ago, I've asked this question.
Thanks to the replies I've received, I've set up a cross compile environment for Yun by following this guide.
I've created a virtual machine with virtualbox and installed Debian 8.0 on it. I installed all the software required to download and compile the OpenWRT-Attitude Adjustment version (which, I think, is the version used by Arduino Yun) on Debian.
So, I've downloaded the OpenWRT source code, downloaded its packages feed (with "git clone git://git.openwrt.org/12.09/packages.git"), downloaded and installed all available "feeds" (with: "./scripts/feeds update -a" "./scripts/feeds install -a") and then compiled it with: "make defconfig" "make prereq"
and "make menuconfig".
When I typed in "make menuconfig", a graphical interface prompted. In that interface I selected:
Target System: (Atheros AR7xx/AR9xx);
Base System: I selected libc, libcc and marked as package libpthread and librt.
I left any other option as default. Then I compiled all with "time make V=99" command.
After about 2 hours, the compiling finished and I set the environment variables as the above mentioned guide described.
Looks like now I can compile any C code with this cross-compiler. Anyway, my application includes the png.h header in order to use the libpng library, and every time I try to cross-compile it, a "png.h not found" error pops up during the process.
So I tried to cross-compile the libpng library but when I ran "./configure" with the options for cross-compiling, it failed saying that zlib wasn't installed. So I downloaded the zlib library source code but looks like I can't cross-compile it.
Eventually I compiled zlib and libpng normally on Debian and now, when I try to cross-compile my application, it still says that it can't find png.h...
So, how can I "integrate" the libpng library to the cross-compiling environment?
Sorry for this long question, but it is all I've done today.
As always, I thank you for any help you can give me.

I'm voting to close this question as off-topic because it's more than 2 years old and have no answers.


text:
Pressing button stops listening on nrf24l01
I have been tinkering for 2 days to manage send and receive between 2 arduinos. My code is bellow:
Arduino 1:
#include <SPI.h>
#include <RF24.h>
#include "printf.h"
#define LED 2
#define RF_CS 8
#define RF_CSN 9
RF24 radio(8,9);
String datargb = "rgb: 000000005";
char chartosend;
char inchar;
String inradio;
int endchar = '~';
void check_radio(void);
void setup() {
  // put your setup code here, to run once:
Serial.begin(115200);
  printf_begin();
  radio.begin();
  radio.setRetries(15,15);
  radio.openWritingPipe(0x080C600C01LL);
  radio.openReadingPipe(1,0x080C600C71LL);
  radio.setPALevel(RF24_PA_MAX);
  radio.setAutoAck(true);
  radio.printDetails();
  attachInterrupt(0, check_radio, FALLING);
  radio.stopListening();
}

void loop() {
  // put your main code here, to run repeatedly:
int lnth = datargb.length();
  for(int i=0; i<lnth; i++){
      chartosend=datargb.charAt(i);

      while(!radio.write( &chartosend, sizeof(chartosend) )){}

      Serial.println("sent");
  }
  radio.write(&endchar,1);
}
void check_radio(void){

  bool tx,fail,rx;
  radio.whatHappened(tx,fail,rx);

  if(rx){
    Serial.println("interrupt!!");
radio.startListening();
    radio.read( &inchar, sizeof(inchar) );
    inradio+=inchar;
    Serial.println(inchar);
    if(inradio.endsWith("~")){
      Serial.println(inradio);

      if(inradio.startsWith("rgb: ")){
        analogWrite(6,inradio.substring(5,8).toInt());
        analogWrite(9,inradio.substring(8,11).toInt());
        analogWrite(5,inradio.substring(11,14).toInt());
      }
      inradio = "";
      radio.stopListening();
    }
  }
}

Arduino 2:
#include <SPI.h>
//#include <nRF24L01.h>
#include <RF24.h>
#include "printf.h"
//#include <RF24_config.h>
RF24 radio(8,10);
char data;
char chartosend;
char endchar = '~';
String inradio;
void check_radio(void);
String datargb = "To mounti tis manas tou nrf24";
void setup() {
  // put your setup code here, to run once:
  pinMode(9, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, INPUT);
  attachInterrupt(1, check_radio, FALLING);
  Serial.begin(115200);
  printf_begin();
  radio.begin();
   //radio.setRetries(2,15);
    // open pipe for writing
    radio.openReadingPipe(1,0x080C600C01LL);
    radio.openWritingPipe(0x080C600C71LL);
    radio.setPALevel(RF24_PA_MAX);
    radio.startListening();
    radio.printDetails();
    radio.setAutoAck(true);
}

void loop() {
  // put your main code here, to run repeatedly:
if(digitalRead(7)==HIGH){
  radio.stopListening();
  for(int i=0; i<28; i++){
      chartosend=datargb.charAt(i);
      while(!radio.write( &chartosend, sizeof(chartosend) )){}
      //Serial.println("sent");
  }
  radio.write(&endchar,1);

  while(digitalRead(7)==HIGH){}
  radio.startListening();
}
}
void check_radio(void){

  bool tx,fail,rx;
  radio.whatHappened(tx,fail,rx);

  if(rx){
    Serial.println("interrupt!!");
//radio.startListening();
    radio.read( &data, sizeof(data) );
    inradio+=data;
    Serial.println(data);
    if(inradio.endsWith("~")){
      Serial.println(inradio);

      if(inradio.startsWith("rgb: ")){
        analogWrite(6,inradio.substring(5,8).toInt());
        analogWrite(9,inradio.substring(8,11).toInt());
        analogWrite(5,inradio.substring(11,14).toInt());
      }
      inradio = "";
      //radio.stopListening();
    }
  }
}

Arduino 2 receives all data from ar1 but when I press the button attached to the pin 7 arduino 2 stops listening and only sends the first character of the string.

There is probably a death-lock situation where both arduino's are trying to send data the the other, while both aren't listening. So both are waiting for the other to ack. Like I said at your previous question. Why not send all rgb data in one packet. Also, there is no need to call radio.stopListening.

I tried to send a string and on the other side i did not receive these characters but some others. Besides that I have to call stopListening because in the loop I write. Another question: If receiver receives ack package does it cause an interrupt?

The receiver doesn't receive an ACK. Only the sender does. You can send data while you are still listening. No need to call stopListening before calling radio.write().

I said that because when i press the button the receiver turns into sender and sends a string. Then it waits for an ack. So if it receives an ack it breaks the for loop and mabe it is the reason that it sends only one char

You send one char, and wait for and ACK. Then you send the next char and wait for an ACK. If the other unit doesn't process the message, the buffer will will up after 3 messages, and it will no longer send an ACK (because the buffer is full), and you while loop will hang.

So what should i do to make it work?

I already told you twice.

Yes but when i send string it doesnt arrive as it is it shows some random chars

And all tutorials on the internet use the char by char method

Use RF24 library's examples. tmrh20.github.io/RF24 is the webpage you can find them.

I copy-pasted @Gerben comments as an answer. Please, accept it to close the question.

@Gerber remarked:
There is probably a death-lock situation where both arduino's are trying to send data the the other, while both aren't listening. So both are waiting for the other to ack. Like I said at your previous question. Why not send all rgb data in one packet. Also, there is no need to call radio.stopListening.
You send one char, and wait for and ACK. Then you send the next char and wait for an ACK. If the other unit doesn't process the message, the buffer will will up after 3 messages, and it will no longer send an ACK (because the buffer is full), and you while loop will hang


text:
Bluetooth transfer problem with big files
I want to send some data from an Arduino Mega to an android device via bluetooth (HC-06). I have installed some sensors whose values are frequently written in an SD card. Every time a new string line is added in a text file of the SD card. This is the format of the line
27/5/2015,11:55:00,34.00,27.00,42.50,26.80,47.80,26.00,24.62,24.12,26,0,0,708,1023,1023,1023,1023,10.5,10.5,10.5,10.5

and this is part of the code. I send from a bluetooth terminal the string "download" and after that the text file is opened and every line is readed and sent to the android device via bluetooth.
void loop(void){
    while(Serial1.available()) {
       character = Serial1.read();
       content.concat(character);
     }

if (content == "download") {
    Serial.println(content);
    content = "";
    read_from_SD_Card();
    }
    ........................
    ........................
    ........................
}

void read_from_SD_Card(){
    myFile = SD.open("test.txt");
    if (myFile) {
        Serial1.println("test.txt:");

        while (myFile.available()) {
            Serial1.write(myFile.read());
      }
      myFile.close();
    }
else {
  Serial1.println("error opening test.txt");
  }
}

The problems are:

the data are downloaded only after an upload of the sketch has been done. (I can't upload the sketch once and download the data from time to time)
No more than 10-20 lines can be downloaded. With bigger files the downloading seems to slow down and finally stops after a few lines.

Any thoughts would be appreciated.

I suspect that this is a String class heap-fragementation issue (again). To test this you could sending a fixed string buffer (vector of characters, "Hello world" :). Do not use String and SD/FAT in the test. Just send a large number of lines with dummy data.
If this works replace the String usage with a character buffer. Fill it from the SD file (buffer size at a time) and write to Serial.
Cheers!

String content;
void loop()
{
    while(Serial1.available()) {
       character = Serial1.read();
       content.concat(character);
     }

if (content == "download")
{
    Serial1.println(content);
    content = "";
    read_from_SD_Card();
    }

........................
    ........................
    ........................
}//end of loop()

read_from_SD_Card(){
    myFile = SD.open("test.txt");
    if (myFile) {
        Serial1.println("test.txt:");

        while (myFile.available()) {
            Serial1.print(myFile.read());
      }
      myFile.close();
    }
else {
  Serial1.println("error opening test.txt");
  }
  Serial1.readString()//to flush the serial buffer.
}

Sorry, I changed Serial.write() to Serial.print() and added Serial.readString() in order to flush the buffer, but it didn't seem to solve the problem.

@user3060854 -- were you able to resolve this? A higher baud rate for communicating with the HC bluetooth module can help with your speed/slowdown problem. But have noticed baud rates above 115200 dont work well. I believe the problem is the receiver baud rate %error, which should not happen at 250k baud. But I havent figured out how to set a baud rate of 250k in the BT module. The question with details is here ---  Setting non-standard baud rate (250k) for the HC-05 bluetooth module


text:
how to make transmitter and receiver for quad copter?
I want to make a transmitter and receiver for quad copter for that I am using two arduinos(UNO and nano).I am using 4 pots for controlling the brushless motors.For that I am sending 4 integer values of the pots and with that integer value PWM signals are generated at receiver by the arduino.Now I want to know how to send that 4 integer values of the pots serially using arduino.

The APC220 radio module provides a simple and economic solution to wireless data communications. Integrates an embedded high speed microprocessor and high performance IC that creates a transparent UART/TTL interface, and elminates any need for packetizing and data encoding. Use this module as this works as a pair and more intriguing part is that "it" can transmit over a km away.
link ~http://www.dfrobot.com/index.php?route=product/product&filter_name=apc&product_id=57#.VWeKIVWqqko

Thanks,that's fine,but I want to know how to convert parallel data to serial data of the integer values using arduino.

Just elaborate on the data type you are talking about, then may be you can be directed properly