Skip to content

Commit fdca3a4

Browse files
author
Vino Rodrigues
committed
re-upload of v2.3
1 parent b3c315f commit fdca3a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+16240
-7779
lines changed

Arduino/01_Blink/01_Blink.ino

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
ESP8266 Blink by Simon Peter
3+
Blink the blue LED on the ESP-01 module
4+
This example code is in the public domain
5+
6+
The blue LED on the ESP-01 module is connected to GPIO1
7+
(which is also the TXD pin; so we cannot use Serial.print() at the same time)
8+
9+
Note that this sketch uses LED_BUILTIN to find the pin with the internal LED
10+
*/
11+
12+
void setup() {
13+
pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output
14+
15+
Serial.begin(115200);
16+
while (!Serial); // Leonardo: wait for serial monitor
17+
Serial.print("Starting... ");
18+
Serial.print(LED_BUILTIN);
19+
Serial.print("... ");
20+
21+
Serial.println();
22+
}
23+
24+
// the loop function runs over and over again forever
25+
void loop() {
26+
digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level
27+
// but actually the LED is on; this is because
28+
// it is active low on the ESP-01)
29+
delay(333); // Wait for a second
30+
digitalWrite(LED_BUILTIN, HIGH);
31+
delay(333);
32+
digitalWrite(LED_BUILTIN, LOW);
33+
delay(333);
34+
digitalWrite(LED_BUILTIN, HIGH); // Turn the LED off by making the voltage HIGH
35+
delay(2000); // Wait for two seconds (to demonstrate the active low LED)
36+
}

