![]() MyOLED.print(currentClock.charAt(4), 40, 16) MyOLED.print(currentClock.charAt(3), 30, 16) MyOLED.print(currentClock.charAt(2), 20, 16) MyOLED.print(currentClock.charAt(1), 10, 16) MyOLED.print(currentClock.charAt(0), 0, 16) ![]() myOLED.print(rtc.getTimeStr(), LEFT, 16) MyOLED.print(rtc.getDateStr(), RIGHT, 0) ![]() rtc.setDOW(SATURDAY) // Set Day-of-Week to SUNDAY The following lines can be uncommented to set the date and time This is at risk of showing my heavily commented testing and lack of programming grace during this brute force initial code. I have hardly had time to dedicate myself to programming for a number of years, so "speak to me like I've forgotten". Hopefully this is enough information to develop a meaningful conversation. The upshot of this is that I need to pull on digit from this string to perform a Switch Case or other logical operation to do bitmap funtimes. I am however having problems either pushing that string into a variable (declare as string or char?) or directly doing string operations based on that call.ĬharAt() fails to compile with using the (potentially nonsensical?): myOLED.print(rtc.getTimeStr(FORMAT_SHORT).charAt(2), 0, 16) Īs I understand it, character operations are somewhat nightmarish. works fine testing that I'm getting the right string data. For example: myOLED.print(rtc.getTimeStr(FORMAT_SHORT), 0, 16) Perhaps this is more my green-ness to programming an Arduino, however I'm getting errors and brick walls when it seems I shouldn't be. I'm currently using the Rinky Dink DS3231 and I2C_OLED libraries. ![]() This requires me to slice up or read the string returned by the RTC's getTimeStr() as individual characters in order to select which character to use and place on the OLED. The console will be outputting the time from the RTC but as a series of large bitmapped characters instead of a font. I'm designing a new overhead console for my car centred around a Teensy 2.0 board and a DS3231 RTC, plus a few other bits and pieces. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |