![]() I was wondering in this piece of code that so wonderfully works,if I can set the clock frequency.And if yes how,because I modifed this code and used it for the ESP32 from Adafruit to input data as a MISO. It is my first post here,so excuse me for any mistakes. SPI.transfer((char)(EEPROM_address)) //send LSByte addressĭata = SPI.transfer(0xFF) //get data byteĭigitalWrite(SLAVESELECT,HIGH) //release chip, signal end transferĮeprom_output_data = read_eeprom(address) What's the confusion Put your variable declarations before setup () by where all of your define 's are and they'll be global. SPI.transfer((char)(address)) //send LSByte address You declare variables in the scope of setup (), and you try to use them in the scope of loop (), so the compiler tells you that you haven't declared them to be used in the scope of loop (). Try this modified code : #include įor (int I=0 I>8)) //send MSByte address first You are trying to configure the Atmega328p SPI register on the Arduino Zero, which can't work.Īrduino provide a SPI library that is doing all of the register's stuff.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |