Created
May 3, 2018 10:32
-
-
Save kekyo/337c38076ce52878bf45e73ebc0af4ad to your computer and use it in GitHub Desktop.
DAC enabled Wio 3G test code.
This file contains 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
// 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