No, I don't think I've mixed up SPI. There is no clock for the display to read, so I don't think it can be SPI.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
uint8_t arr[]={0x42, 0x10, 0xcc};
uint8_t new_arr[]={0x43,0x50,0x3F,0x22,0x00,0x1F};
uint8_t autobaud[]={0x55};
void setup()
{
pinMode(2, INPUT);
pinMode(3, OUTPUT);
digitalWrite(3, HIGH); //set high as per the data sheet recommendation to mitigate spurious data
delay(1000);
// pinMode(8,OUTPUT);
// digitalWrite(8,HIGH);
// delay(20);
// digitalWrite(8,LOW);
Serial.begin(9600);
mySerial.begin(9600);
// UCSR0C = UCSR0C | B00000110;
delay(1000);
dostuff(autobaud, sizeof(autobaud));
dostuff(arr, sizeof(arr)); // the name of an array points to the array & you are passing 10 values
dostuff(new_arr, sizeof(new_arr)); // the name of an array points to the array & you are passing 10 values
}
void loop()
{
}
void dostuff(uint8_t *buffer, int len)
{
mySerial.write(buffer, len); // Serial.write wants the array pointer and the number of elements
/*more stuff*/
serial_response();
// memset(&a, 0, BUF);
}
void serial_response(){
// delay(1);
// int incomingByte=0;
// if (Serial.available() > 0) {
// // read the incoming byte:
// incomingByte = Serial.read();
//
// if (incomingByte = 0x15)
// return;
//
// // Serial.print("I received: ");
// Serial.println(incomingByte, HEX);
// }
if (mySerial.available()>0){
Serial.println(mySerial.read());
}
}
Implemented softwareserial, now none of my code works
on the bright side, I can flash the arduino now without having to unplug the display.