【雕爷学编程】Arduino动手做(138)---64位WS2812点阵屏模块3

37款传感器与执行器的提法,在网络上广泛流传,其实Arduino能够兼容的传感器模块肯定是不止这37种的。鉴于本人手头积累了一些传感器和执行器模块,依照实践出真知(一定要动手做)的理念,以学习和交流为目的,这里准备逐一动手尝试系列实验,不管成功(程序走通)与否,都会记录下来—小小的进步或是搞不掂的问题,希望能够抛砖引玉。

【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)
实验一百三十八:64位 WS2812B8*8 xRGB 5050 LED模块 ws2812s像素点阵屏

在这里插入图片描述
【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)

实验一百三十八:64位 WS2812B8*8 xRGB 5050 LED模块 ws2812s像素点阵屏

项目十四:快速淡入淡出循环变色

实验开源代码

/*【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)实验一百三十八:64位 WS2812B8*8 xRGB 5050 LED模块 ws2812s像素点阵屏项目十四:快速淡入淡出循环变色实验接线Module  UNOVCC —— 3.3VGND —— GNDDI —— D6*/#include <FastLED.h>// How many leds in your strip?#define NUM_LEDS 64 // For led chips like Neopixels, which have a data line, ground, and power, you just// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,// ground, and power), like the LPD8806, define both DATA_PIN and CLOCK_PIN#define DATA_PIN 6//#define CLOCK_PIN 13// Define the array of ledsCRGB leds[NUM_LEDS];void setup() { Serial.begin(57600);Serial.println("resetting");FastLED.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS);FastLED.setBrightness(24);}void fadeall() { for(int i = 0; i < NUM_LEDS; i++) { leds[i].nscale8(250); } }void loop() { static uint8_t hue = 0;Serial.print("x");// First slide the led in one directionfor(int i = 0; i < NUM_LEDS; i++) {// Set the i'th led to red leds[i] = CHSV(hue++, 255, 255);// Show the ledsFastLED.show(); // now that we've shown the leds, reset the i'th led to black// leds[i] = CRGB::Black;fadeall();// Wait a little bit before we loop around and do it againdelay(10);}Serial.print("x");// Now go in the other direction.  for(int i = (NUM_LEDS)-1; i >= 0; i--) {// Set the i'th led to red leds[i] = CHSV(hue++, 255, 255);// Show the ledsFastLED.show();// now that we've shown the leds, reset the i'th led to black// leds[i] = CRGB::Black;fadeall();// Wait a little bit before we loop around and do it againdelay(10);}}

【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)

实验一百三十八:64位 WS2812B8*8 xRGB 5050 LED模块 ws2812s像素点阵屏

项目十五:每个 LED 灯条的颜色校正设置,以及总输出’色温’的总控制

实验开源代码

