author
8Comments

Tell us about yourself!

Complete Your Profile
  • 1413 commented on homunkoloss's instructable Connecting a 12V Relay to Arduino4 months ago
    Connecting a 12V Relay to Arduino

    Because when transistor is OFF, analog pin is left floating as no current is drawn from the battery. So it will pickup stray emf around you. Connect a resistor (any value from 10k to 1M) from analog pin to ground to fix that. The downside is you drain battery a little bit more when checking battery, but nothing to worry since it drain only 4.2V/10k = 0.42mA or 17mW.

    View Instructable »
  • 1413 commented on Silvius's instructable 32x16 LED Matrix Panel and Arduino4 months ago
    32x16 LED Matrix Panel and Arduino

    Ahh, silly me. I made mistakes.- On scrolling step, it was supposed to be in pixel not in character length, so 5 chars => it would be 5 char * 6 pixel = 30. Try 30 or higherChange in setup://---------------------------------------scroll_max_step = 32; // or 40 for examplescroll_step = -32; // = negative of scroll_max_step- On the colon symbol, changing delay of each row, we mess up timing for blinking colon for a tick indication, so after period of time it will blink eventually but not sure how long. This can be fixed by changing how to display the colon.One more thing, I changed the scrolling code from only "left to right" to "left to right then right to left".You can find the complete code in attachment.

    View Instructable »
  • 1413 commented on Silvius's instructable 32x16 LED Matrix Panel and Arduino4 months ago
    32x16 LED Matrix Panel and Arduino

    Silvius, I am sorry if I hijack your instructable or something. But since I am here, I think I should give Dan a hand.Hi Daniel,I couldn't try your code on the display for a number of reasons, such as I don't have RTC module and I hard wired my panel to a project... But I tried to compile the modified one. If your code runs OK then the modified code should works too.You can find the complete "sketch" in attachment. You can change the brightness by changing number 80 to higher number such as 2000[code]// draw the screen ====draw_buffer(80); // <-------// END draw the screen ===[/code]80 in your code is for 80 microseconds which is, sort of, how long each row stays lit. So to make it brighter, increase this number to around 2000 or 2600. The math behind it is simple. You have...

    see more »

    Silvius, I am sorry if I hijack your instructable or something. But since I am here, I think I should give Dan a hand.Hi Daniel,I couldn't try your code on the display for a number of reasons, such as I don't have RTC module and I hard wired my panel to a project... But I tried to compile the modified one. If your code runs OK then the modified code should works too.You can find the complete "sketch" in attachment. You can change the brightness by changing number 80 to higher number such as 2000[code]// draw the screen ====draw_buffer(80); // <-------// END draw the screen ===[/code]80 in your code is for 80 microseconds which is, sort of, how long each row stays lit. So to make it brighter, increase this number to around 2000 or 2600. The math behind it is simple. You have 24 frame/s, each frame has 16 rows, therefore each row has to stay lit for 1/(24*16) second = approx 2.6 ms or 2600 microseconds.I agree with Silvius that this code is not optimized. If it works for you and you are pleased with its performance, I say just use it. If you want to do it properly, use a timer to "redraw" the panel instead of put in main loop.This guy has some good info on how to drive LED matrix http://ceezblog.info/2019/04/09/understanding-led-matrix-scanning-method/ in case you want to read more about it.

    View Instructable »
  • 1413 commented on Silvius's instructable 32x16 LED Matrix Panel and Arduino4 months ago
    32x16 LED Matrix Panel and Arduino

    A quick hack to do that is replace this part ClearBuffer();printLetter(1,10,'H',COLOR_RED); printLetter(1+6,10,'E',COLOR_RED); printLetter(1+6+6,10,'L',COLOR_RED); printLetter(1+6+6+6,10,'L',COLOR_RED); printLetter(1+6+6+6+6,10,'O',COLOR_RED);with a function that scrolls your text. Your function would do the same but change the position of each character base on step and time like this://global varint scroll_max_step; // set in setup(), it can be your text lengthint scroll_step; // set in setup(), scroll_step = -scroll_max_step;unsigned long scroll_delay; // set in setup(), it can be 100ms or 500msunsigned long scroll_timestamp_old;void print_text(int x, int y){printLetter(x,y,'H',COLOR_RED);printLetter(x+6,y,'E',COLOR_RED);printLetter(x+6+6,y,'L',COLOR_RED);printLetter(x+6+6+6,y,'L...

    see more »

    A quick hack to do that is replace this part ClearBuffer();printLetter(1,10,'H',COLOR_RED); printLetter(1+6,10,'E',COLOR_RED); printLetter(1+6+6,10,'L',COLOR_RED); printLetter(1+6+6+6,10,'L',COLOR_RED); printLetter(1+6+6+6+6,10,'O',COLOR_RED);with a function that scrolls your text. Your function would do the same but change the position of each character base on step and time like this://global varint scroll_max_step; // set in setup(), it can be your text lengthint scroll_step; // set in setup(), scroll_step = -scroll_max_step;unsigned long scroll_delay; // set in setup(), it can be 100ms or 500msunsigned long scroll_timestamp_old;void print_text(int x, int y){printLetter(x,y,'H',COLOR_RED);printLetter(x+6,y,'E',COLOR_RED);printLetter(x+6+6,y,'L',COLOR_RED);printLetter(x+6+6+6,y,'L',COLOR_RED);printLetter(x+6+6+6+6,y,'O',COLOR_RED);}void scrolling(){if (millis() - scroll_delay >= scroll_timestamp_old){// this will scroll from left to rightscroll_timestamp_old = millis();scroll_step++;if (scroll_step >= scroll_max_step) scroll_step = -scroll_max_step;}ClearBuffer();print_text(scroll_step, 10);}The only problem is void SetPixel(byte x, byte y, byte val) does not accept negative value, so you have to modify it to accept negative value and do nothing if it is negative value like this void SetPixel(int x, int y, byte val){if (x<0 || y<0) return; if(val & COLOR_RED) { pbuffer_r[x/byte(8)][y] &= ~(1 << 7 >> (x%8)); } if(val & COLOR_GREEN) { pbuffer_g[x/byte(8)][y] &= ~(1 << 7 >> (x%8)); }}Good luck!

    View Instructable »
  • 1413 commented on Silvius's instructable 32x16 LED Matrix Panel and Arduino5 months ago
    32x16 LED Matrix Panel and Arduino

    Quite late for the party, but IMHO, you should name it RGmatrix or rgLEDmatrix as it is Red/Green panel. Yellow is just combination of red and green. Frankly, "myMatrix" is a bit confuse to do with google-ing, you know, the name says it all.And one more thing, you could find the last 595 in chain on Red channel and connect pin 9 (serial out) to pin 14 (serial in) of first 595 on Green channel. Effectively, you have only one single data input and, thus, able to use hardware SPI to speed up data transfer. I think you can do that by connecting pin R of D-OUT to pin G of D-IN. In code, you have to send out 64 bits (instead of 32 bits) for each row as this is just like daisy-chain of 2 single-color panels.

    View Instructable »
  • 1413 commented on RAKKURBK's instructable Simple Word clock (arduino) 3 years ago
    Simple Word clock (arduino)

    This code will do time update over serial connection. Put it at the beginning of loop function. you can send time over Serial Monitor.<code>// must #include <Time.h>tmElements_t tm; setTime(RTC.get()); tm.Year = year(); tm.Month = month(); tm.Day = day(); tm.Hour = hour(); tm.Minute = minute(); tm.Second = second();while (Serial.available() > 0) { switch (Serial.read()) { case 'u': tm.Year = Serial.parseInt() - 1970; //year 1970 mean value 0 of DS1307 tm.Month = Serial.parseInt(); // do it again tm.Day = Serial.parseInt(); // again... tm.Hour = Serial.parseInt(); tm.Minute = Serial.parseInt(); tm.Second = Serial.parseInt(); if (Serial.read() == 'u') // only set time when recei...

    see more »

    This code will do time update over serial connection. Put it at the beginning of loop function. you can send time over Serial Monitor.<code>// must #include <Time.h>tmElements_t tm; setTime(RTC.get()); tm.Year = year(); tm.Month = month(); tm.Day = day(); tm.Hour = hour(); tm.Minute = minute(); tm.Second = second();while (Serial.available() > 0) { switch (Serial.read()) { case 'u': tm.Year = Serial.parseInt() - 1970; //year 1970 mean value 0 of DS1307 tm.Month = Serial.parseInt(); // do it again tm.Day = Serial.parseInt(); // again... tm.Hour = Serial.parseInt(); tm.Minute = Serial.parseInt(); tm.Second = Serial.parseInt(); if (Serial.read() == 'u') // only set time when receive another 'u' serialUpdateTime(tm); break;case 't': serialShowTime(); // modify to fit your code } //end switch } //end while </code>Type in serial monitor: u2015/1/1 23:59:59uOr use an PC app like how this guy does it http://ceezblog.info/2015/05/15/arduino-analog-clock-with-ds1307/

    This code will do time update over serial connection. Put it at the beginning of loop function. you can send time over Serial Monitor.[code]// #include <Time.h>// #include <DS1307RTC.h>tmElements_t tm;while (Serial.available() > 0) {switch (Serial.read()){case 'u':tm.Year = Serial.parseInt() - 1970; //year 1970 mean value 0 of DS1307tm.Month = Serial.parseInt(); // do it againtm.Day = Serial.parseInt(); // again...tm.Hour = Serial.parseInt();tm.Minute = Serial.parseInt();tm.Second = Serial.parseInt();if (Serial.read() == 'u') // only set time when receive another 'u'RTC.write((tm);break;case 't':serialShowTime(); // modify to fit your code} //end switch} //end while[/code]Type in serial monitor: u2015/1/1 23:59:59uOr use an PC app like how I did it http://ceezblog.info/2...

    see more »

    This code will do time update over serial connection. Put it at the beginning of loop function. you can send time over Serial Monitor.[code]// #include <Time.h>// #include <DS1307RTC.h>tmElements_t tm;while (Serial.available() > 0) {switch (Serial.read()){case 'u':tm.Year = Serial.parseInt() - 1970; //year 1970 mean value 0 of DS1307tm.Month = Serial.parseInt(); // do it againtm.Day = Serial.parseInt(); // again...tm.Hour = Serial.parseInt();tm.Minute = Serial.parseInt();tm.Second = Serial.parseInt();if (Serial.read() == 'u') // only set time when receive another 'u'RTC.write((tm);break;case 't':serialShowTime(); // modify to fit your code} //end switch} //end while[/code]Type in serial monitor: u2015/1/1 23:59:59uOr use an PC app like how I did it http://ceezblog.info/2015/05/15/arduino-analog-cl...This one below is my newest toy

    View Instructable »