273 views|1 replies

46

Posts

0

Resources
The OP
 

【Follow me Season 2 Episode 2】Task 2: LED matrix + DAC sine + op amp amplification + ADC acquisition and printing [Copy link]

 This post was last edited by dvacos on 2024-9-21 15:23
1. LED Matrix
Text Display:
I discovered by chance that the ArduinoGraphics library can display text on the LED matrix, so I used it to create the following effect.
Code:
//固定字

#include "ArduinoGraphics.h"
#include "Arduino_LED_Matrix.h"

ArduinoLEDMatrix matrix;

void setup() {
  matrix.beginDraw();
  matrix.stroke(0xFFFFFFFF);
  const char text[] = "Hello";
  matrix.textFont(Font_5x7);
  matrix.beginText(0, 1, 0xFFFFFF);
  matrix.println(text);
  matrix.endText();

  matrix.endDraw();
}

void loop() {
}

Scrolling Text
Since the LED matrix is very small and the resolution is very low, it can only display a few letters, so the scrolling code is added, so the effect is as follows
Code:
//滚动灯

#include "ArduinoGraphics.h"
#include "Arduino_LED_Matrix.h"

ArduinoLEDMatrix matrix;

void setup() {
  matrix.begin();
}

void loop() {

  matrix.beginDraw();

  matrix.stroke(0xFFFFFFFF);
  matrix.textScrollSpeed(100);

  const char text[] = "  Hello EEWorld!  ";
  matrix.textFont(Font_5x7);
  matrix.beginText(0, 1, 0xFFFFFF);
  matrix.println(text);
  matrix.endText(SCROLL_LEFT);

  matrix.endDraw();
}

2. DAC generates sine wave
DAC pin confirmation
So by connecting the oscilloscope to A0, you can see the following waveform, a sine wave with a frequency of 1khz.
3. OPAMP amplifies DAC signal
The amplified output signal should not exceed ~4.7 V, otherwise clipping will occur and may even damage the board, so reduce the voltage of the sine wave generated by the DAC
4.64v before reduction
After reducing 2.44v
Code to add:
  wave.amplitude(0.5);

Wiring Diagram
Very important!!! If connected incorrectly, the voltage will not be amplified
A0 - A1 provides the DAC output voltage
One end of the resistor is grounded, the midpoint is connected to A2, and the other end is connected to A3
Experimental results
4. ADC collects voltage and prints
Based on the third point, connect the voltage output by A3 op amp to A4, and the voltage generated by A0DAC to A5
Since the host computer cannot scale the Y axis (or I don't know how to do it), I can only barely see it.
The above are all the tasks for Task 2!!!

This post is from DigiKey Technology Zone

Latest reply

This display library is good, avoiding endless checking   Details Published on 2024-9-22 18:56
 
 

6075

Posts

6

Resources
2
 

This display library is good, avoiding endless checking

This post is from DigiKey Technology Zone
Personal signature

在爱好的道路上不断前进,在生活的迷雾中播撒光引

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list