Learning pcDuino for some days and had some gains. Just can driver SPI and have 74hc595 circuit module.
Driver it up
Code:
#include <stdio.h> #include <string.h> #include <core.h> #include "SPI.h" int led_pin = 10; //#define EX_SPI_TEST int ReadSpiflashID(void) { #include <stdio.h> #include <string.h> #include <core.h> #include "SPI.h" int led_pin = 10; //#define EX_SPI_TEST int ReadSpiflashID(void) { pinMode(led_pin, OUTPUT); digitalWrite(led_pin, LOW); SPI.transfer (0x20,SPI_CONTINUE); digitalWrite(led_pin, HIGH); return 9; } void setup() { pinMode(led_pin, OUTPUT); SPI.begin(); SPI.setDataMode(SPI_MODE3); SPI.setBitOrder(MSBFIRST); SPI.setClockDivider(SPI_CLOCK_DIV16); } void loop() { //MSB first printf("spi flash id = 0x%x\n", ReadSpiflashID()); delay(2000); }
Leave a Reply
You must be logged in to post a comment.