/*【Arduino】168种传感器模块系列实验(资料+代码+图形+仿真)实验一百四十六:64位WS2812B 8*8 xRGB 5050 LED模块 ws2812s像素点阵屏项目十五:每个 LED 灯条的颜色校正设置,以及总输出'色温'的总控制实验接线Module    UNOVCC —— 3.3VGND —— GNDDI  ——  D6
*/#include <FastLED.h>
#define LED_PIN     6
// Information about the LED strip itself
#define NUM_LEDS    64
#define CHIPSET     WS2811
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
#define BRIGHTNESS  26// FastLED v2.1 provides two color-management controls:
//   (1) color correction settings for each LED strip, and
//   (2) master control of the overall output 'color temperature' 
//
// THIS EXAMPLE demonstrates the second, "color temperature" control.
// It shows a simple rainbow animation first with one temperature profile,
// and a few seconds later, with a different temperature profile.
//
// The first pixel of the strip will show the color temperature.
//
// HELPFUL HINTS for "seeing" the effect in this demo:
// * Don't look directly at the LED pixels.  Shine the LEDs aganst
//   a white wall, table, or piece of paper, and look at the reflected light.
//
// * If you watch it for a bit, and then walk away, and then come back 
//   to it, you'll probably be able to "see" whether it's currently using
//   the 'redder' or the 'bluer' temperature profile, even not counting
//   the lowest 'indicator' pixel.
//
//
// FastLED provides these pre-conigured incandescent color profiles:
//     Candle, Tungsten40W, Tungsten100W, Halogen, CarbonArc,
//     HighNoonSun, DirectSunlight, OvercastSky, ClearBlueSky,
// FastLED provides these pre-configured gaseous-light color profiles:
//     WarmFluorescent, StandardFluorescent, CoolWhiteFluorescent,
//     FullSpectrumFluorescent, GrowLightFluorescent, BlackLightFluorescent,
//     MercuryVapor, SodiumVapor, MetalHalide, HighPressureSodium,
// FastLED also provides an "Uncorrected temperature" profile
//    UncorrectedTemperature;#define TEMPERATURE_1 Tungsten100W
#define TEMPERATURE_2 OvercastSky// How many seconds to show each temperature before switching
#define DISPLAYTIME 20
// How many seconds to show black between switches
#define BLACKTIME   3void loop()
{// draw a generic, no-name rainbowstatic uint8_t starthue = 0;fill_rainbow( leds + 5, NUM_LEDS - 5, --starthue, 20);// Choose which 'color temperature' profile to enable.uint8_t secs = (millis() / 1000) % (DISPLAYTIME * 2);if( secs < DISPLAYTIME) {FastLED.setTemperature( TEMPERATURE_1 ); // first temperatureleds[0] = TEMPERATURE_1; // show indicator pixel} else {FastLED.setTemperature( TEMPERATURE_2 ); // second temperatureleds[0] = TEMPERATURE_2; // show indicator pixel}// Black out the LEDs for a few secnds between color changes// to let the eyes and brains adjustif( (secs % DISPLAYTIME) < BLACKTIME) {memset8( leds, 0, NUM_LEDS * sizeof(CRGB));}FastLED.show();FastLED.delay(8);
}void setup() {delay( 3000 ); // power-up safety delay// It's important to set the color correction for your LED strip here,// so that colors can be more accurately rendered through the 'temperature' profilesFastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalSMD5050 );FastLED.setBrightness( BRIGHTNESS );
}

【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)

实验一百三十八:64位 WS2812B8*8 xRGB 5050 LED模块 ws2812s像素点阵屏

项目十六:FastLED“100行代码”演示卷轴动画效果

实验开源代码

/*【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)实验一百三十八:64位 WS2812B8*8 xRGB 5050 LED模块 ws2812s像素点阵屏项目十六:FastLED“100行代码”演示卷轴动画效果实验接线Module  UNOVCC —— 3.3VGND —— GNDDI —— D6*/#include <FastLED.h>FASTLED_USING_NAMESPACE// FastLED "100-lines-of-code" demo reel, showing just a few // of the kinds of animation patterns you can quickly and easily // compose using FastLED.  //// This example also shows one easy way to define multiple // animations patterns and have them automatically rotate.//// -Mark Kriegsman, December 2014#define DATA_PIN  6//#define CLK_PIN  4#define LED_TYPE  WS2811#define COLOR_ORDER GRB#define NUM_LEDS  64CRGB leds[NUM_LEDS];#define BRIGHTNESS     26#define FRAMES_PER_SECOND 120void setup() {delay(3000); // 3 second delay for recovery// tell FastLED about the LED strip configurationFastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);//FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);// set master brightness controlFastLED.setBrightness(BRIGHTNESS);}// List of patterns to cycle through. Each is defined as a separate function below.typedef void (*SimplePatternList[])();SimplePatternList gPatterns = { rainbow, rainbowWithGlitter, confetti, sinelon, juggle, bpm };uint8_t gCurrentPatternNumber = 0; // Index number of which pattern is currentuint8_t gHue = 0; // rotating "base color" used by many of the patternsvoid loop(){// Call the current pattern function once, updating the 'leds' arraygPatterns[gCurrentPatternNumber]();// send the 'leds' array out to the actual LED stripFastLED.show();  // insert a delay to keep the framerate modestFastLED.delay(1000/FRAMES_PER_SECOND); // do some periodic updatesEVERY_N_MILLISECONDS( 20 ) { gHue++; } // slowly cycle the "base color" through the rainbowEVERY_N_SECONDS( 10 ) { nextPattern(); } // change patterns periodically}#define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))void nextPattern(){// add one to the current pattern number, and wrap around at the endgCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns);}void rainbow() {// FastLED's built-in rainbow generatorfill_rainbow( leds, NUM_LEDS, gHue, 7);}void rainbowWithGlitter() {// built-in FastLED rainbow, plus some random sparkly glitterrainbow();addGlitter(80);}void addGlitter( fract8 chanceOfGlitter) {if( random8() < chanceOfGlitter) {leds[ random16(NUM_LEDS) ] += CRGB::White;}}void confetti() {// random colored speckles that blink in and fade smoothlyfadeToBlackBy( leds, NUM_LEDS, 10);int pos = random16(NUM_LEDS);leds[pos] += CHSV( gHue + random8(64), 200, 255);}void sinelon(){// a colored dot sweeping back and forth, with fading trailsfadeToBlackBy( leds, NUM_LEDS, 20);int pos = beatsin16( 13, 0, NUM_LEDS-1 );leds[pos] += CHSV( gHue, 255, 192);}void bpm(){// colored stripes pulsing at a defined Beats-Per-Minute (BPM)uint8_t BeatsPerMinute = 62;CRGBPalette16 palette = PartyColors_p;uint8_t beat = beatsin8( BeatsPerMinute, 64, 255);for( int i = 0; i < NUM_LEDS; i++) { //9948leds[i] = ColorFromPalette(palette, gHue+(i*2), beat-gHue+(i*10));}}void juggle() {// eight colored dots, weaving in and out of sync with each otherfadeToBlackBy( leds, NUM_LEDS, 20);uint8_t dothue = 0;for( int i = 0; i < 8; i++) {leds[beatsin16( i+7, 0, NUM_LEDS-1 )] |= CHSV(dothue, 200, 255);dothue += 32;}}

【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)

实验一百三十八:64位 WS2812B8*8 xRGB 5050 LED模块 ws2812s像素点阵屏

项目十七:随机60帧火焰花

实验开源代码

/*【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)实验一百三十八:64位 WS2812B8*8 xRGB 5050 LED模块 ws2812s像素点阵屏项目十七:随机60帧火焰花实验接线Module  UNOVCC —— 3.3VGND —— GNDDI —— D6*/#include <FastLED.h>#define LED_PIN   6#define COLOR_ORDER GRB#define CHIPSET   WS2811#define NUM_LEDS  64#define BRIGHTNESS 22#define FRAMES_PER_SECOND 60bool gReverseDirection = false;CRGB leds[NUM_LEDS];void setup() {delay(3000); // sanity delayFastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );FastLED.setBrightness( BRIGHTNESS );}void loop(){// Add entropy to random number generator; we use a lot of it.// random16_add_entropy( random());Fire2012(); // run simulation frameFastLED.show(); // display this frameFastLED.delay(1000 / FRAMES_PER_SECOND);}// Fire2012 by Mark Kriegsman, July 2012// as part of "Five Elements" shown here: http://youtu.be/knWiGsmgycY// This basic one-dimensional 'fire' simulation works roughly as follows:// There's a underlying array of 'heat' cells, that model the temperature// at each point along the line. Every cycle through the simulation,// four steps are performed:// 1) All cells cool down a little bit, losing heat to the air// 2) The heat from each cell drifts 'up' and diffuses a little// 3) Sometimes randomly new 'sparks' of heat are added at the bottom// 4) The heat from each cell is rendered as a color into the leds array//   The heat-to-color mapping uses a black-body radiation approximation.//// Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).//// This simulation scales it self a bit depending on NUM_LEDS; it should look// "OK" on anywhere from 20 to 100 LEDs without too much tweaking.//// I recommend running this simulation at anywhere from 30-100 frames per second,// meaning an interframe delay of about 10-35 milliseconds.//// Looks best on a high-density LED setup (60+ pixels/meter).////// There are two main parameters you can play with to control the look and// feel of your fire: COOLING (used in step 1 above), and SPARKING (used// in step 3 above).//// COOLING: How much does the air cool as it rises?// Less cooling = taller flames. More cooling = shorter flames.// Default 50, suggested range 20-100#define COOLING 55// SPARKING: What chance (out of 255) is there that a new spark will be lit?// Higher chance = more roaring fire. Lower chance = more flickery fire.// Default 120, suggested range 50-200.#define SPARKING 120void Fire2012(){// Array of temperature readings at each simulation cellstatic uint8_t heat[NUM_LEDS];// Step 1. Cool down every cell a littlefor ( int i = 0; i < NUM_LEDS; i++) {heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) / NUM_LEDS) + 2));}// Step 2. Heat from each cell drifts 'up' and diffuses a littlefor ( int k = NUM_LEDS - 1; k >= 2; k--) {heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;}// Step 3. Randomly ignite new 'sparks' of heat near the bottomif ( random8() < SPARKING ) {int y = random8(7);heat[y] = qadd8( heat[y], random8(160, 255) );}// Step 4. Map from heat cells to LED colorsfor ( int j = 0; j < NUM_LEDS; j++) {CRGB color = HeatColor( heat[j]);int pixelnumber;if ( gReverseDirection ) {pixelnumber = (NUM_LEDS - 1) - j;} else {pixelnumber = j;}leds[pixelnumber] = color;}}

