Hi Jon,
The serialCommunication example includes an Embedded MATLAB block. If you use EmbeddedMATLAB, Stateflow, or a TruthTable block, Simulink will try to build code for the simulation using the compiler you have chosen using mex -setup. Because the Arduino requires C++ code generation, the simulation currently also needs to support C++. I will try to investigate a better solution, but for now, you will need to install a supported C++ compiler and choose that option by running "mex -setup" at the MATLAB command prompt. A list of supported compilers is shown here: http://www.mathworks.com/support/compilers/R2010a/index.html I'm using Microsoft Visual C++ 2005.
Hi Jon,
Yes, that's unfortunate, it looks like version 0018 has changed the directory structure which breaks the install script and the makefile. The change you made to the install script is correct. To fix the build error, I believe you only need to change line 126 in arduino.tmf to:
ARDUINO = $(INSTALL_DIR)/hardware/arduino/cores
Hi Matthew, the ~ is a new construct that was introduced in R2009b. The files will be updated shortly with a version without ~'s that works in R2009a and latter. In the meantime, you can simply replace the ~'s with valid variable names (x1, x2, etc.).
The latest version of Arduino Target (a.k.a Simulink Support Package for Arduino) addresses the above problems, and has improved support for Uno and newer Arduino boards: http://www.mathworks.com/matlabcentral/fileexchange/30277
Hello,
how can I receive 2 or more signals from analog input in demo_arduino_serial_communication. I used Mux (before int16 to uint8 converter) to collect 2 signals. But i do not know, how configure the serial receive at host side. What is the output of serial receive? (vector [1 1] is default, that doesn't work of course). I tried everything, [2 2], 2 ...
Boris,
Yes, you can get Arduino Uno working with the package. Try these steps in the Pref.m file:
1. Add a mcu function getMcuForAvrDude to use atmega328p whenever you are using atmega328p-pu. You can add it before the uploadRate function code:
function mcu = getMcuForAvrDude
mcu = arduino.Prefs.getPref('ArduinoMcu');
if strcmp(mcu,'atmega328p-pu')
mcu = 'atmega328p';
end
assert(~isempty(mcu),'Arduino MCU preference must be set');
end
2. Then include a case inside the uploadRate:
case 'atmega328p'
uploadRate = '115200';
3. At the very end of the Pref.m file, change the Device name for:
deviceName='\\Device\\USBSER000';
Hello
i have the arduino Uno with the atmega328p-pu and i have a familiar problem using the arduino target
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
i`ve red a lot about this but with no succes
all i am asking is can Arduino Uno work with arduino target and if so how can i solve this problem
The latest version of Arduino Target (a.k.a Simulink Support Package for Arduino) addresses the above problems, and has improved support for Uno and newer Arduino boards: http://www.mathworks.com/matlabcentral/fileexchange/30277
Comment only
26 Oct 2011
Arduino Target
Develop applications for the Arduino platform using Simulink®.
Hello,
how can I receive 2 or more signals from analog input in demo_arduino_serial_communication. I used Mux (before int16 to uint8 converter) to collect 2 signals. But i do not know, how configure the serial receive at host side. What is the output of serial receive? (vector [1 1] is default, that doesn't work of course). I tried everything, [2 2], 2 ...
Thanks
Comment only
11 Oct 2011
Arduino Target
Develop applications for the Arduino platform using Simulink®.
Boris,
Yes, you can get Arduino Uno working with the package. Try these steps in the Pref.m file:
1. Add a mcu function getMcuForAvrDude to use atmega328p whenever you are using atmega328p-pu. You can add it before the uploadRate function code:
function mcu = getMcuForAvrDude
mcu = arduino.Prefs.getPref('ArduinoMcu');
if strcmp(mcu,'atmega328p-pu')
mcu = 'atmega328p';
end
assert(~isempty(mcu),'Arduino MCU preference must be set');
end
2. Then include a case inside the uploadRate:
case 'atmega328p'
uploadRate = '115200';
3. At the very end of the Pref.m file, change the Device name for:
deviceName='\\Device\\USBSER000';
Hope these steps solve your problem
Comment only
08 Oct 2011
Arduino Target
Develop applications for the Arduino platform using Simulink®.
Hello
i have the arduino Uno with the atmega328p-pu and i have a familiar problem using the arduino target
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
i`ve red a lot about this but with no succes
all i am asking is can Arduino Uno work with arduino target and if so how can i solve this problem
Thanks
Comment only