Skip to content

Commit

Permalink
sync repos (mostly keeping build happy)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Oct 1, 2022
1 parent 3f6ab4d commit 8e0ab56
Show file tree
Hide file tree
Showing 26 changed files with 230 additions and 83 deletions.
16 changes: 11 additions & 5 deletions libraries/AD5144A/AD5144A.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,19 +370,25 @@ uint8_t AD51XX::readBack(const uint8_t rdac, const uint8_t mask)
{
// COMMAND 3 - page 20
_wire->beginTransmission(_address);
int a = _wire->write(0x30 | rdac);
_wire->write(0x30 | rdac);
_wire->write(mask);
_wire->endTransmission();
_wire->requestFrom(_address, (uint8_t)1);
return _wire->read();

// int a = _wire->write(0x30 | rdac);
// Serial.print("READBACK cmd: ");
// Serial.print(a);
a = _wire->write(mask);
// a = _wire->write(mask);
// Serial.print(" val: ");
// Serial.print(a);
a = _wire->endTransmission();
// a = _wire->endTransmission();
// Serial.print(" TX: ");
// Serial.println(a);
a = _wire->requestFrom(_address, (uint8_t)1);
// a = _wire->requestFrom(_address, (uint8_t)1);
// Serial.print(" RF: ");
// Serial.println(a);
return _wire->read();
// return _wire->read();
}


Expand Down
18 changes: 9 additions & 9 deletions libraries/DEVRANDOM/examples/DEVRANDOM_demo/DEVRANDOM_demo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ void setup()
Serial.println();
delay(1000);

uint32_t x;
fscanf((FILE*)&dr, "%lu", &x);
Serial.print("UINT32: ");
Serial.println(x, HEX);

uint16_t y;
fscanf((FILE*)&dr, "%u", &y);
Serial.print("UINT16: ");
Serial.println(y, HEX);
// uint32_t x;
// fscanf((FILE*)&dr, "%lu", &x); // fails on ESP32
// Serial.print("UINT32: ");
// Serial.println(x, HEX);

// uint16_t y;
// fscanf((FILE*)&dr, "%u", &y); // fails on ESP32
// Serial.print("UINT16: ");
// Serial.println(y, HEX);