【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)

实验一百三十八:64位 WS2812B8*8 xRGB 5050 LED模块 ws2812s像素点阵屏

项目十八:带有可编程调色板的 Fire2012 火灾模拟

实验开源代码

/*【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)实验一百三十八:64位 WS2812B8*8 xRGB 5050 LED模块 ws2812s像素点阵屏项目十八:带有可编程调色板的 Fire2012 火灾模拟实验接线Module  UNOVCC —— 3.3VGND —— GNDDI —— D6*/#include <FastLED.h>#define LED_PIN   6#define COLOR_ORDER GRB#define CHIPSET   WS2811#define NUM_LEDS  64#define BRIGHTNESS 22#define FRAMES_PER_SECOND 60bool gReverseDirection = false;CRGB leds[NUM_LEDS];// Fire2012 with programmable Color Palette//// This code is the same fire simulation as the original "Fire2012",// but each heat cell's temperature is translated to color through a FastLED// programmable color palette, instead of through the "HeatColor(...)" function.//// Four different static color palettes are provided here, plus one dynamic one.// // The three static ones are: //  1. the FastLED built-in HeatColors_p -- this is the default, and it looks//   pretty much exactly like the original Fire2012.//// To use any of the other palettes below, just "uncomment" the corresponding code.////  2. a gradient from black to red to yellow to white, which is//   visually similar to the HeatColors_p, and helps to illustrate//   what the 'heat colors' palette is actually doing,//  3. a similar gradient, but in blue colors rather than red ones,//   i.e. from black to blue to aqua to white, which results in//   an "icy blue" fire effect,//  4. a simplified three-step gradient, from black to red to white, just to show//   that these gradients need not have four components; two or//   three are possible, too, even if they don't look quite as nice for fire.//// The dynamic palette shows how you can change the basic 'hue' of the// color palette every time through the loop, producing "rainbow fire".CRGBPalette16 gPal;void setup() {delay(3000); // sanity delayFastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );FastLED.setBrightness( BRIGHTNESS );// This first palette is the basic 'black body radiation' colors,// which run from black to red to bright yellow to white.gPal = HeatColors_p;// These are other ways to set up the color palette for the 'fire'.// First, a gradient from black to red to yellow to white -- similar to HeatColors_p//  gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::Yellow, CRGB::White);// Second, this palette is like the heat colors, but blue/aqua instead of red/yellow//  gPal = CRGBPalette16( CRGB::Black, CRGB::Blue, CRGB::Aqua, CRGB::White);// Third, here's a simpler, three-step gradient, from black to red to white//  gPal = CRGBPalette16( CRGB::Black, CRGB::Red, CRGB::White);}void loop(){// Add entropy to random number generator; we use a lot of it.random16_add_entropy( random());// Fourth, the most sophisticated: this one sets up a new palette every// time through the loop, based on a hue that changes every time.// The palette is a gradient from black, to a dark color based on the hue,// to a light color based on the hue, to white.////  static uint8_t hue = 0;//  hue++;//  CRGB darkcolor = CHSV(hue,255,192); // pure hue, three-quarters brightness//  CRGB lightcolor = CHSV(hue,128,255); // half 'whitened', full brightness//  gPal = CRGBPalette16( CRGB::Black, darkcolor, lightcolor, CRGB::White);Fire2012WithPalette(); // run simulation frame, using palette colorsFastLED.show(); // display this frameFastLED.delay(1000 / FRAMES_PER_SECOND);}// Fire2012 by Mark Kriegsman, July 2012// as part of "Five Elements" shown here: http://youtu.be/knWiGsmgycY // This basic one-dimensional 'fire' simulation works roughly as follows:// There's a underlying array of 'heat' cells, that model the temperature// at each point along the line. Every cycle through the simulation, // four steps are performed:// 1) All cells cool down a little bit, losing heat to the air// 2) The heat from each cell drifts 'up' and diffuses a little// 3) Sometimes randomly new 'sparks' of heat are added at the bottom// 4) The heat from each cell is rendered as a color into the leds array//   The heat-to-color mapping uses a black-body radiation approximation.//// Temperature is in arbitrary units from 0 (cold black) to 255 (white hot).//// This simulation scales it self a bit depending on NUM_LEDS; it should look// "OK" on anywhere from 20 to 100 LEDs without too much tweaking. //// I recommend running this simulation at anywhere from 30-100 frames per second,// meaning an interframe delay of about 10-35 milliseconds.//// Looks best on a high-density LED setup (60+ pixels/meter).////// There are two main parameters you can play with to control the look and// feel of your fire: COOLING (used in step 1 above), and SPARKING (used// in step 3 above).//// COOLING: How much does the air cool as it rises?// Less cooling = taller flames. More cooling = shorter flames.// Default 55, suggested range 20-100 #define COOLING 55// SPARKING: What chance (out of 255) is there that a new spark will be lit?// Higher chance = more roaring fire. Lower chance = more flickery fire.// Default 120, suggested range 50-200.#define SPARKING 120void Fire2012WithPalette(){// Array of temperature readings at each simulation cellstatic uint8_t heat[NUM_LEDS];// Step 1. Cool down every cell a littlefor( int i = 0; i < NUM_LEDS; i++) {heat[i] = qsub8( heat[i], random8(0, ((COOLING * 10) / NUM_LEDS) + 2));}// Step 2. Heat from each cell drifts 'up' and diffuses a littlefor( int k= NUM_LEDS - 1; k >= 2; k--) {heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3;}// Step 3. Randomly ignite new 'sparks' of heat near the bottomif( random8() < SPARKING ) {int y = random8(7);heat[y] = qadd8( heat[y], random8(160,255) );}// Step 4. Map from heat cells to LED colorsfor( int j = 0; j < NUM_LEDS; j++) {// Scale the heat value from 0-255 down to 0-240// for best results with color palettes.uint8_t colorindex = scale8( heat[j], 240);CRGB color = ColorFromPalette( gPal, colorindex);int pixelnumber;if( gReverseDirection ) {pixelnumber = (NUM_LEDS-1) - j;} else {pixelnumber = j;}leds[pixelnumber] = color;}}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/19753.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

解决IDEA/WebStorm的Ctrl+Shift+F冲突失效

IDEA 的 CtrlShiftF 是全文或全项目搜索搜索快捷键&#xff0c;非常好用。 当这个快捷键偶而会失效时&#xff0c;基本可以确定是快捷键冲突了。 检查所有运行的软件的快捷键&#xff0c;若有设置为CtrlShiftF的则改掉。特别是输入法会占用较多的快捷键。 例如我这里的搜过输…

选择合适的软件,提升工作计划效率

在快节奏的工作环境中&#xff0c;日程安排变得尤为重要。有许多不同的软件可用于帮助管理日程&#xff0c;但哪个软件最适合您的需求&#xff1f;在本文中&#xff0c;我们将介绍几种适合工作安排的软件。 1.Google Calendar Google日历是一种功能强大、易于使用且免费的日历应…

尚硅谷03:前端开发之ES | Vue_es6 Axios Node Npm

目录 内容介绍 统一异常处理 统一日志处理 前端介绍、工具使用 ES6入门 Vue入门 Vue语法 Vue语法高级 内容介绍 1、统一异常处理 2、统一日志处理&#xff08;了解&#xff09; 3、前端介绍 4、ES6 5、VUE入门、基本语法 6、VUE高级语法 7、axios&#xff08;重点…

