connect two modules
This commit is contained in:
parent
f0dda73441
commit
72cfa9aa64
|
@ -3246,6 +3246,11 @@
|
||||||
(effects (font (size 1.27 1.27)) (justify left bottom))
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
(uuid 4b83862e-3ecd-4e46-936d-eb3c75672377)
|
(uuid 4b83862e-3ecd-4e46-936d-eb3c75672377)
|
||||||
)
|
)
|
||||||
|
(text "Current: flipping one column to black takes 0.5A @14V"
|
||||||
|
(at 118.745 28.575 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
(uuid aedcc90b-4037-4ab7-8ee6-c99244473a5a)
|
||||||
|
)
|
||||||
(text "Prüfen, ob 1k reicht oder wirklich 500 ohm notwendig für clock"
|
(text "Prüfen, ob 1k reicht oder wirklich 500 ohm notwendig für clock"
|
||||||
(at 274.32 59.055 0)
|
(at 274.32 59.055 0)
|
||||||
(effects (font (size 1.27 1.27)) (justify left bottom))
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
|
|
@ -29,8 +29,8 @@ D3 - _clear
|
||||||
#define PIN_DRIVE 25 //enables 12v to panels via transistor
|
#define PIN_DRIVE 25 //enables 12v to panels via transistor
|
||||||
#define PIN_CLEAR 12 //connects CLEAR Pin from Annax board to GND (clears column)
|
#define PIN_CLEAR 12 //connects CLEAR Pin from Annax board to GND (clears column)
|
||||||
|
|
||||||
#define NUMPANELS 1
|
//#define NUMPANELS 1
|
||||||
#define COLUMNBYTES 7 //4 columns per byte. one panel has 25 columns
|
#define COLUMNBYTES 13 //4 columns per byte. one panel has 25 columns. (int)((numpanels*25)/4+1)
|
||||||
|
|
||||||
|
|
||||||
//### Timings ###
|
//### Timings ###
|
||||||
|
|
|
@ -67,7 +67,7 @@ bool Flipdot::clearSelectedColumn() {
|
||||||
if (row!=0) {
|
if (row!=0) {
|
||||||
return 0; //error. row is selected (short circuit!)
|
return 0; //error. row is selected (short circuit!)
|
||||||
}
|
}
|
||||||
for (uint8_t cc=0;cc<7;cc++) {
|
for (uint8_t cc=0;cc<COLUMNBYTES;cc++) {
|
||||||
//Serial.print("checking cc="); Serial.println(cc);
|
//Serial.print("checking cc="); Serial.println(cc);
|
||||||
for (uint8_t i=0;i<8;i+=2) {
|
for (uint8_t i=0;i<8;i+=2) {
|
||||||
if (CHECK_BIT(col[cc],i)) {
|
if (CHECK_BIT(col[cc],i)) {
|
||||||
|
@ -88,7 +88,7 @@ bool Flipdot::clearSelectedColumn() {
|
||||||
|
|
||||||
bool Flipdot::setSelectedDot() {
|
bool Flipdot::setSelectedDot() {
|
||||||
|
|
||||||
for (uint8_t cc=0;cc<7;cc++) {
|
for (uint8_t cc=0;cc<COLUMNBYTES;cc++) {
|
||||||
//Serial.print("checking cc="); Serial.println(cc);
|
//Serial.print("checking cc="); Serial.println(cc);
|
||||||
for (uint8_t i=1;i<8;i+=2) {
|
for (uint8_t i=1;i<8;i+=2) {
|
||||||
if (CHECK_BIT(col[cc],i)) {
|
if (CHECK_BIT(col[cc],i)) {
|
||||||
|
@ -112,7 +112,7 @@ bool Flipdot::setSelectedDot() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Flipdot::HBridgeOK() {
|
bool Flipdot::HBridgeOK() {
|
||||||
for (uint8_t cc=0;cc<7;cc++) {
|
for (uint8_t cc=0;cc<COLUMNBYTES;cc++) {
|
||||||
//Serial.print("checking cc="); Serial.println(cc);
|
//Serial.print("checking cc="); Serial.println(cc);
|
||||||
for (uint8_t i=0;i<8;i+=2) {
|
for (uint8_t i=0;i<8;i+=2) {
|
||||||
if (CHECK_BIT(col[cc],i) && CHECK_BIT(col[cc],i+1)) {
|
if (CHECK_BIT(col[cc],i) && CHECK_BIT(col[cc],i+1)) {
|
||||||
|
@ -136,13 +136,13 @@ void Flipdot::shiftData() { //send out all data to shift registers
|
||||||
digitalWrite(PIN_LATCH, LOW);
|
digitalWrite(PIN_LATCH, LOW);
|
||||||
|
|
||||||
//Select Columns via Shift registers
|
//Select Columns via Shift registers
|
||||||
for (uint8_t i=0;i<7;i++) {
|
for (uint8_t i=0;i<COLUMNBYTES;i++) { //adsf: previously i<7
|
||||||
shiftOutSlow(PIN_DATA_DRVBRD, PIN_CLK_DRVBRD, LSBFIRST, col[6-i]);
|
shiftOutSlow(PIN_DATA_DRVBRD, PIN_CLK_DRVBRD, LSBFIRST, col[COLUMNBYTES-1-i]); //asdf previously col·[6-i]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Flipdot::resetColumns() {
|
void Flipdot::resetColumns() {
|
||||||
for (uint8_t i=0;i<7;i++) {
|
for (uint8_t i=0;i<COLUMNBYTES;i++) {
|
||||||
col[i]=0;
|
col[i]=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -26,21 +26,24 @@ void loop_drawClearTest();
|
||||||
void loop() {
|
void loop() {
|
||||||
loopmillis = millis();
|
loopmillis = millis();
|
||||||
|
|
||||||
//loop_drawClearTest();
|
loop_drawClearTest();
|
||||||
loop_testDots();
|
//loop_testDots();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define COLUMNS 50
|
||||||
|
#define ROWS 16
|
||||||
|
|
||||||
void loop_testDots() {
|
void loop_testDots() {
|
||||||
|
|
||||||
static bool init=false;
|
static bool init=false;
|
||||||
if (!init) {
|
if (!init) {
|
||||||
flipdot.row=0;
|
flipdot.row=0;
|
||||||
Serial.println("Clearing Display");
|
Serial.println("Clearing Display");
|
||||||
for (int l=0;l<25;l++) {
|
for (int l=0;l<COLUMNS;l++) {
|
||||||
flipdot.selectColumnClear(l%25);
|
flipdot.selectColumnClear(l%COLUMNS);
|
||||||
|
|
||||||
flipdot.shiftData();
|
flipdot.shiftData();
|
||||||
|
|
||||||
|
@ -105,8 +108,8 @@ void loop_drawClearTest() {
|
||||||
if (!init) {
|
if (!init) {
|
||||||
flipdot.row=0;
|
flipdot.row=0;
|
||||||
Serial.println("Clearing Display");
|
Serial.println("Clearing Display");
|
||||||
for (int l=0;l<25;l++) {
|
for (int l=0;l<COLUMNS;l++) {
|
||||||
flipdot.selectColumnClear(l%25);
|
flipdot.selectColumnClear(l%COLUMNS);
|
||||||
|
|
||||||
flipdot.shiftData();
|
flipdot.shiftData();
|
||||||
|
|
||||||
|
@ -137,8 +140,8 @@ void loop_drawClearTest() {
|
||||||
|
|
||||||
|
|
||||||
//cycle testing set dots
|
//cycle testing set dots
|
||||||
flipdot.selectColumnSet(countz/16); //lower column number is on the left
|
flipdot.selectColumnSet(countz/ROWS); //lower column number is on the left
|
||||||
flipdot.row=pow(2, (countz)%16);//low significant bits are lower rows (when connector at top)
|
flipdot.row=pow(2, (countz)%ROWS);//low significant bits are lower rows (when connector at top)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -166,7 +169,7 @@ void loop_drawClearTest() {
|
||||||
last_update=loopmillis;
|
last_update=loopmillis;
|
||||||
countz++;
|
countz++;
|
||||||
|
|
||||||
if (countz>=16*25) {
|
if (countz>=ROWS*COLUMNS) {
|
||||||
countz=0;
|
countz=0;
|
||||||
init=false;
|
init=false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue