simple oscilloscope opengl using arduino as adc input through usb serial
- Arduino ADC to convert signal to digital, then serial
- 115kbaud =~ 11.5kb/s ( need at least 2 byte for a freq detect, ie. max freq detectable about 11.5khz/2 )
- C++ opengl program to display waveform
- space : pause display
- v/V : decrease/increase vertical factor
- h/H : decrease/increase horizontal factor
- up/down : delta vertical
- p : toggle point mode
- t : toggle text info
- pre: install arduino ide
- open sketch
arduino-scope/arduino-scope.ino
and flash firmware- tools/board ( eg. arduino nano )
- tools/port
- sketch upload
- pre: install vscode and suggested c++ extension asked when open the folder
code .
- breakpoints works thanks to
gdb
debugger (-g
switch to gcc - see Makefile ) - tune serial port in
launch.json
"args" - hit F5 to start
- an ethernet udp branch exists but no increase in freq rate because bottleneck still exists in ADC conversion
freq | sine | square |
---|---|---|
460hz | ![]() |
![]() |
1.57khz | ![]() |
![]() |
3.26khz | ![]() |
![]() |
4.44khz | N/A | ![]() |