PinguinoIDE / pinguino-libraries

Pinguino librairies, keywords and other useful files.
24 stars 27 forks source link

lcdi2c with ds18b20 sdcc and x8c issues #18

Open fcwpinguino opened 7 years ago

fcwpinguino commented 7 years ago

/*----------------------------------------------------------------------- Pinguino example to read ds18b20 1wire temperature sensor Result is sent on usb-serial bus and can be read with index.php author Régis Blanchot first release 14/09/2010 last update 10/06/2011 IDE Pinguino > b9.5

DS18B20 wiring
-----------------------------------------------------------------------
pin 1: GND
pin 2: DQ (Data in/out) must be connected to the PIC
pin 3: VDD (+5V)
NB : 1-wire bus (DQ line) must have 4K7 pull-up resistor (connected to +5V)
-----------------------------------------------------------------------
Data's are sent to /dev/ttyACM0
Make sure you have persmission on it : sudo chmod 777 /dev/ttyACM0
Maybe you will have to add your user name to the dialup group
----------------------------------------------------------------------*/

define ONEWIREBUS 14

void setup() {
lcdi2c.init(16, 2, 0x27,4,2,1,0,3); lcdi2c.backlight(); // turns backlight on lcdi2c.clear(); // clear screen lcdi2c.home();

} void loop() {

TEMPERATURE t;

       DS18x20.readFahrenheit(ONEWIREBUS, SKIPROM, &t);
       lcdi2c.setCursor(0,1);          
       lcdi2c.printf("%d.%d degF\r\n", t.integer, t.fraction);

delay(1000);

}` regis, this pde compiles in both sdcc & x8c the pde works in sdcc with data but the display will not light in x8c the display lights but no data is displayed.

fcwpinguino commented 7 years ago

lcdi2c under communication works in x8c compiles and displays data/backlight properly but in sdcc no display / back light