Arduino/02_Scan_I2C/02_scan_i2c.ino

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// --------------------------------------
2+
// Modified from: http://playground.arduino.cc/Main/I2cScanner
3+
// i2c_scanner
4+
5+
#include <Wire.h>
6+
7+
#define SDA_PIN 0
8+
#define SCL_PIN 2
9+
10+
void setup() {
11+
Wire.begin(SDA_PIN, SCL_PIN);
12+
13+
Serial.begin(57600);
14+
while (!Serial); // Leonardo: wait for serial monitor
15+
Serial.println("I2C Scanner (ESP-01)");
16+
}
17+
18+
19+
void loop() {
20+
byte error, address;
21+
int nDevices;
22+
23+
Serial.println(); Serial.println();
24+
Serial.println("Scanning...");
25+
26+
nDevices = 0;
27+
for(address = 1; address <= 127; address++ ) {
28+
29+
// delay(1);
30+
31+
// The i2c_scanner uses the return value of
32+
// the Write.endTransmisstion to see if
33+
// a device did acknowledge to the address.
34+
Wire.beginTransmission(address);
35+
error = Wire.endTransmission();
36+
37+
if (error == 0) {
38+
39+
nDevices++;
40+
41+
Serial.print("[");
42+
Serial.print(nDevices);
43+
Serial.print("] Address = ");
44+
Serial.print(address, DEC);
45+
Serial.print(" (0x");
46+
if (address < 16) Serial.print("0");
47+
Serial.print(address, HEX);
48+
Serial.println(")");
49+
50+
51+
} else if (error == 4) {
52+
53+
Serial.print("Error @ (0x");
54+
if (address<16) Serial.print("0");
55+
Serial.print(address, HEX);
56+
Serial.println(")");
57+
58+
}
59+
}
60+
61+
if (nDevices == 0)
62+
Serial.println("No I2C devices found.");
63+
else {
64+
Serial.print("Found ");
65+
Serial.print(nDevices);
66+
Serial.print(" I2C device");
67+
if (nDevices > 1) Serial.print("s");
68+
Serial.println(".");
69+
}
70+
71+
delay(10000); // wait 5 seconds for next scan
72+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
2+
/*
3+
A. Select "Generic ESP8622 Module" board
4+
1. Output to serial (for debug)
5+
2. Blink I2C/Qwiic Relay, @see https://www.smart-prototyping.com/Zio-Qwiic-Relay
6+
*/
7+
8+
#include <Wire.h>
9+
10+
#define SDA_PIN 0
11+
#define SCL_PIN 2
12+
// const int16_t I2C_MASTER = 0x07;
13+
const int16_t I2C_RELAY = 0x18;
14+
15+
16+
void setup() {
17+
Serial.begin(115200);
18+
19+
while (!Serial); // Leonardo: wait for serial monitor
20+
21+
Serial.print("Starting... ");
22+
23+
Wire.pins(SDA_PIN, SCL_PIN);
24+
Wire.begin(); // join i2c bus with sda = 0, scl = 2
25+
26+
Serial.println();
27+
}
28+
29+
30+
void readFromSlave() {
31+
// if data size is available from nodes
32+
}
33+
34+
// the loop function runs over and over again forever
35+
void loop() {
36+
37+
Wire.beginTransmission(I2C_RELAY);
38+
Wire.write(0x01); // on
39+
Wire.endTransmission();
40+
41+
delay(1000);
42+
43+
// ***
44+
45+
Wire.beginTransmission(I2C_RELAY);
46+
Wire.write(0x00); // off
47+
Wire.endTransmission();
48+
49+
delay(1000);
50+
51+
Wire.beginTransmission(I2C_RELAY);
52+
Wire.write(0x04);
53+
Wire.endTransmission();
54+
55+
delay(1);
56+
57+
// ***
58+
59+
Wire.requestFrom(I2C_RELAY, 2);
60+
61+
int x = Wire.available();
62+
Serial.print(x);
63+
64+
if (x >= 2) {
65+
int v_maj = Wire.read();
66+
int v_min = Wire.read();
67+
68+
Serial.print("Version ");
69+
Serial.print(v_maj);
70+
Serial.print(".");
71+
Serial.print(v_min);
72+
}
73+
}

CHANGELOG.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
[[[[[ **This project is in WIP state.** ]]]]]
8+
9+
## [Unreleased]
10+
11+
### Added
12+
13+
- Rebuild of PlatformIO examples
14+
15+
### Removed
16+
17+
- Sub projects removed (and added to their own GitHub projects)
18+
* [arduino-esp-01-dev-board](https://github.com/Tecsmith/arduino-esp-01-dev-board)
19+
* [arduino-pro-micro-screw-terminal](https://github.com/Tecsmith/arduino-pro-micro-screw-terminal)
20+
* [arduino-wemos-d1-screw-terminal](https://github.com/Tecsmith/arduino-wemos-d1-screw-terminal)
21+
* arduino-emc2101 *(deleted)*
22+
23+
### Changed
24+
25+
- Arduino examples renamed. These will stay, but not be maintained or added on as PlatformIO is the preferred environment.
26+
27+
## [2.3.0] - 2020-12-17
28+
29+
### Added
30+
31+
- Initial AMC6820 and SMBus libraries
32+
- WIP PlatformIO code to test IC integration
33+
34+
### Changed
35+
36+
- Realized that JP2 = A0 and JP3 = A1 could lead to confusion, renamed all JP's (with J0 = A0 & J1 = A1)
37+
- Created expanded solder pads on Optional Temp. Sensor to allow for horizontal cable soldering.
38+
- Moved Qwiic connectors up by 25mil to allow better clearance of mounting screws.
39+
- Issue identified with JLCPCB validation
40+
+ C7 (Optional Temp. Sensor capacitor) was the incorrect footprint, changed from 0402 to 0805. This is a breaking error, however, since sensor is optional will not impact development of firmware.
41+
+ Q2, Q3, Q4 (Red LED inversion transistors) were the incorrect footprint. Non-breaking. Changed to SOT23-3. Moved the route airwires to accommodate.
42+
43+
## [2.2.0] - 2020-12-05
44+
45+
### Changed
46+
47+
- Fix for the Qwiic connector being oriented the wrong way
48+
49+
## [2.1.0] - ?
50+
51+
- Unreleased
52+
53+
## [2.0.0] - 2020-11-02
54+
55+
### Added
56+
- Initial release (and first production run with [JLCPCB](https://jlcpcb.com/))

0 commit comments

Comments
 (0)