RDA5981 IoT audio board.

Geile specs, maar veel meer dan een persbericht en een ietwat vage foto is er niet over te vinden.

  • 160Mhz CPU ( ARM Cortex M4? )
  • 160KB SRAM
  • 8MB PSRAM
  • 4MB Flash
  • build in USB 2.0 host interface allow USB devices to be connected to the module directly
  • Support Bluetooth 2.1 EDR + BLE4.2
  • SDMMC interface
  • 2x 10bit ADCs
  • SIDO x1, I2C x1, I2S x2, PWM x8, IR, SPI x4, UART x2, GPIO with interrupts x14
  • operating temperature -30+80C

Owja, wel een repo op GitHub met voornamelijk PR blurb en weinig code of technische  info.

En een wiki.

De link:

Espressif got new competitor RDA5981 dedicated for IoT and audio apps

Bestand naar C, C++ variable converten.

Om een bestand als variable in C of C++ te gebruiken kun je de tool xxd gebruiken.
xxd is standaard aanwezig op de meeste linux Mint machines.

cellie@cellie-Mint-64 ~ $ echo Hello World\! > temp
cellie@cellie-Mint-64 ~ $ xxd -i temp
unsigned char temp[] = {
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21,
0x0a
};
unsigned int temp_len = 13;

Om de variable niet in RAM maar in ROM terecht te laten komen verander je de code als volgt:

const char temp[] = {
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21,
0x0a
};
const int temp_len = 13;

De link:

Natuurlijk niet zelf bedacht maar gevonden op stackoverflow.

Wacht aantal milliseconden Arduino IDE.

Iets als dit regelt de NTP update in de aquacontrol software:

//    wait a specific interval, accounting for rollover with subtraction!
  
unsigned long timerInterval = 50;  // this is the interval in milliseconds
unsigned long nextTimer = millis() + timerInterval;
  
void loop() {
  lastMillis = millis();
  if ( ( long ) ( millis() - nextTimer ) >= 0 ) {
    Serial.println( "Interval has passed." );    
    nextTimer += timerInterval;
    //do some more stuff...
  }

//rest of the main loop
}

Alles nur geklaut:
http://playground.arduino.cc/Code/TimingRollover

Arduino: /dev/ttyUSBx niet benaderbaar.

Vandaag gaf de Arduino IDE (1.8.1) hardnekkig de volgende foutmelding bij elke upload:

warning: espcomm_sync failed
error: espcomm_open failed
error: espcomm_upload_mem failed

Als deze foutmelding het plezier met de Arduino IDE verpest ben je waarschijnlijk een non-root gebruiker. Die hebben standaard geen toegang tot de seriële poort.

Lossen we op door de gebruiker aan de group dialout toe te voegen:

sudo usermod -a -G dialout username

Reboot de machine en het zou nu moeten werken.