forked from dekuNukem/exixe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
160 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
arduino_library/exixe/examples/barebone/0_LED_test/0_LED_test.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
Demo for exixe modules | ||
https://github.com/dekuNukem/exixe | ||
exixe "Getting Started" guide | ||
https://github.com/dekuNukem/exixe/blob/master/getting_started.md | ||
Demo 0: Show a purple LED | ||
*/ | ||
|
||
#include <SPI.h> | ||
#define SPI_BUF_SIZE 16 | ||
|
||
uint8_t spi_buf[SPI_BUF_SIZE]; | ||
// change this to the cs pin you're using | ||
const int slaveSelectPin = 10; | ||
|
||
void setup() | ||
{ | ||
pinMode(slaveSelectPin, OUTPUT); | ||
digitalWrite(slaveSelectPin, HIGH); | ||
|
||
SPI.begin(); | ||
// 8MHz SCLK, MSB first, SPI mode 0 | ||
SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0)); | ||
|
||
spi_buf[0] = 0xaa; // first byte, header | ||
spi_buf[13] = 0x80 | 127; // red LED full brightness | ||
spi_buf[14] = 0x80 | 0; // green LED off | ||
spi_buf[15] = 0x80 | 127; // blue LED full brightness | ||
} | ||
|
||
void loop() | ||
{ | ||
// cs low | ||
digitalWrite(slaveSelectPin, LOW); | ||
// send 16 byte command | ||
for (int i = 0; i < SPI_BUF_SIZE; ++i) | ||
SPI.transfer(spi_buf[i]); | ||
// cs high | ||
digitalWrite(slaveSelectPin, HIGH); | ||
|
||
delay(200); | ||
} |
45 changes: 45 additions & 0 deletions
45
arduino_library/exixe/examples/barebone/1_show4/1_show4.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
Demo for exixe modules | ||
https://github.com/dekuNukem/exixe | ||
exixe "Getting Started" guide | ||
https://github.com/dekuNukem/exixe/blob/master/getting_started.md | ||
Demo 1: Show digit 4 with orange backlight | ||
*/ | ||
|
||
#include <SPI.h> | ||
#define SPI_BUF_SIZE 16 | ||
|
||
uint8_t spi_buf[SPI_BUF_SIZE]; | ||
// change this to the cs pin you're using | ||
const int slaveSelectPin = 10; | ||
|
||
void setup() | ||
{ | ||
pinMode(slaveSelectPin, OUTPUT); | ||
digitalWrite(slaveSelectPin, HIGH); | ||
|
||
SPI.begin(); | ||
// 8MHz SCLK, MSB first, SPI mode 0 | ||
SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0)); | ||
|
||
spi_buf[0] = 0xaa; // first byte, header | ||
spi_buf[4] = 0x80 | 127; // digit 4 full brightness | ||
spi_buf[13] = 0x80 | 127; // red LED full brightness | ||
spi_buf[14] = 0x80 | 28; // green LED brightness 28 | ||
spi_buf[15] = 0x80 | 0; // blue LED fully off | ||
} | ||
|
||
void loop() | ||
{ | ||
// cs low | ||
digitalWrite(slaveSelectPin, LOW); | ||
// send 16 byte command | ||
for (int i = 0; i < SPI_BUF_SIZE; ++i) | ||
SPI.transfer(spi_buf[i]); | ||
// cs high | ||
digitalWrite(slaveSelectPin, HIGH); | ||
|
||
delay(200); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.