connect two modules

This commit is contained in:
interfisch 2023-02-07 18:37:23 +01:00
parent f0dda73441
commit 72cfa9aa64
4 changed files with 25 additions and 17 deletions

View File

@ -3246,6 +3246,11 @@
(effects (font (size 1.27 1.27)) (justify left bottom))
(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"
(at 274.32 59.055 0)
(effects (font (size 1.27 1.27)) (justify left bottom))

View File

@ -29,8 +29,8 @@ D3 - _clear
#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 NUMPANELS 1
#define COLUMNBYTES 7 //4 columns per byte. one panel has 25 columns
//#define NUMPANELS 1
#define COLUMNBYTES 13 //4 columns per byte. one panel has 25 columns. (int)((numpanels*25)/4+1)
//### Timings ###

View File

@ -67,7 +67,7 @@ bool Flipdot::clearSelectedColumn() {
if (row!=0) {
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);
for (uint8_t i=0;i<8;i+=2) {
if (CHECK_BIT(col[cc],i)) {
@ -88,7 +88,7 @@ bool Flipdot::clearSelectedColumn() {
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);
for (uint8_t i=1;i<8;i+=2) {
if (CHECK_BIT(col[cc],i)) {
@ -112,7 +112,7 @@ bool Flipdot::setSelectedDot() {
}
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);
for (uint8_t i=0;i<8;i+=2) {
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);
//Select Columns via Shift registers
for (uint8_t i=0;i<7;i++) {
shiftOutSlow(PIN_DATA_DRVBRD, PIN_CLK_DRVBRD, LSBFIRST, col[6-i]);
for (uint8_t i=0;i<COLUMNBYTES;i++) { //adsf: previously i<7
shiftOutSlow(PIN_DATA_DRVBRD, PIN_CLK_DRVBRD, LSBFIRST, col[COLUMNBYTES-1-i]); //asdf previously col·[6-i]
}
}
void Flipdot::resetColumns() {
for (uint8_t i=0;i<7;i++) {
for (uint8_t i=0;i<COLUMNBYTES;i++) {
col[i]=0;
}
}

View File

@ -26,21 +26,24 @@ void loop_drawClearTest();
void loop() {
loopmillis = millis();
//loop_drawClearTest();
loop_testDots();
loop_drawClearTest();
//loop_testDots();
}
#define COLUMNS 50
#define ROWS 16
void loop_testDots() {
static bool init=false;
if (!init) {
flipdot.row=0;
Serial.println("Clearing Display");
for (int l=0;l<25;l++) {
flipdot.selectColumnClear(l%25);
for (int l=0;l<COLUMNS;l++) {
flipdot.selectColumnClear(l%COLUMNS);
flipdot.shiftData();
@ -105,8 +108,8 @@ void loop_drawClearTest() {
if (!init) {
flipdot.row=0;
Serial.println("Clearing Display");
for (int l=0;l<25;l++) {
flipdot.selectColumnClear(l%25);
for (int l=0;l<COLUMNS;l++) {
flipdot.selectColumnClear(l%COLUMNS);
flipdot.shiftData();
@ -137,8 +140,8 @@ void loop_drawClearTest() {
//cycle testing set dots
flipdot.selectColumnSet(countz/16); //lower column number is on the left
flipdot.row=pow(2, (countz)%16);//low significant bits are lower rows (when connector at top)
flipdot.selectColumnSet(countz/ROWS); //lower column number is on the left
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;
countz++;
if (countz>=16*25) {
if (countz>=ROWS*COLUMNS) {
countz=0;
init=false;
}