Skip to content

Instantly share code, notes, and snippets.

@kekyo
Created May 3, 2018 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kekyo/337c38076ce52878bf45e73ebc0af4ad to your computer and use it in GitHub Desktop.
Save kekyo/337c38076ce52878bf45e73ebc0af4ad to your computer and use it in GitHub Desktop.
DAC enabled Wio 3G test code.
// https://github.com/kekyo/SeeedJP_STM32F4/commit/cf9cd45caaae41c1d5e71eeec5ea3d25bcc2dae0
#include <Wio3GforArduino.h>
Wio3G Wio;
void setup()
{
SerialUSB.begin(115200);
SerialUSB.println("");
SerialUSB.println("============== Start DAC test (Wio 3G)");
Wio.Init();
Wio.PowerSupplyGrove(true);
delay(100);
pinMode(WIO_A4, OUTPUT_ANALOG);
pinMode(WIO_A5, OUTPUT_ANALOG);
delay(1000);
}
void loop() {
for (int j = 0; j < 1000; j++)
{
for (int i = 0; i < 4096; i++)
{
analogWrite(WIO_A4, i);
analogWrite(WIO_A5, 4095 - i);
delayMicroseconds(10);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment