Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lcdi2c with ds18b20 sdcc and x8c issues #18

Open
fcwpinguino opened this issue Feb 19, 2017 · 1 comment
Open

lcdi2c with ds18b20 sdcc and x8c issues #18

fcwpinguino opened this issue Feb 19, 2017 · 1 comment

Comments

@fcwpinguino
Copy link
Contributor

fcwpinguino commented Feb 19, 2017

/*-----------------------------------------------------------------------
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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant