投稿時間:2023-08-25 17:21:45 RSSフィード2023-08-25 17:00 分まとめ(26件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT ITmedia 総合記事一覧 [ITmedia News] 「日本一高いバスターミナル」に、Starlink使った5G基地局 KDDIが運用開始 https://www.itmedia.co.jp/news/articles/2308/25/news157.html itmedia 2023-08-25 16:30:00
IT ITmedia 総合記事一覧 [ITmedia News] トランプ元米大統領、2年以上ぶりにX(旧Twitter)にポスト https://www.itmedia.co.jp/news/articles/2308/25/news155.html itmedia 2023-08-25 16:16:00
IT ITmedia 総合記事一覧 [ITmedia News] “集え、モンスターハンター” ネス湖で大規模「ネッシー探し」開催 ライブカメラも配信中 https://www.itmedia.co.jp/news/articles/2308/25/news153.html itmedia 2023-08-25 16:07:00
TECH Techable(テッカブル) 「香りの言語化」で売れ筋商品が変わる?KAORIUM開発者・栗栖氏に聞いた、“香り×言語”の融合による未来の顧客体験とは https://techable.jp/archives/218302 kaorium 2023-08-25 07:00:21
python Pythonタグが付けられた新着投稿 - Qiita AWS Lambda+Selenium(python)でダウンロード場所を、/tmpに変更する方法 https://qiita.com/tomoki-sys/items/9762ace3f0f9d115ff31 awslambda 2023-08-25 16:28:58
AWS AWSタグが付けられた新着投稿 - Qiita AWS Lambda+Selenium(python)でダウンロード場所を、/tmpに変更する方法 https://qiita.com/tomoki-sys/items/9762ace3f0f9d115ff31 awslambda 2023-08-25 16:28:58
Ruby Railsタグが付けられた新着投稿 - Qiita Rails7でCacheを利用する(purgeも含む) https://qiita.com/piggydev/items/958ca07fc87d6759fdc6 sforselectusersrailscache 2023-08-25 16:36:10
技術ブログ Developers.IO Alteryx Designer Cloudのツール紹介:Select Rowsツール #Alteryx https://dev.classmethod.jp/articles/alteryx-designer-cloud-select-rows-tool/ alteryx 2023-08-25 07:53:19
技術ブログ Developers.IO [レポート] AIでゲームキャラクターの表情を自動設定。Cygames社のAI活用事例セッション #CEDEC2023 #classmethod_game https://dev.classmethod.jp/articles/cedec2023-cygames-ai/ cedec 2023-08-25 07:09:05
海外TECH DEV Community ESP32 Standard Library Embedded Rust: SPI with the MAX7219 LED Dot Matrix https://dev.to/apollolabsbin/esp32-standard-library-embedded-rust-spi-with-the-max7219-led-dot-matrix-1ge0 ESP Standard Library Embedded Rust SPI with the MAX LED Dot MatrixThis blog post is the seventh of a multi part series of posts where I explore various peripherals in the ESPC using standard library embedded Rust and the esp idf hal Please be aware that certain concepts in newer posts could depend on concepts in prior posts IntroductionThe Serial Peripheral Interface SPI is another type of serial communication standard commonly used in embedded SPI facilitates high speed full duplex transactions that are useful in applications that require large bandwidth such as memory interfaces and displays An example device that utilizes a SPI interface is the MAX The MAX is an integrated circuit IC designed to control and drive a matrix of LEDs typically in the form of a segment display or a dot matrix display It is widely used to interface microcontrollers and digital devices with LED displays for various applications such as digital clocks scoreboards message boards and more In this blog post I ll be working with the MAX digit LED display driver As such I ll be using the ESPC and the esp idf hal to configure and control the SPI peripheral to control the MAX If you find this post useful and to keep up to date with similar posts here s the list of channels you can follow subscribe to Follow Me on TwitterSubscribe to NewsletterFollow me on GitHubClick Here for Rust Swag Knowledge Pre requisitesTo understand the content of this post you need the following Basic knowledge of coding in Rust Familiarity with the basic template for creating embedded applications in Rust Familiarity with SPI communication basics Having read the MAX digit LED display driver datasheet Software SetupAll the code presented in this post is available on the apollolabs ESPC git repo Note that if the code on the git repo is slightly different then it means that it was modified to enhance the code quality or accommodate any HAL Rust updates Additionally the full project code and simulation is available on Wokwi here Hardware Setup MaterialsESP C DevKitMMAX LED x Dot Matrix Module ConnectionsMAX module CLK pin connected to ESP DevKit gpio MAX module DIN pin connected to ESP DevKit gpio MAX module CS pin connected to ESP DevKit gpio MAX module Vcc pin connected to ESP DevKit V MAX module GND pin connected to ESP DevKit GND ‍ Software DesignAll that the application software will do is draw a diagonal line on the x LED matrix then erase it and draw it again Ahead of that all the steps involved will be to initialize and configure the MAX so that it can be used What steps need to be taken for configuration all come from the datasheet Ahead of that though let s take a look at a couple of things First is the internal block diagram of the MAX In this description I will focus on the details needed for our application This is because the MAX offers several configurations and options Interested readers can refer to the datasheet for more intimate details In the MAX there are bits of data that get clocked in MSB first using SPI while the CS signal is low After all the data is clocked in the CS signal is driven high to latch the data A portion of those latched in bits is used as an address bits D D and another portion as data for command bits D D The rest of the bits D D are simply ignored The MAX also allows for chaining multiple display matrices side by side by connecting the DOUT on one device to the DIN of the next device When showing data turning on LEDs in the matrix the address part selects what digit we want to show and the data controls which segments are turned on As shown in the diagram there are segment driver pins and a decimal point and digit driver pins Now let s take a look at the schematic showing how the LED dot matrix is connected to the MAX If you notice the segment pins of the MAX are connected to the LED matrix rows and the digit pins are connected to the LED matrix columns As such the way the MAX operates it will allow us to cycle through digits or columns turning on off any segment or LEDs in any digit MAX Initialization SequenceReading into the MAX datasheet the following steps need to be taken to initialize the device for usage Write x to address xC to power up the MAXWrite x to address x to put the MAX in No Decode mode see notes Write x to address xB removing any scan limit see notes Write x to address xA choosing a medium light intensity for the LEDsNotesThe No Decode mode is the one necessary for driving an LED matrix Other modes are ones used for driving seven segment displays The scan limit controls how many digits are activated displayed in the case of hooking up the MAX to seven segment displays In the case of the LED dot matrix however the scan limit affects how many rows can be activated Obviously in the case of the x dot matrix all rows need to be shown However this is a feature when connecting a series of seven segment displays in some cases some digits need not be used LED Matrix Control SequenceLike I had mentioned earlier all that the code will be doing is activate the LEDs diagonally one at a time then deactivate them again These are the steps Initialize a variable x to keep track of the column and row index and initialize it with a value of Activate LED x in row xDelay msIncrement column and row index x x If the last row is reached x reset x back to else go back to step Deactivate all the LEDs in the row xDelay msIncrement column and row index x x If the last row is reached x reset x back to else go back to step It becomes clear that it would be convenient to wrap this implementation in some sort of loop Let s move on to the implementation to see what the code looks like ‍ Code Implementation Crate ImportsIn this implementation the following crates are required The embedded hal crate to import spi configuration parameters The esp idf hal crate to import the needed device hardware abstractions use embedded hal spi use esp idf hal delay FreeRtos use esp idf hal gpio use esp idf hal peripherals Peripherals use esp idf hal prelude use esp idf hal spi config Config use esp idf hal spi Initialization Configuration Code SPI Peripheral Configuration ️⃣Obtain a handle for the device peripherals Similar to all past blog posts in embedded Rust as part of the singleton design pattern we first have to take the device peripherals This is done using the take method Here I create a device peripheral handler named peripherals as follows let peripherals Peripherals take unwrap ️⃣Obtain handles for SCLK MOSI and CS pins Here I need to configure and obtain handles for the SCLK MOSI and CS pins so that they can be controlled by the SPI peripheral As shown earlier the SCLK MOSI and CS pins are connected to gpio gpio and gpio respectively As such I obtain handles for sclk mosi and cs as follows let sclk peripherals pins gpio let mosi peripherals pins gpio let cs peripherals pins gpio ️⃣Instantiate a SPI Driver In the esp idf hal SPI is configured in two steps The first step involves instantiating a SPIDriver followed by a SPIDeviceDriver The SPIDriver defines the peripheral instance to be used the pins and configurations like dma The SPIDeviceDriver on the other hand configures SPI behavior like modes baudrate and bit order among others In this application we re going to use SPI since SPI and SPI have restrictions according to the documentation To configure instantiate we need to use use the new method in the SPIDriver abstraction struct to instantiate a SPI instance If we examine the new method signature in SPIDriver it looks like this pub fn new lt SPI SpiAnyPins gt spi impl Peripheral lt P SPI gt d sclk impl Peripheral lt P impl OutputPin gt d sdo impl Peripheral lt P impl OutputPin gt d sdi Option lt impl Peripheral lt P impl InputPin OutputPin gt d gt config amp DriverConfig gt Result lt Self EspError gt The method takes five parameters a spi instance pins instances and a DriverConfig instance reference As such we can create a handle spi drv for spi as follows let spi drv SpiDriver new peripherals spi sclk mosi None lt gpio AnyIOPin gt amp SpiDriverConfig new unwrap A couple of things to note first is that since the communication is in one direction I don t need to pass a pin instance to sdi serial input or MISO As a result I am passing a None lt gpio AnyIOPin gt since sdi requires an Option The type annotation is necessary because the compiler would otherwise blow an error Second is that I by instantiating a SpiDriverConfig using it s new method I am electing for the default configuration which is sufficient for our application ️⃣Configure the SPI peripheral channel This is the second step to configure SPI behavior using the SPIDeviceDriver In our case there are two items we need to configure the baud rate and the mode according to the MAX specification SPIDeviceDriver has a new method that takes three parameters an instance of a SPIDriver an instance of a cs pin and a spi config Config configuration as follows pub fn new driver T cs Option lt impl Peripheral lt P impl OutputPin gt d gt config amp Config gt Result lt Self EspError gt Additionally the Config struct contains several members allowing us to configure the SPI driver and is defined as follows pub struct Config pub baudrate Hertz pub data mode Mode pub write only bool pub duplex Duplex pub bit order BitOrder pub cs active high bool pub input delay ns i Looking into the source code the Config struct defaults are sufficient except for the baudrate and the data mode For convenience I create a separate handle config for the SPI configuration as follows let config Config new baudrate MHz into data mode Mode polarity Polarity IdleLow phase Phase CaptureOnFirstTransition The baudrate and the mode are configured according to the MAX requirements Both Polarity and Phase are enums with different options In my instance I chose the Polarity IdleLow option and Phase CaptureOnFirstTransition option The choices correspond to what is known as SPI Mode which is what the MAX datasheet defines as the mode of operation Additionally the MAX datasheet states that the device can handle up to MHz as a maximum rate so I only chose an arbitrary value of MHz under the stated limit Following that I instantiate the SPIDeviceDriver and pass the SPIDriver handle spi drv the handle for the cs pin and a reference to the SPIDeviceDriver configuration config let mut spi SpiDeviceDriver new spi drv Some cs amp config unwrap This is it for configuration Let s now jump into the application code Application CodeIn the software design described the first step requires that we write x to address xC to power up the MAX As explained earlier the way data is written to the MAX is by clocking in bits MSB first while the CS line is low After that the CS line needs to be asserted to latch the data To send data over SPI there is a write method that has the following signature pub fn write amp mut self write amp u gt Result lt EspError gt As can be observed the write method takes a slice of bytes sending everything the slice contains byte after byte Additionally in the write method takes care of asserting and unasserting the cs pin As such to achieve the described earlier the following code was written Prepare Datalet data u x let addr u xC let send array u addr data Send Dataspi write amp send array unwrap As can be seen the bit word is packaged in a single array that is passed into the write method so that it can be transmitted while the write method keeps CS low data refers to data that is being written to the addr address in the MAX After that CS is asserted by write to latch the transmitted array This code is repeated exactly in the same manner with different addr and data contents for the remaining steps and required to initialize the MAX All that is left now is to write the code for drawing the diagonal line on the LED matrix Looking at the steps described earlier essentially all that needs to be done is to cycle through addresses rows to then send bit data that represents individual LEDs columns to light up Since we are drawing a diagonal line then one LED needs to be lit up in each row at a time The LED that is lit will shift one bit to the left as we cycle through the rows This can be wrapped in a for loop as follows let mut data u for addr in let send array u addr data data data lt lt spi write amp send array unwrap FreeRtos delay ms u Note also the delay that is introduced at the end of the loop so that the LEDs can be noticed as they turn on and off Next we want to clear the rows one by one so a second similar loop can be introduced as follows for addr in let send array u addr data spi write amp send array unwrap FreeRtos delay ms u Keep in mind here that data already has a zero value from the previous loop so it does not need to be updated This is it Full Application CodeHere is the full code for the implementation described in this post You can additionally find the full project and others available on the apollolabs ESPC git repo Also the Wokwi project can be accessed here use esp idf sys self as If using the binstart feature of esp idf sys always keep this module importeduse embedded hal spi use esp idf hal delay FreeRtos use esp idf hal gpio use esp idf hal peripherals Peripherals use esp idf hal prelude use esp idf hal spi config Config use esp idf hal spi fn main gt Setup handler for device peripherals let peripherals Peripherals take unwrap Create handles for SPI pins let sclk peripherals pins gpio let mosi peripherals pins gpio let cs peripherals pins gpio Instantiate SPI Driver let spi drv SpiDriver new peripherals spi sclk mosi None lt gpio AnyIOPin gt amp SpiDriverConfig new unwrap Configure Parameters for SPI device let config Config new baudrate MHz into data mode Mode polarity Polarity IdleLow phase Phase CaptureOnFirstTransition Instantiate SPI Device Driver and Pass Configuration let mut spi SpiDeviceDriver new spi drv Some cs amp config unwrap Application Initalize Matrix Display a Power Up Device Prepare Data to be Sent bit Data Command Corresponding to Matrix Power Up let data u x bit Address of Shutdown Mode Command let addr u xC Package into array to pass to SPI write method Write method will grab array and send all data in it let send array u addr data Send Data Shift in bits by passing send array bits will be shifted MSB first Note that write method handles the CS pin state spi write amp send array unwrap b Set up Decode Mode Prepare Information to be Sent bit Data Command Corresponding to No Decode Mode let data u x bit Address of Decode Mode Command let addr u x Package into array to pass to SPI write method Write method will grab array and send all data in it let send array u addr data Send Data Shift in bits by passing send array bits will be shifted MSB first spi write amp send array unwrap c Configure Scan Limit Prepare Information to be Sent bit Data Command Corresponding to Scan Limit Displaying all digits let data u x bit Address of Scan Limit Command let addr u xB Package into array to pass to SPI write method Write method will grab array and send all data in it let send array u addr data Send Data Shift in bits by passing send array bits will be shifted MSB first spi write amp send array unwrap c Configure Intensity Prepare Information to be Sent bit Data Command Corresponding to Duty Cycle Medium Intensity let data u x bit Address of Intensity Control Command let addr u xA Package into array to pass to SPI write method Write method will grab array and send all data in it let send array u addr data Send Data Shift in bits by passing send array bits will be shifted MSB first spi write amp send array unwrap loop let mut data u Iterate over all rows of LED matrix for addr in addr refrences the row data will be sent to let send array u addr data Shift a with evey loop data data lt lt Send data just like earlier spi write amp send array unwrap Delay for ms to show effect FreeRtos delay ms u Clear the LED matrix row by row with ms delay in between for addr in let send array u addr data spi write amp send array unwrap FreeRtos delay ms u ConclusionIn this post an LED dot matrix display simple application was created by configuring and controlling the MAX LED driver This was using the SPI peripheral for the ESPC and the esp idf hal Have any questions Share your thoughts in the comments below If you found this post useful and to keep up to date with similar posts here s the list of channels you can follow subscribe to Follow Me on TwitterSubscribe to NewsletterFollow me on GitHubClick Here for Rust Swag 2023-08-25 07:17:48
海外TECH DEV Community Exciting News: LangChain Now Supports Memgraph! https://dev.to/memgraph/exciting-news-langchain-now-supports-memgraph-4mc8 Exciting News LangChain Now Supports Memgraph We re thrilled to announce a powerful integration between LangChain and Memgraph bringing you an unparalleled natural language interface to your Memgraph database Say goodbye to complex queries and welcome a seamless and intuitive way to interact with your data Memgraph QA chain tutorialIf you ve ever wanted to effortlessly query your Memgraph database using natural language this tutorial is for you This step by step guide will walk you through the process ensuring you have all the tools you need to get started PrerequisitesBefore you dive in make sure you have Docker and Python x installed on your system Get startedLaunch a Memgraph Instance With a few simple commands you can have your Memgraph instance up and running using Docker Just follow our script to set it up Install dependencies We ve got you covered with the required packages Use pip to install langchain openai neoj and gqlalchemy Don t forget the user flag to ensure smooth permissions Code playtime Whether you prefer working within this notebook or want to use a separate Python file the tutorial offers code snippets to guide you through the process What s insideExplore the rich features and functionalities that LangChain and Memgraph offer together API reference We provide an overview of the key components you ll be working with such as ChatOpenAI GraphCypherQAChain and MemgraphGraph Populating the database Learn how to populate your Memgraph database effortlessly using the Cypher query language We guide you through the process of seeding data that serves as the foundation for your work Refresh graph schema Familiarize yourself with refreshing the graph schema a crucial step in setting up the Memgraph LangChain graph for Cypher queries Querying the database Discover how to interact with the OpenAI API and configure your API key We ll show you how to utilize the GraphCypherQAChain to ask questions and receive informative responses Chain modifiers Customize your chain s behavior with modifiers like return direct return intermediate steps and top k Tailor the experience to your preferences Advanced querying Delve into advanced querying techniques and uncover tips for refining your prompts to improve query accuracy Ready to take your data interaction to the next level Join us in exploring the seamless synergy between LangChain and Memgraph No more wrangling with queries just natural language and meaningful insights Simplify complexity elevate your insights and share your projects in our community 2023-08-25 07:06:32
医療系 医療介護 CBnews 新設の「感染症対策部」トップに佐々木昌弘氏-厚労省局長級人事 https://www.cbnews.jp/news/entry/20230825155311 厚生労働省 2023-08-25 16:53:00
金融 JPX マーケットニュース [東証]新規上場の承認(TOKYO PRO-BOND Market):地方公共団体金融機構 総額7.5億米ドルの債券 https://www.jpx.co.jp/news/1070/20230825-51.html tokyoprobondmarket 2023-08-25 16:30:00
金融 ニッセイ基礎研究所 自然災害をカバーする保険の普及にむけた方策の検討(欧州)-EIOPAのスタッフペーパーの公表 https://www.nli-research.co.jp/topics_detail1/id=75914?site=nli 目次ー保険ギャップの解消にむけた検討欧州ー消費者側にある障壁収入、財務状況保険の重要性が認識されていないこと金融リテラシー、保険の知識の欠如自分自身あるいは周りの人の否定的な経験消費者側のリスクの認識の欠如または誤り国の介入に対する高い期待保険の加入プロセスの複雑さの問題ー自然災害保険の一層の普及のための方向性ー今後のスケジュール年月日、欧州保険・企業年金監督機構EIOPAが、自然災害による損害を補償する保険がなぜ普及しないか、どうすれば普及させられるかについての、検討文書を公表した。 2023-08-25 16:23:56
ニュース BBC News - Home 88 UK deaths linked to Canada 'poison seller' https://www.bbc.co.uk/news/world-us-canada-66609884?at_medium=RSS&at_campaign=KARANGA canada 2023-08-25 07:20:22
ニュース BBC News - Home Chandrayaan-3: India releases first video of lunar rover Pragyaan's Moonwalk https://www.bbc.co.uk/news/world-asia-india-66613688?at_medium=RSS&at_campaign=KARANGA pragyaan 2023-08-25 07:11:30
ビジネス ダイヤモンド・オンライン - 新着記事 【独自】セブンがそごう・西武「取締役3人増員」で売却決議強行、労組はスト決行へ - Diamond Premium News https://diamond.jp/articles/-/328285 【独自】セブンがそごう・西武「取締役人増員」で売却決議強行、労組はスト決行へDiamondPremiumNewsセブンアイ・ホールディングスによるそごう・西武売却問題で、セブンアイがそごう・西武の取締役枠を増やし、人を送り込んでいたことがダイヤモンド編集部の取材で分かった。 2023-08-25 16:46:00
ビジネス プレジデントオンライン 6時間睡眠の人は「日本酒を2合飲んで仕事をしている」と同じ…今晩から短時間睡眠をやめるべき理由 - ちゃんと寝ていないから日本人は生産性が低い https://president.jp/articles/-/72974 東京大学 2023-08-25 17:00:00
マーケティング MarkeZine マーケターが「ChatGPT時代のAI」と付き合っていくポイントは?個人/事業視点で議論【視聴無料】 http://markezine.jp/article/detail/43236 chatgpt 2023-08-25 16:15:00
IT 週刊アスキー ディズニーの仲間たちがデザインされた新幹線! JR九州WAKU WAKU SMILE新幹線、運行開始 https://weekly.ascii.jp/elem/000/004/152/4152057/ wakuwakusmile 2023-08-25 16:45:00
IT 週刊アスキー ゲーム『ゆるキャン△』1000万ダウンロード大感謝祭第2弾を開催 https://weekly.ascii.jp/elem/000/004/152/4152153/ enish 2023-08-25 16:45:00
IT 週刊アスキー 熊本県産の栗を使用! チロルチョコから「甘栗チロル」登場 https://weekly.ascii.jp/elem/000/004/152/4152080/ 熊本県産 2023-08-25 16:30:00
IT 週刊アスキー NEC、大規模言語モデルと画像分析により被災状況を把握する技術を開発 https://weekly.ascii.jp/elem/000/004/152/4152146/ 日本電気 2023-08-25 16:45:00
マーケティング AdverTimes 風評被害への対応 過去の施策から振り返る https://www.advertimes.com/20230825/article431497/ 情報提供 2023-08-25 07:52:59
マーケティング AdverTimes 災害情報の入手経路、「地上波民放テレビ」が1位、10年でSNS利用増 https://www.advertimes.com/20230825/article431506/ acrex 2023-08-25 07:39:16
マーケティング AdverTimes 生田斗真と菊池風磨が初共演 P&Gのブランド横断「ジェルボール大感謝祭」 https://www.advertimes.com/20230825/article431477/ pampg 2023-08-25 07:32:53

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)