Forum Software Ferduino code How add two more PCF8575 to the Ferduino Code

How add two more PCF8575 to the Ferduino Code  [SOLVED]


Post Number:#1 Post Sat Aug 30, 2014 9:50 am
Posts: 6
Topics: 1
Solve rating: 0
Joined: Tue Aug 26, 2014 10:15 am
Topics: 1
Age: 35
Gender: Male
National Flag:
Spain
Hello every people, I have to add two more PCF8575 to the Ferduino code because I modify for my own requirements.

Can anyone help my?

Best regards.

Post Number:#2 Post Sat Aug 30, 2014 10:36 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Follow this example.

I remember that I explained it for you on Portalpez.

Anyway I'll put an example here.

#include <PCF8575.h> 

byte address_1 = xxxx; // Change this address
byte address_2 = xxxx; // Change this address
byte address_3 = xxxx; // Change this address

PCF8575 PCF8575_1; // First PCF
PCF8575 PCF8575_2; // Second PCF
PCF8575 PCF8575_3; // Third PCF

void setup() 


  PCF8575_1.begin(address_1);
  PCF8575_2.begin(address_2); 
  PCF8575_3.begin(address_3);

  for(int i = 0; i < 16; i++)   
  {   
    PCF8575_1.pinMode(i, OUTPUT);
    PCF8575_2.pinMode(i, OUTPUT);
    PCF8575_3.pinMode(i, OUTPUT);   
  }   
}

void loop()
{
  for(int i = 0; i < 16; i++)   
  {   
    PCF8575_1.digitalWrite(i, HIGH);
    PCF8575_2.digitalWrite(i, HIGH);
    PCF8575_3.digitalWrite(i, HIGH);
    delay(1000);
  }
  for(int i = 0; i < 16; i++)   
  {   
    PCF8575_1.digitalWrite(i, LOW);
    PCF8575_2.digitalWrite(i, LOW);
    PCF8575_3.digitalWrite(i, LOW);
    delay(1000);
  }   
}


Change the address of each IC connecting A0-A2 to 5V or GND.

Use the example available here to scan addresses.

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Sat Aug 30, 2014 10:43 am
Posts: 6
Topics: 1
Solve rating: 0
Joined: Tue Aug 26, 2014 10:15 am
Topics: 1
Age: 35
Gender: Male
National Flag:
Spain
Hi Fernando, sorry too much, but I don't find it in Portalpez.

Thanks to much.

Best regards.

Post Number:#4 Post Sat Aug 30, 2014 10:49 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

See this.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#5 Post Sat Aug 30, 2014 11:27 am
Posts: 6
Topics: 1
Solve rating: 0
Joined: Tue Aug 26, 2014 10:15 am
Topics: 1
Age: 35
Gender: Male
National Flag:
Spain
Hi Fernando, I search it page by page of the post controller of arduino.

Thanks for show it.

Best regards

Post Number:#6 Post Sat Aug 30, 2014 3:23 pm
Posts: 6
Topics: 1
Solve rating: 0
Joined: Tue Aug 26, 2014 10:15 am
Topics: 1
Age: 35
Gender: Male
National Flag:
Spain
Hi Fernando, excuse me for ask too much, but it's my two last questions:

Frist: If I put in this way the 36 heaters:

const int aquecedor1Pin =  // Pino que liga o aquecedor
const int aquecedor2Pin =
const int aquecedor3Pin =
const int aquecedor4Pin =
const int aquecedor5Pin =
const int aquecedor6Pin =

const int aquecedor7Pin =
const int aquecedor8Pin =
const int aquecedor9Pin =
const int aquecedor10Pin =
const int aquecedor11Pin =
const int aquecedor12Pin =

const int aquecedor13Pin =
const int aquecedor14Pin =
const int aquecedor15Pin =
const int aquecedor16Pin =
const int aquecedor17Pin =
const int aquecedor18Pin =

const int aquecedor19Pin =
const int aquecedor20Pin =
const int aquecedor21Pin =
const int aquecedor22Pin =
const int aquecedor23Pin =
const int aquecedor24Pin =

const int aquecedor25Pin =
const int aquecedor26Pin =
const int aquecedor27Pin =
const int aquecedor28Pin =
const int aquecedor29Pin =
const int aquecedor30Pin =

const int aquecedor31Pin =
const int aquecedor32Pin =
const int aquecedor33Pin =
const int aquecedor34Pin =
const int aquecedor35Pin =
const int aquecedor36Pin =


How can I name the pins of for these heaters? for example:

const int aquecedor1Pin = PCF8575_1.pin1
??

Second: I have other error in the void mainScreen, I put here the code that I modify for you check, if you please :x .

I don't know, please help me

Best regards

Post Number:#7 Post Sat Aug 30, 2014 4:05 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

This is explained on Portalpez as I told before.

const int aquecedor1Pin = 0; // First PCF8575
const int aquecedor2Pin = 1;
.
.
.
const int aquecedor17Pin = 0; // Second PCF8575
const int aquecedor18Pin = 1;
.
.
.
And so on.


The support to this version was abandoned.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#8 Post Sat Aug 30, 2014 6:28 pm
Posts: 6
Topics: 1
Solve rating: 0
Joined: Tue Aug 26, 2014 10:15 am
Topics: 1
Age: 35
Gender: Male
National Flag:
Spain
Hello fernando, sorry too much for ask about a old version, relly, sorry too much, but I have a last question, I promise that I don't ask any more ^:)^ .

I have this error:

Leds.ino: In function 'void mainScreen(boolean)':
Leds:3: error: a function-definition is not allowed here before '{' token
Tempo_e_data:92: error: expected `}' at end of input


Thanks too much and sorry.

Best regards.

Post Number:#9 Post Sat Aug 30, 2014 10:52 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

This topic is about PCF8575.

This problem is related with PCF8575?

My suggestion for you is: Buy a TFT 400 x 240 and use a version available here.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Posts: 6
Topics: 1
Solve rating: 0
Joined: Tue Aug 26, 2014 10:15 am
Topics: 1
Age: 35
Gender: Male
National Flag:
Spain
Hi Fernando, I resolve this problem jet, only need a "}" in a part of teh code, If you want, I put it here to download for you or everyone.

Best regards.




  • Similar Topics
    Replies
    Views
    Last post

Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 1 guest

cron