Esteemed Forum Participants & Lurkers:
I am starting out on some Serial Port programming on a Mega 2560. My first task is to communicate with a Multimeter with an RS-232 port. I have started a simple test program that just spits out a "Hello World" message on Serial1, but I can't set the "Parameters" for the port ... I get an error message at the following line:
Serial1.begin(19200, SERIAL_8N2);
serialtest.cpp: In function ‘void setup()’:
serialtest.cpp:25:23: error: ‘SERIAL_8N2’ was not declared in this scope
Where can I find the header file that defines the SERIAL Parameters that are found in the reference Serial.begin() - Arduino Reference. I couldn't find any examples of non-default port parameters.
Thank you for any and all comments, suggestions, and assistance.
Blessings in abundance, all the best, & ENJOY!
Art in Carlisle PA USA
Compiles just fine for me. Are you trying to do this in the main sketch file or some class implementation? If the latter, you likely need to include Arduino.h in that sketch.
Thanks Arrch ...
I'm temporarily running on a Linux Mint 14.1 LiveCD system on a diskless laptop and the directory structure is obviously "strange". My project is on a USB thumb drive and it compiles and downloads "Blink" just fine. I just find it odd that the compiler easily finds the serial baud rates but does not find the port Parameters. The version that is running is Arduino 1.0.1. I guess I'll have to do some more hunting or just wait until I get back on my Windows XP system.
Blessings in abundance, all the best, & ENJOY!
Art in Carlisle PA USA
PaulS ...
Thanks for the hint. I discovered a newer version of the Arduino software at http://arduino.cc/en/main/software and downloaded it. In the tgz file I found:
/arduino-1.0.3/hardware/arduino/cores/arduino/HardwareSerial.h
which does indeed contain the "SERIAL_" parameters. I'll see if I can get this new version up and running, but I'm assuming that the issue is now resolved because I can easily cut and paste the necessary definitions into my existing project.
Thanks to all ...
Blessings in abundance, all the best, & ENJOY!
Art in Carlisle PA USA
Esteemed Forum Participants & Lurkers:
I did get Arduino 1.0.3 running on my diskless Mint 14.1 LiveCD system. The page at http://www.pluggy.me.uk/arduino-ubuntu/ was extremely helpful. Also note that the executable 'arduino' file must be saved on a Linux 'ext' file system (I'm using an ext2 formatted USB flash drive).
The entire process consists of downloading and installing the following files from the Ubuntu repository:
NOT -> arduino_1.0.1+dfsg-7_all.deb
NOT -> arduino-core_1.0.1+dfsg-7_all.deb
avrdude_5.11.1-1_i386.deb
avr-libc_1.8.0-2_all.deb
binutils-avr_2.20.1-3_i386.deb
gcc-avr_4.7.0-2_i386.deb
libftdi1_0.20-1_i386.deb
libjna-java_3.2.7-4_i386.deb
librxtx-java_2.2pre2-11_i386.deb
Do the following in your arduino-1.0.3 directory:
Find the link to Linux (32 bit in my case) in http://arduino.cc/en/main/software and download it to your directory. Extract the arduino-1.0.3/arduino-1.0.3-linux32.tgz file. Now you can load the repository files. I renamed all of these files to the 'simple' names in the following code block:
To run the Arduino IDE, double click on the 'arduino' icon that was extracted and click "Run". The IDE window opens - you should select the proper serial port and board type. This is much more complicated and crude than having Arduino v1.0.3 in the Ubuntu repository, but it does work.
Version 1.0.3 does allow both Serial.begin(baud) and Serial.begin(baud, setup) functions - the latter of which I needed for non-standard serial port settings.
Blessings in abundance, all the best, & ENJOY!
Art in Carlisle PA USA
There is one more thing that has to be done to allow a connection to a Mega 2560 board (and others?) ... you have to add your user ID to the "dialout" group.
I think you do this after you plug in your Arduino board, but before you do anything else ...mint@mint ~ $ sudo usermod -aG dialout mintAfter you do this, log out and then back in and do:
mint@mint ~ $ groups
mint adm dialout cdrom sudo dip plugdev lpadmin sambashare
which shows that user mint is a member of group dialout.
I now have my Mega 2560 r3 board fully functional in Arduino IDE 1.0.3 in a diskless Mint 14.1 LiveCD system (32 bit Mate).
Blessings in abundance, all the best, & ENJOY!
Art in Carlisle PA USA
Esteemed Forum Participants & Lurkers:
Because of my own particular preferences and requirements (diskless LiveCD system), I have successfully automated the install process for the extracted Arduino v1.0.3 IDE. I just thought it might be of some interest to others ...
Here is the script file that I use to load the dependent files for the Arduino IDE v1.0.3. It must be in the same directory as the dependent files and when the icon is clicked, "Run in Terminal" should be selected:
#!/bin/sh
# RUN IN TERMINAL WITH: ./load
echo
sudo dpkg -i libjna-java.deb
echo
sudo dpkg -i librxtx-java.deb
echo
sudo dpkg -i binutils-avr.deb
echo
sudo dpkg -i gcc-avr.deb
echo
sudo dpkg -i libftdi1.deb
echo
sudo dpkg -i avrdude.deb
echo
sudo dpkg -i avr-libc.deb
echo
echo
echo 'Add user "mint" to group "dialout" - must log OUT/IN to be effective'
sudo usermod -aG dialout mint
echo
echo "Show the current groups for user "mint" - "dialout" NOT included yet!"
groups
echo
echo
echo "LOG OUT and then LOG BACK IN"
echo
sleep 5
When you log back in, if the USB drive is still plugged in there is a popup warning "Unable to mount " because the device is still mounted. Just click "OK".
It doesn't seem to matter when you plug in your Arduino board as long as you do it before you click on the extracted "arduino" icon.
Click on the extracted "arduino" icon and click "Run" to start the Arduino IDE. Be sure to immediately go to the Menu bar and select "Tools" and then select your Board type and Serial Port (mine is "ttyACM0").
Blessings in abundance, all the best, & ENJOY!
Art in Carlisle, PA USA