Standalone program using Matlab(GUI) and Arduino - arduino

I have built a matlab code with gui. It is connected to arduino. it works well on the matlab environment. but when i try to make a standalone program using deploytool, the program(gui) opens but it can not connect to arduino. matlab runtime is installed.
error messages:
Undefined function or variable 'registerrealtimecataloglocation'.
Error in arduinoio.internal.BaseClass (line 32)
Error in arduino
Error in connection_trial>Con_Callback (line 142)
Error in gui_mainfcn (line 95)
Error in connection_trial (line 43)
Error in matlab.graphics.internal.figfile.FigFile/read>#(hObject,eventdata)connection_trial('Con_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback

to connect to Arduino through matlab , needs
- com port of Arduino
- uart.. or baud rate
- matlab statement: serConn = serial('Arduino com port here', 'TimeOut', 1, 'BaudRate', 9600);
- fopen(serConn);
- str=char(fread(serConn));
str will receive data from Arduino in case if arduino print in serial any data

Related

'analogWrite' was not declared in this scope

WHY I AM RECEVING ERROR LIKE THIS my other freinds are able to run same code
why i am receiving error like this
1)Select your correct board of Arduino and then compile. it will compile perfectly.
2) analogWrite() works in arduino boards and pins are following :
https://www.arduino.cc/reference/en/language/functions/analog-io/analogwrite/

I can't program my uC. Avrdude throws error which I don't understand

I used to programing my uCu before but now I have very weird error. It seems to be problem with programmer but I'm not sure. Avrdude throws this error:
C:\Users\Adam>avrdude -p m328p -c avrispmkII
avrdude: ser_open(): can't open device "\.\com1": The system cannot find the file specified.
and atmel studio this
Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool)
Unable to enter programming mode. Verify device selection, interface settings, target power, security bit, and connections to the target device
I have tried use different ports but it didn't help. Device Menager said I already have good driver. Please help me find the solution.
This is a picture of my circuit

Getting an syntax error by using RasPiArduino for Raspberry Pi

I am using an Raspberry Pi Zero with an L298n motor driver to control two motors. I was testing the motors using a Python script. That worked fine.
Now I wanted to use the Arduino software to program the motors. I was following this tutorial on how to archive that: https://www.youtube.com/watch?v=lZvhtfUlY8Y
Then I coded this into the Arduino software (v. 1.8.5)
void setup() {
// put your setup code here, to run once:
Console.println("Setup Einstellungen");
pinMode(17, OUTPUT);
delay(500);
Console.println("Setup Einstellungen Ende");
}
void loop() {
Console.println("Rechts Vorwärts");
digitalWrite(17, HIGH);
delay(1000);
digitalWrite(17, LOW);
delay(5000);
}
I compiled the file using "Export compiled Binary". I uploaded it on the Raspberry using FileZilla and tried to run it via SSH.
When I tried to run it with:
(sudo) sketch_feb28.ino.bplus.bin
I got the following error:
: -bash: syntax error near unexpected token `sketch_feb28.ino.bplus.bin'
Running file sketch_feb28.ino.bplus.bin
sketch_feb28a.ino.bplus.bin: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SY SV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2 .0, BuildID[sha1]=a0260345a3700dca64c63fde8a10959214ce9b85, not stripped
I cannot solve this issue alone.
I'm still not sure, where the syntax error comes from.
Run the file with:
./sketch_feb28.ino.bplus.bin
This is the syntax for running a binary, that is not in PATH. Since the file is a valid executable, the error message should vanish.

Teensy LC I2S example assembly error

I'm trying to use I2S (not I2C) with the Teensy LC and a SPH0645 digital microphone. The audio library that is included with the Teensyduino (v1.6.7 and ArduinoIDE 1.8.5) code is sufficient for my needs, but I get the following assembler error when I try to compile the Recorder example from the audio library:
/var/folders/4y/x458y3013g5d1xsgl7grxgwr0000gn/T//ccvznZoL.s: Assembler messages:
/var/folders/4y/x458y3013g5d1xsgl7grxgwr0000gn/T//ccvznZoL.s:231: Error: selected processor does not support `smull r0,ip,r3,r5' in Thumb mode
/var/folders/4y/x458y3013g5d1xsgl7grxgwr0000gn/T//ccvznZoL.s:232: Error: shifts in CMP/MOV instructions are only supported in unified syntax -- `mov ip,ip,asl r6'
/var/folders/4y/x458y3013g5d1xsgl7grxgwr0000gn/T//ccvznZoL.s:233: Error: unshifted register required -- `orr r0,ip,r0,lsr r7'
My problem apart from the error is that the message doesn't indicate which file is the culprit. So I was hoping someone maybe has some more experience with this kind of problem ;)

