Hi everyone...
Using a Due and IDE 1.8.3. all I get is gibberish when I use Serial Monitor. But it was working last time I used this feature.
I have googled, and see others have had issues with USB interphase and gibberish.
Anyway. Everything else appears to work fine, I can upload new sketches. If I query the board via “Get Board Info ” I get an expected results. EG
BN: Arduino Due (Programming Port)
VID: 2341
PID: 003D
SN: 6403636313935190D021
I have tried different versions of IDE (1.8.2 and 1.6.13) still no change. I have tried different baud rates, still no good.
I have upload a bit of code for my Mega, Serial print works fine on this board, same IDE same PC and USB and same baud rates.
On the DUE (code below in void Spectrum() )
Serial.print("myColour = "); returns backward version of ”??????=”
Serial.println(myColour); returns a letter and a number EG “RT2” ECT.
Was unable to copy and paste the Serial monitor screen. But have included a screen shot.
I have added some code below, the whole code is to big to add here, but this should be enough so YOU can see. happy to add anything else that you may require to help me here.
#define BAM_RESOLUTION 4
const int Size_CW = ((1 << BAM_RESOLUTION) - 1) * 6;
int myColour = 0;// General purpose variable.
void setup() {
Serial.begin(115200);
//*** Set up SPI - Using SPI Library.
SPI.begin();//start up the SPI library
SPI.setBitOrder(MSBFIRST);//Most Significant Bit First
SPI.setDataMode(SPI_MODE0);// Mode 0 Rising edge of data, keep clock low
SPI.setClockDivider(4);//Run the data in at 21MHz
//Set up the Outputs for Latching and Blanking pins on the shift registers .
pinMode (6, OUTPUT); // Sets PIOC bit 24 as output, blank_pin.
pinMode (7, OUTPUT); // Sets PIOC bit 23 as output, latch_pin.
//*** Here layer pins are set as outputs
pinMode(23, OUTPUT);// Layer 1
pinMode(25, OUTPUT);
pinMode(27, OUTPUT);
pinMode(29, OUTPUT);
pinMode(31, OUTPUT);
pinMode(33, OUTPUT);
pinMode(35, OUTPUT);
pinMode(37, OUTPUT);
pinMode(39, OUTPUT);
pinMode(41, OUTPUT);
pinMode(43, OUTPUT);
pinMode(45, OUTPUT);// Layer 12
FillColourWheel();//Fill colour wheel with array of colour - Call Colour [0 - Size_CW] [0=R,1=G,2=B] or GetColour[colour#]
//**** Calculate the time required to upload the shift registers. Used to set min On time in Backend. ***********
unsigned long InterruptUpdateRunTime = micros();
TC3_Handler(); //Call Cube Update code to see how long an update takes.
MinInterruptTime = (micros() - InterruptUpdateRunTime ); //Time taken to upload the shift registers once.
//****Start the Interrupts *******
startTimer(TC1, 0, TC3_IRQn, 1000); //TC1 channel 0, the IRQ for that channel and the desired frequency
}//***end setup***
void loop() {
Spectrum();
}
void Spectrum() {
for (myColour = 0; myColour < Size_CW; myColour++) {
GetColour(myColour);
Serial.print("myColour = ");//<------------------------here
Serial.println(myColour);//<------------------------here
for (byte y = 0; y < Size_Y; y++) {
for (byte x = 0; x < Size_X; x++) {
for (byte z = 0; z < Size_Z; z++) {
LED(y, x, z, myRed, myGreen, myBlue);
}
}
} delay(100);
}
CleanCube();
}
//********** Get Colour and check it is within tolerance. ********************
void GetColour(int colour) {// Standard colours from colour wheel
while (colour < 0) { //If "colour" is a negitive value
colour += Size_CW;
}
while (colour >= Size_CW) { //If "colour" is greater than Size of Colour Wheel.
colour -= Size_CW;
}
myRed = Colour[colour][0];
myGreen = Colour[colour][1];
myBlue = Colour[colour][2];
}
//Clean Cube *********************************************
void CleanCube() {
memset(red, 0, (Size_Cube / 8)* BAM_RESOLUTION * sizeof(byte));
memset(green, 0, (Size_Cube / 8)* BAM_RESOLUTION * sizeof(byte));
memset(blue, 0, (Size_Cube / 8)* BAM_RESOLUTION * sizeof(byte));
}// *****************************************************
Where should I be looking?