力扣题库刷题笔记42--接雨水(未通过)

1、题目如下&#xff1a; 2、个人Python代码实现&#xff08;部分用例超时&#xff09; 本地执行大概超过30S&#xff0c;力扣显示超时 3、个人Python代码思路&#xff1a; 当且仅当nums[i] < nums[i1]&#xff0c;nums[i] < nums[i-1]&#xff0c;此时nums[i]才能接到雨…

ASPICE软件工具链之Jira教程

Jira使用教程 一、什么是Jira? 二、Jira的使用教程 功能介绍: 创建工作流 工作流方案 设置字段流程 字段配置 界面方案 界面方案创建流程 问题类型界面方案 将项目与预先创建的方案关联 配置总流程 创建项目 设置项目 添加工作流 添加界面配置方案 设置Scrum 看板泳道图 一…

学习记录——BiSeNetV1、BiSeNetV2、BiSeNetV3、PIDNet

BiSeNetV1 BiSeNetV1为了在不影响速度的情况下&#xff0c;同时收集到空间信息和语义信息&#xff0c;设计了两条路&#xff1a; Spatial Path: 用了三层stride为 2 的卷积&#xff0c;卷积BNRELU模块。最后提取了相当于原图像 1/8 的输出特征图。由于它利用了较大尺度的特征图…

Java习题之实现平方根(sqrt)函数

目录 前言 二分查找 牛顿迭代法 总结 &#x1f381;博主介绍&#xff1a;博客名为tq02&#xff0c;已学C语言、JavaSE&#xff0c;目前学了MySQL和JavaWed &#x1f3a5;学习专栏&#xff1a; C语言 JavaSE MySQL基础 &#x1f384;博主链接&#xff1a;tq02的…

redis实现相关分布式锁

为什么需要分布式锁 我们知道&#xff0c;当多个线程并发操作某个对象时&#xff0c;可以通过synchronized来保证同一时刻只能有一个线程获取到对象锁进而处理synchronized关键字修饰的代码块或方法。既然已经有了synchronized锁&#xff0c;为什么这里又要引入分布式锁呢&…

【Spring Boot】Spring Boot的系统配置 — 系统配置文件

系统配置文件 Spring Boot的系统配置文件&#xff0c;包括application.properties和application.yml配置文件的使用以及YML和Properties配置文件有什么区别&#xff0c;最后介绍如何更改Spring Boot的启动图案。 1.application.properties Spring Boot支持两种不同格式的配置…

Oracle初级

目录 概念 数据库分类 Oracle 存储结构 安装成功 ​编辑 创建用户和表空间 以超级管理员身份登录 创建表空间 创建用户 给用户授权 查询测试 概念 数据库&#xff08;database&#xff09;: 物理操作系统文件或磁盘的集合。简单来说数据库的意思是数据的集合。 DBM…

Leetcode每日一题:931. 下降路径最小和(2023.7.13 C++)

目录 931. 下降路径最小和 题目描述&#xff1a; 实现代码与解析&#xff1a; 动态规划 原理思路&#xff1a; 931. 下降路径最小和 题目描述&#xff1a; 给你一个 n x n 的 方形 整数数组 matrix &#xff0c;请你找出并返回通过 matrix 的下降路径 的 最小和 。 下降…

前端Vue自定义商品订单星级评分 爱心评分组件

随着技术的发展&#xff0c;开发的复杂度也越来越高&#xff0c;传统开发方式将一个系统做成了整块应用&#xff0c;经常出现的情况就是一个小小的改动或者一个小功能的增加可能会引起整体逻辑的修改&#xff0c;造成牵一发而动全身。 通过组件化开发&#xff0c;可以有效实现…