// float f;
// fscanf((FILE*)&dr, "%e", &f); // does not work on UNO.
Expand Down
4 changes: 2 additions & 2 deletions libraries/DHTstable/examples/dht11_two/dht11_two.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ void setup()
void loop()
{
Serial.print("DHT A:\t");
int chk = DHT_A.read11(DHT11_PIN_A);
DHT_A.read11(DHT11_PIN_A);
Serial.print(DHT_A.getHumidity());
Serial.print(",\t");
Serial.println(DHT_A.getTemperature());


Serial.print("DHT B:\t");
chk = DHT_B.read11(DHT11_PIN_B);
DHT_B.read11(DHT11_PIN_B);
Serial.print(DHT_B.getHumidity());
Serial.print(",\t");
Serial.println(DHT_B.getTemperature());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int optimize()
flag = true;
}
}
// if (flag) Serial.print('*'); // uncomment this as you want to spot the changes.
if (flag) Serial.print('*'); // comment if you do not want see changes.
isinTable16[i] = t + idx;
Serial.print(isinTable16[i]);
Serial.print(", ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ bool test_hw_support() // to be elaborated
d2 = micros() - start;
Serial.println(d1);
Serial.println(d2);
Serial.println(y); // keep compiler happy
Serial.println();
return (d1 / d2) < 1.5; // just a guess for now.
return (d1 / d2) < 1.5; // just a guess for now.
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// DATE: 2020-06-10
// URL: https://github.com/RobTillaart/FunctionGenerator
//
// use a Serial plotter to show the data
// use a Serial plotter to show the data


#include "functionGenerator.h"
Expand All @@ -16,8 +16,8 @@ funcgen gen;
void setup()
{
Serial.begin(115200);
// Serial.print("Start functionGeneratorPerformance - LIB VERSION: ");
// Serial.println(FUNCTIONGENERATOR_LIB_VERSION);
// Serial.print("Start functionGeneratorPerformance - LIB VERSION: ");
// Serial.println(FUNCTIONGENERATOR_LIB_VERSION);

gen.setAmplitude(50);
gen.setFrequency(1);
Expand All @@ -28,24 +28,24 @@ void loop()
{
float t = millis() * 0.001;

// UNCOMMENT WAVES YOU WANT TO SEE
// DO NOT FORGET THE '\t' SEPARATOR PRINT
// UNCOMMENT WAVES YOU WANT TO SEE
// DO NOT FORGET THE '\t' SEPARATOR PRINT

// Serial.print(t, 3);
// Serial.print("\t");
// Serial.print(gen.square(t));
// Serial.print("\t");
// Serial.print(gen.sawtooth(t, 0)); // up /|
// Serial.print(gen.sawtooth(t, 0)); // up /| signal
// Serial.print("\t");
// Serial.print(gen.sawtooth(t, 1)); // down |\
// Serial.print(gen.sawtooth(t, 1)); // down |\ signal
// Serial.print("\t");
// Serial.print(gen.triangle(t));
// Serial.print("\t");
// Serial.print(gen.sinus(t));
// Serial.print("\t");
Serial.print(gen.stair(t, 16, 0)); // step up
Serial.print(gen.stair(t, 16, 0)); // step up
Serial.print("\t");
Serial.print(gen.stair(t, 16, 1)); // step down
Serial.print(gen.stair(t, 16, 1)); // step down
Serial.print("\t");
// Serial.print(gen.random());
// Serial.print("\t");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@ void dump(uint32_t from, uint32_t to)
{
char buffer[24];
Serial.print('\n');
sprintf(buffer, "%08lX\t", i);
#if defined (ESP8266) || defined(ESP32)
sprintf(buffer, "%08X\t", i); // ESP cast (long unsigned int)
#else
sprintf(buffer, "%08lX\t", i); // AVR needs lX
#endif
Serial.print(buffer);
}
sprintf(buffer, "%02X\t", ee.readByte(i));
sprintf(buffer, "%02X\t", x);
Serial.print(buffer);
}
Serial.println();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ void dump(uint32_t from, uint32_t to)
{
char buffer[24];
Serial.print('\n');
// sprintf(buffer, "%08X\t", i); // ESP cast (long unsigned int)
sprintf(buffer, "%08lX\t", i); // AVR needs lX
#if defined (ESP8266) || defined(ESP32)
sprintf(buffer, "%08X\t", i); // ESP cast (long unsigned int)
#else
sprintf(buffer, "%08lX\t", i); // AVR needs lX
#endif
Serial.print(buffer);
}
sprintf(buffer, "%02X\t", ee.readByte(i));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ void dump(uint32_t from, uint32_t to)
{
char buffer[24];
Serial.print('\n');
sprintf(buffer, "%08lX\t", i);
#if defined (ESP8266) || defined(ESP32)
sprintf(buffer, "%08X\t", i); // ESP cast (long unsigned int)
#else
sprintf(buffer, "%08lX\t", i); // AVR needs lX
#endif;
Serial.print(buffer);
}
sprintf(buffer, "%02X\t", ee.readByte(i));
Expand Down
15 changes: 15 additions & 0 deletions libraries/I2C_EEPROM/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ MicroChip 24LC512, 24LC256, 24LC64, 24LC32, 24LC16, 24LC08, 24LC04, 24LC02, 24LC
The **I2C_eeprom_cyclic_store** interface is documented [here](README_cyclic_store.md)


## Schematic

```cpp
+---U---+
A0 | 1 8 | VCC = +5V
A1 | 2 7 | WP = write protect pin
A2 | 3 6 | SCL = I2C clock
GND | 4 5 | SDA = I2C data
+-------+

default address = 0x50 .. 0x57 depending on three address lines

```


## Interface

The interface is kept quite identical to the I2C_24LC1025 library.
Expand Down
Loading

0 comments on commit 8e0ab56

Please sign in to comment.