This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if 1 | |
uint8_t status[128] = {}; | |
for (int i = 1; i < 128; i++) { | |
HAL_StatusTypeDef ret = HAL_I2C_IsDeviceReady(&hi2c1, (uint16_t)(i<<1), 3, 5); | |
if (ret != HAL_OK) /* No ACK Received At That Address */ | |
{ | |
status[i] = 0; | |
} | |
else if(ret == HAL_OK) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Serial.println("List dir"); | |
File root = SD.open("/"); | |
File file = root.openNextFile(); | |
while (file) { | |
Serial.print("FILE: "); | |
Serial.println(file.name()); | |
file = root.openNextFile(); | |
} | |
Serial.println("opening..."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
IoT.ino -- Example code for demonstration only. | |
Written by Rosmianto A. Saputro. Aug 25, 2017. | |
To do list: | |
* Implement OTA | |
* Implement Server/client code. | |
* Implement EEPROM update code. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
byte example[] = {0x31, 0x32, 0x33, 0x34}; | |
int length = 4; | |
String result = ""; | |
String hexstring = ""; | |
for(int i = 0; i < length; i++) { | |
if(example[i] < 0x10) { | |
hexstring += '0'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
// put your setup code here, to run once: | |
TCNT1 = 0; | |
TCCR1B = B00001001; | |
TCCR1A = B01000000; | |
OCR1A = 1; // CLK frequency = 4 MHz | |
pinMode(9, OUTPUT); | |
} | |
void loop() { |