Browse Source

update DH sketch

tags/v0.6.0
wolfv6 7 years ago
parent
commit
05b99a6da0
3 changed files with 1 additions and 36 deletions
  1. 0
    11
      src/LED_PCA9655E.cpp
  2. 0
    23
      src/LED_PCA9655E.h
  3. 1
    2
      tutorials/keybrd_5b_LED_on_IOE/keybrd_5b_LED_on_IOE.ino

+ 0
- 11
src/LED_PCA9655E.cpp View File

@@ -1,11 +0,0 @@
#include "LED_PCA9655E.h"

void LED_PCA9655E::on()
{
refPort.write(pin, HIGH);
}

void LED_PCA9655E::off()
{
refPort.write(pin, LOW);
}

+ 0
- 23
src/LED_PCA9655E.h View File

@@ -1,23 +0,0 @@
#ifndef LED_PCA9655E_H
#define LED_PCA9655E_H
#include <Arduino.h>
#include <inttypes.h>
#include <Wire.h>
#include <LED.h>
#include <PortPCA9655E.h>
/* A LED_PCA9655E object is an PCA9655E pin that is connected to an LED indicator light.
Input/Ouput Direction configuration are set to ouput in PortPCA9655E.begin() and PortRead_PCA9655E.begin().
*/
class LED_PCA9655E: public LED
{
private:
PortPCA9655E& refPort;
const uint8_t pin; //bit pattern, IOE pin to LED
public:
LED_PCA9655E(PortPCA9655E& refPort, const uint8_t pin) : refPort(refPort), pin(pin) {}
virtual void on();
virtual void off();
};
#endif

+ 1
- 2
tutorials/keybrd_5b_LED_on_IOE/keybrd_5b_LED_on_IOE.ino View File

@@ -35,7 +35,7 @@ This layout table shows left and right matrices:
// ============ SPEED CONFIGURATION ============
ScanDelay scanDelay(9000);

// ================= LEFT PINS =================
// ==================== IC =====================
// ---------------- LEFT SCANNER ---------------
uint8_t readPins[] = {14, 15};
const uint8_t readPinCount = sizeof(readPins)/sizeof(*readPins);
@@ -45,7 +45,6 @@ Scanner_uC scanner_L(LOW, readPins, readPinCount);
// ----------------- LEFT LEDs -----------------
LED_uC LED_CapsLck(21);

// ================ RIGHT PINS =================
// --------------- RIGHT SCANNER ---------------
const uint8_t IOE_ADDR = 0x20; //MCP23S17 address, all 3 ADDR pins are grounded
PortMCP23S17 portA(IOE_ADDR, 0, 1<<0 | 1<<1 ); //for read and LED