Hot answers tagged

4

Java is a programming language. Arduino is a platform that is mostly accessed by the C++ programming language. You cannot run "Arduino code" in Java.


4

how do i replace [an RTC] chip with software? You can't. An RTC is made of basically two things: a carefully trimmed crystal oscillator that has a very stable and well calibrated frequency some logic to count the oscillations and convert that to time and date. The logic can be easily replaced by software, but the crystal cannot. Any “pure software” ...


2

As suggested by Gerben, you can go into Preferences and check the box "Use external editor": Now you can edit with your favourite editing program. With this option active the IDE will show your sketch but in a non-editable way, and with a blue (cyan?) backwash: Whenever you save the file in your external editor the IDE will detect the change and refresh ...


2

Note: does not work with version 1.6.11. Works with 1.0.6 Open the Arduino IDE Go to File Then go to Preferences At the bottom of the page is the file location you can enter to set additional preferences Exit the Arduino IDE Go to the preferences file location then set editor.caret.blink=false Then save Then restart the IDE and the caret will not flash


2

The problem is, that "char" is just one character. So you have to build your return out of the chars... if you want to use the "client.read()" function. String res = ""; //this will be the resived msg after the loop do { char c = client.read(); //c will be -1 if no byte is left if(c!=-1) strcat(res, String(c)); //Append the char to the result ...


2

A more low-tech solution might be better. For example, a couple of light beams across the doorway to the kitchen. An human would block both of them as they passed, and a dog only the lower one. You could sound an alarm if the lower one is broken, and the upper one is not broken (within a second). Or do something with infra-red transmitters / receivers. ...


2

First things first: do you know that a GPS can locate your dog accurately enough in your home? Basically, even with a good GPS receiver, the best accuracy you can expect (using off-the-shelf receivers, non-military or DGPS) is maybe 3 m. Typical performance is maybe 4 m, and indoors it will be even worse. The point is, your dog could be 5 m away from your ...


2

Your EEPROM has I2C interface, so first you shall program Arduino to access it: An I2C EEPROM Class for Arduino Then implement some kind of communication protocol over serial, to send commands instructing Arduino to read/write from EEPROM. For example, with following commands: for writing write:<address>,<count>,<data_as_hex_string> for ...


2

Although you can't straight-up change variables on the Arduino, you can create your own protocol over a serial connection using processing (https://processing.org) on your computer, and a sketch on Arduino. Use the function Serial.begin(9600); on the arduino to initialise a serial connection to your computer, and then in processing use the lines: Serial ...


2

There is a project called uJ by Dmitry Grinberg that enables you to do that, somehow. It has been tested on AVR devices too, not your particular one however. Knowing AVRs, that shouldn't be a stopper at all. That said, I don't think it's a very good idea. The overhead of the JVM may only let you handle some 'slow' signals, unless you heavily rely on ...


2

I was able to establish bluetooth communication between Arduino and my laptop successfully. I made some observations, which I'd like to share. BlueCove library which I've been using, ultimately communicates to the Arduino by constructing a bluetooth URL. This bluetooth URL is of the form btspp://bluetooth_address_without_colon:1;authenticate=false;encrypt=...


1

Your problem is that you aren't providing anything to split the data on. You just send the X and y coordinates with a : between X and y. There's nothing between the y and the next X. By changing the line port.write(x+":"+y); To port.write(x+":"+y+"\n"); You then get the linefeed character to split your data on.


1

The Arduino can't run Java. Full stop.


1

Are using a bluetooth module like HC-05 or HC-06? Then first establish an connection to the module. Then start sending bytes(a string). But first thing first start the connection. Ive only done it with an Android to Arduino, but still the Android is written with Java.


1

Consider giving sufficient delay to initiate the time to receive the data. The loop would otherwise terminate since the data received is less than 3


1

Having looked at you other question it seems you are trying to run before you can walk. You may be a good java programmer, but you need to get your head around C++ before you go all in and build a clock. To answer this question, yes there are ways to get software to keep time, but when you power it up, how do you know what the time is? This is where ...


1

A couple of things you can try. First, make sure your assembly code makes the blink() function visible to the linker. blink.S should start like this: #define __SFR_OFFSET 0 #include <avr/io.h> .section .text .global blink blink: ; Your assembly code goes below the above label. Next, your sketch file should not try to include the assembly ...


1

There's four things I can see wrong (one of which is my fault, actually - I should have mentioned it in the previous question - nevermind). Firstly you cannot include a .S file in a .INO file. A .S file is assembly, a .INO file is C++. You can't mix the two in one file (and including a file does just that - includes the file verbatim at that point). So ...


1

The standard way of doing this is to use delimiters. Serial is a streaming protocol, you don't necessarily get data in fixed size chunks. Something suitable would be like: <1.23,4.56> Notice the delimiters "<", "," and ">". The receiving end ignores incoming data until it gets "<". Then it reads until it gets a comma. Between those two are the ...


1

The first time you open the serial port on the PC the Uno resets and enters the bootloader. Two seconds later your sketch starts running. By then you have already sent a load of your data to the Uno which it ignores because it's not valid bootloader commands. When your program exits it leaves the port in an different state (RXTX is crap and doesn't clean ...


1

Do not use SoftwareSerial on a hardware serial port. It is pointless. Do use a voltage divider to convert the Arduino's 5V TX to the required 3.3V the ESP8266 needs. Do not try and program the Arduino as if it were an ESP8266 - it won't work. I think you are getting a little confused here...


1

The ESP trys to connect to port 4160, but the server is listing on port 20.


1

It looks like you're trying to send a custom message to arduino and have it respond. As a small add on to your code try serialCommand. It pulls in whatever you send over the command line and executes it as a command and returns whatever you need to whatever interface you gave such as softwareSerial. https://github.com/scogswell/ArduinoSerialCommand/tree/...


1

you can read a complete (real project) example about how to receive messages from Arduino with Ardulink from here: https://github.com/openQCM In general you can use a listener (digital, analog, and raw) to receive messages from Arduino. A raw listener receive all messages received from Arduino, so you need to implement code to filter the messages you are ...


1

There's a number of fundamentally wrong things in your sketch. static char buffer[1]; // a variable to hold both sensor data No - that has room for 1 entry - hence the 1. 1 means 1, not 2. buffer[1] = newByte; No. There is no buffer[1]. You count slices from 0. buffer[0] exists (the first one) but buffer[1] doesn't. buffer[0] = millis; You aren't ...


1

Search for "embedded java". Oracle supports it for ARM cores, which is what some of the arduino-like boards such as the Teensy 3.X have, but I doubt they have enough resources to support it. There is haiku-vm (google it!) that's designed with AVR processors in mind, but I don't know how actively it is being worked on. Googling "embedded java avr" yields a ...


1

I had this problem with communication with Arduino Uno (I think that the Arduino Uno, and other boards, with this type of scheme, suffer this problem). The DTR line on Arduino Uno is connected with RESET, including when you use the Arduino IDE Serial Monitor port, such that the parameter of DTR is false. Yeah, you can fix this with capacitor or catch place ...


1

My thought is that, because the audio visualizer sends color profiles dozens of times per second, the Arduino might be getting overloaded with data. Is that possible? Close, but the source of the problem is probably this line Serial.flush(); //clear out the serial to prep for next time Because your audio visualizer keeps sending data, it's quite likely ...


Only top voted, non community-wiki answers of a minimum length are eligible