Jump to content

Register

Members
  • Content Count

    41
  • Joined

  • Last visited

About Register

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male
  • Location
    Paris - France

Recent Profile Visitors

435 profile views
  1. Hi, There 2 new company which are crowd funding for silver ink solution and printing one directly with a printer the other with a plotter... Sound very interesting for testing purposes. Printer one : AgIC Pen + plotter : Electronink (sixth video) Regards,
  2. Register

    Weird problem with string and library

    I redone the code to use only char but still got problems. Been a long time since the last time I use string (char arrays ones) in C. more of Php time, get some bad habits ;-) char time_buff[6] ; ... void displayTime() { lcd_screen.setFont(1); strcpy(time_buff, headZero(now.hour())) ; strcat(time_buff, ":") ; strcat(time_buff, headZero(now.minute())) ; Serial.println(time_buff) ; lcd_screen.text(0, 0, time_buff) ; strcpy(time_buff, ":") ; strcat(time_buff, headZero(now.second())) ; lcd_screen.setFont(0) ; lcd_screen.text(10, 1, time_buff) ; Serial.println(time_buff) ; strcpy(time_buff, headZero(now.day())) ; strcat(time_buff, "/") ; strcat(time_buff, headZero(now.month())) ; Serial.println(time_buff) ; lcd_screen.text(0, 2, time_buff) ; } char *headZero(unsigned char val) { Serial.println(val, DEC) ; char str[3] ; if(val<10) { char val_str[2] ; itoa(val, val_str, 10) ; strcpy(str, "0") ; strcat(str, val_str) ; } else { itoa(val, str, 10) ; } str[3] = NULL ; return str ; } I edit LCD_5110 to get ride of the references to String (fairly easy) too. trace in headZero some times return weird things 2 not becoming 02 but
  3. Register

    Weird problem with string and library

    Hum, didn't find this information on google but I was thinking of something like that... The LCD_5110 library use String so it's one reason I used them and one hope to simplify string manipulations.... but no. EDIT : It's the LCD_5110 which using String not the RTC one
  4. Register

    Si4703 FM tuner and I2C

    Ok, thanks.
  5. Register

    Weird problem with string and library

    Hi, Thanks for your reply. Here's the output: text data bss dec hex 10310 0 346 10656 29a0
  6. I'm trying to build a radio, with a 5110 display (SPI), RTC and Si74703 (I2C) but it does not seem to be working. #include "LCD_5110.h" #include <Si4703_Breakout.h> #include <Wire.h> #include "RTClib.h" /////////////////////// RADIO int resetPin = P1_4 ; int SDIO = P1_7; int SCLK = P1_6; Si4703_Breakout radio(resetPin, SDIO, SCLK); int channel; int volume; char rdsBuffer[10]; ////////////////////// CLOCK RTC_DS1307 RTC; DateTime now = DateTime(__DATE__, "01:01:01") ; ////////////////////// LCD LCD_5110 lcd_screen; boolean backlight = false; void setup() { lcd_screen.begin(); lcd_screen.setBacklight(backlight); lcd_screen.text(0, 0, "Initializing"); Serial.begin(9600); Wire.begin() ; RTC.begin(); /* radio.powerOn(); radio.setVolume(3); */ //if(!RTC.isrunning()) { // RTC.adjust(DateTime(__DATE__, __TIME__)); RTC.adjust(DateTime(__DATE__, "01:01:01")); } lcd_screen.clear(); lcd_screen.text(0, 0, "Done"); displayTime() ; lcd_screen.text(0, 5, "Kikou"); } void loop() { displayTime() ; delay(1000); } void displayTime() { lcd_screen.text(0, 0, "Test"); now = RTC.now() ; lcd_screen.setFont(1); String time_str = leadZero(now.hour()) ; time_str.concat(":") ; time_str.concat(leadZero((int)now.minute())) ; lcd_screen.text(0, 0, time_str) ; String min_str = "" ; min_str += ":" ; min_str += leadZero(now.second()) ; lcd_screen.setFont(0) ; lcd_screen.text(10, 1, min_str) ; Serial.println(min_str) ; } String leadZero(int val) { String str = "" ; if(val<10) { str = "0" ; } str.concat(val) ; return str ; } when it display the time I got 01:0 :0 on the LCD or on Serial.print and when the number of second id >= 10 01:0 :10 if I comment out Si4703_Breakout radio(resetPin, SDIO, SCLK); I got the right display 01:01:01 .... 01:01:02 ... 01:01:15 etc The RTC device and the radio are on I2C both, but the constructor of the radio object does nothing... Before this version of code I got all sort of problem with the strings manipulation of the time. Looks like an memory problem between String and one or more of the library to me....
  7. Register

    Si4703 FM tuner and I2C

    Thank you so much!!!! What a relief! ;-) As a lazy guy (average computer man) I stopped half the way in my process to pin point the real problem, should have taken a look at those 16 bin so that there was the first half part of what should been have returned and subsequently ask the right question: why only 16bit! So I have to modify energia file isn't an cleaner way to do it, like asking with wire the first 16bits then the other 16bits? Edit: There's a ifndef for TWI_BUFFER_LENGTH, but not for wire BUFFER_LENGTH Edit 2: Change the 2 values and it work perfectly....
  8. Register

    Launchpad lm4f120 running I2C

    Hi, Got the same result with 2553 on launchpad, without anything wired it detect a device for each address... Regards,
  9. Register

    Si4703 FM tuner and I2C

    Hi , I'm trying to run a Si4703 FM eval board from Sparkfun on an 2553 (launchpad). The device work fine on Arduino. I'm using the sketch provided by Sparkfun (there). I change pin assignment as int resetPin = P1_4; int SDIO = P1_7; //SDA/A4 on Arduino int SCLK = P1_6; //SCL/A5 on Arduino Add pull ups to SDA and SCLK but with no result the code loop on this line in si4703_readRegisters function while(Wire.available() < 32) ; available return only 16. I'm new to SPI so don't know how to resolve this. Thanks,
  10. Register

    SPI + I2C

    Thanks for your reply. Seems I made a mistake and forgot Wire.begin(); when making some cut and past between scripts.... So now it's working with LCD_5110 library, will try to test the SPI version soon. Regards
  11. Register

    SPI + I2C

    Thanks for your reply. I tried to switch from LCD_5110_SPI to the LCD_5110 library and it freeze as soon as i try to acces to the RTC object. I'm going to ask to Rei Vilo. And yes it's a MSP430G2 with 2553. Regards,
  12. Register

    SPI + I2C

    Hi, I'm trying to make a clock with a Tiny RTC module and a iTead 5110 Nokia LCD. I'm using Adafruit RTClib and the energia LCD_5110_SPI. Each library an device are working fine separately but when put together it stops working, is it possible to have SPI and I2C device working simultaneously? Thanks.
  13. Hum, think that there was connection problem between the sensor and the battery. Now the sensor are working fine @~2.47.
  14. Register

    (Universal) Color LCD graphics library (2)

    Hi, I just bought one o your LCD shield I'm using Energia, is your library easy to use with it, or does it require CSS? Regards
×