Processing to Arduino "IllegalAccessError"

I hope this exact issue was not addressed already. I did search for a while.
So I'm using the Arduino library for Processing, testing it by simply having it blink an LED that I have connected to my Arduino UNO. I'm following this tutorial, but am having a problem a little different than the ones covered on that tutorial page. Here's my Processing code:
import processing.serial.*;
import cc.arduino.*;
Arduino arduino;
int ledPin = 13;
void setup()
{
//println(Arduino.list());
arduino = new Arduino(this, Arduino.list()[0], 57600); //error here
arduino.pinMode(ledPin, Arduino.OUTPUT);
}
void draw()
{
arduino.digitalWrite(ledPin, Arduino.HIGH);
delay(1000);
arduino.digitalWrite(ledPin, Arduino.LOW);
delay(1000);
}
Here's my error:
IllegalAccessError: tried to access class processing.core.PApplet$RegisteredMethods from class cc.arduino.Arduino$SerialProxy
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
Exception in thread "Animation Thread" java.lang.IllegalAccessError: tried to access class processing.core.PApplet$RegisteredMethods from class cc.arduino.Arduino$SerialProxy
at cc.arduino.Arduino$SerialProxy.<init>(Arduino.java:119)
at cc.arduino.Arduino.<init>(Arduino.java:168)
at sketch_130206a.setup(sketch_130206a.java:29)
at processing.core.PApplet.handleDraw(PApplet.java:2117)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:193)
at processing.core.PApplet.run(PApplet.java:2020)
at java.lang.Thread.run(Thread.java:680)
Since my error apparently has to do with access permissions, I tried doing what it says at the tutorial page I was following by going to /var/lock folder, but the /lock folder doesn't exist! I'm using a Mac 10.8.2. I searched around and found this thread (arduino dot cc/forum/index.php?topic=135164.0) and decided to try "sudo mkdir -p /var/lock" and "sudo chmod 777 /var/lock" in terminal, but it didn't change the error I have in Processing, even after restarting it. I also tried opening the Arduino app and uploading the StandardFirmata sketch as mentioned at the ProcessngxArduino library download page (playground.arduino dot cc/interfacing/processing) while trying to run the processing sketch, but same error. The fact that I'm using the Arduino UNO instead of the Duemilanove shouldn't be the issue as the UNO is apparently just an updated version of it. Any ideas what I could try to do next?
UPDATE: Okay so the highlighted error in my code is what opens the serial port I'm using at whatever rate (57600 bits/sec in this case I think). So I think the problem lies in this particular step in the instructions at the adrunio x processing info page mentioned earlier(playground dot arduino dot cc/interfacing/processing), step 3: "Configure Processing for serial: processing dot org/reference/libraries/serial/"... the link goes to processing's 'serial' reference page. I'm confused about what is meant by "configure"? How exactly do I figure out my "correct serial port"? I went through the rest of the instructions and the examples on the serial reference page, and still have no idea what I'm looking for.
UPDATE #2: My serial port for the arduino is "/dev/tty.usbmodem1411". I am still confused about how to plug this in to my code in Processing though. The things I just learned in these last 2 updates might be irrelevant to my error, I'm still unsure.
The problem was that I was using the beta version of Processing (2.0). Use the latest stable version (1.5.1) and it should work.

Resources