I have been attempting to load a simple sketch, Sinewave, an example from MegunoLink.
This sketch works just fine when loaded to an Uno. When I attempt to load it to the Razor, if "switches the COM port in the middle of the upload. Below is a fragment of the upload listing. No errors are reported in the compile.
.
.
.
Using library MegunoLink at version 1.22 in folder: C:\Users\RBerliner\Documents\Arduino\libraries\MegunoLink
“C:\Users\RBerliner\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-size” -A “C:\Users\RBERLI~1\AppData\Local\Temp\arduino_build_585125/Sinewave.ino.elf”
Sketch uses 26008 bytes (9%) of program storage space. Maximum is 262144 bytes.
Forcing reset using 1200bps open/close on port COM7
PORTS {COM1, COM2, COM3, COM7, } / {COM1, COM2, COM3, } => {}
PORTS {COM1, COM2, COM3, } / {COM1, COM2, COM3, } => {}
PORTS {COM1, COM2, COM3, } / {COM1, COM2, COM3, } => {}
PORTS {COM1, COM2, COM3, } / {COM1, COM2, COM3, COM8, } => {COM8, }
Found upload port: COM8
C:\Users\RBerliner\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0/bossac.exe -i -d --port=COM8 -U true -i -e -w -v C:\Users\RBERLI~1\AppData\Local\Temp\arduino_build_585125/Sinewave.ino.bin -R
Set binary mode
.
.
.
At the end it reports
.
.
.
done in 0.164 seconds
Verify 26268 bytes of flash with checksum.
checksumBuffer(start_addr=0x2000, size=0x1000) = ddcc
checksumBuffer(start_addr=0x3000, size=0x1000) = 765b
checksumBuffer(start_addr=0x4000, size=0x1000) = 23b7
checksumBuffer(start_addr=0x5000, size=0x1000) = 2554
checksumBuffer(start_addr=0x6000, size=0x1000) = bc4f
checksumBuffer(start_addr=0x7000, size=0x1000) = 79c4
checksumBuffer(start_addr=0x8000, size=0x69c) = 4214
Verify successful
done in 0.025 seconds
CPU reset.
readWord(addr=0)=0x20007ffc
readWord(addr=0xe000ed00)=0x410cc601
readWord(addr=0x41002018)=0x10010305
writeWord(addr=0xe000ed0c,value=0x5fa0004)
When the sketch is loaded to a UNO, it spits out sine and cosine values. on the Serial Monitor.
On the Razor, there is nothing.
The Sinewave sketch is listed below. It is simple enough although maybe there is some reason I should not expect this to work.
/* **********************************************************************************************
-
Example program to plot sine wave data on MegunoLink’s Time Plot visualiser
-
for more information.
-
********************************************************************************************** */
#include “MegunoLink.h”
// For more information on installing the MegunoLink Arduino library check out our documentation
// http://www.megunolink.com/documentation … tegration/
// You can download the MegunoLink Interface (.mlx) that goes with this example here
// http://www.megunolink.com/examples/ardu … newave.mlx
// Uncomment if you would like to use plotting channels
// TimePlot MyPlot(“Waveforms”); //“Waveforms” = the taget plotting channel (remember to select this in megunolink)
TimePlot MyPlot; //no channel selected
void setup()
{
Serial.begin(9600);
MyPlot.SetTitle(“Sine and Cosine Function Waveforms”);
MyPlot.SetXlabel(“Time”);
MyPlot.SetYlabel(“Amplitude”);
// Set the plotting parameters. “Sinewave” = series name, Plot::Blue = line colour
// 2 = line width, Plot::Square = marker style
MyPlot.SetSeriesProperties(“Sinewave”, Plot::Blue, Plot::Solid, 2, Plot::Square);
MyPlot.SetSeriesProperties(“Cosinewave”, Plot::Red, Plot::Solid, 2, Plot::Square);
// Colours include
// Red, Green, Blue, Yellow, Black, Magenta, Cyan, White
// Markers include
// Square, Diamond, Triangle, Circle, Cross, Plus, Star, DownwardTriangle, NoMarker
// Line style
// Solid, Dashed, Dotted, DashDot, DashDotDot
}
#define HW_LED_PIN 13 // LED attached to pin 13
void blinkLED()
{
static bool ledState = false;
digitalWrite(HW_LED_PIN, ledState);
ledState = !ledState;
}
void loop()
{
double dY, dY2;
float seconds;
float frequency = 0.5; //Hz
float phase = 3.141/2;
seconds = (float)millis()/1000;
dY = sin(2 * 3.141 * frequency * seconds);
dY2 = cos(2 * 3.141 * frequency * seconds + phase);
//Send Data To MegunoLink Pro
MyPlot.SendData(F(“Sinewave”),dY); // Sinewave = series name, dY = data to plot
MyPlot.SendData(F(“Cosinewave”),dY2); // By wrapping strings in F(“”) we can save ram by storing strings in program memory
blinkLED();
delay(10);
}