Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class bar
- {
- public function setup_pins($port_no, $units)
- {
- for ($i = 0; $i < $this->pin_qty[$port_no]; $i++)
- {
- echo "Setting up pin " . $i . "\n";
- $this->pin[$i] = new Pin;
- if ($port_no > 3)
- {
- $this->pins = 8;
- }
- else
- {
- $this->pins = 1;
- }
- $this->pin[$i]->setup_unit($i, $units);
- }
- }
- }
- class Pin
- {
- public function setup_unit($pin_no, $units)
- {
- $this->do_counter();
- echo "Setting up unit " . $units[$this->c] . "\n";
- $this->set_bitmask($pin_no);
- $this->set_unit_no($units[$this->c]);
- $this->create_call_file($units[$this->c]);
- }
- public function do_counter()
- {
- if (! isset($this->c))
- {
- $this->c = 0;
- echo "Not set\n";
- }
- else
- {
- $this->c++;
- echo "C is " . $this->c . "\n";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement