<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      秋·風

        博客園 :: 首頁 :: 博問 :: 閃存 :: 新隨筆 :: 聯系 :: 訂閱 訂閱 :: 管理 ::
      昨天在tb買了1個st7789 240X240的1.3寸顯示屏,今天終于調通:
      先看顯示效果:


      注意:
      拿到顯示屏后測試一直不顯示,檢查了很久,發現要用spi1才能正常顯示,還有,根據顯示屏SPI的接法修改到相應的腳:

      BL = 13
      DC = 8
      RST = 12
      MOSI = 11
      SCK = 10
      CS = 9

       

      program spi_st7789;
      {$MODE OBJFPC}
      {$H+}
      {$MEMORY 20000,20000}
      uses
        pico_spi_c,
        st7789_spi_c,
        CustomDisplay,
        pico_gpio_c,
        pico_timer_c,
        pico_c,
        pico_adc_c,
      
        Images.Paw,
        Fonts.BitstreamVeraSansMono13x24;
      
      var
        spi  : TSPI_Registers absolute SPI1_BASE;
        st7789 : Tst7789_SPI;
        milliVolts,milliCelsius : longWord;
        strValue : string;
      
      begin
        gpio_init(TPicoPin.LED);
        gpio_set_dir(TPicoPin.LED,TGPIODirection.GPIO_OUT);
      
        adc_init;
        adc_gpio_init(TPicoPin.ADC0);
        adc_set_temp_sensor_enabled(true);
        strValue := '';
      
        spi_init(spi,20000000);
        gpio_set_function(TPicoPin.GP9,  TGPIOFunction.GPIO_FUNC_SPI);
        gpio_set_function(TPicoPin.GP10, TGPIOFunction.GPIO_FUNC_SPI);
        gpio_set_function(TPicoPin.GP11,  TGPIOFunction.GPIO_FUNC_SPI);
        //gpio_set_function(TPicoPin.SPI_CS,  TGPIOFunction.GPIO_FUNC_SPI);
        //gpio_set_function(TPicoPin.SPI_SCK, TGPIOFunction.GPIO_FUNC_SPI);
        //gpio_set_function(TPicoPin.SPI_TX,  TGPIOFunction.GPIO_FUNC_SPI);
      
        st7789.Initialize(spi,TPicoPin.GP8,TPicoPin.GP12,st7789.ScreenSize240x240x16);
        st7789.setFontInfo(BitstreamVeraSansMono13x24);
      
        repeat
          gpio_put(TPicoPin.LED,true);
      
          //adc_select_input(0);
          // Avoiding floating point math as it currently seems to be in no good shape (on Cortex-M0, not only pico)
          //milliVolts := (adc_read * 3300) div 4096;
      
           //Select internal temperature sensor
          adc_select_input(4);
          milliVolts := (adc_read * 3300) div 4096;
          str(milliVolts,strValue);
      
          st7789.ForegroundColor := clWhite;
          st7789.BackgroundColor := clRed;
          st7789.SetRotation(TDisplayRotation.None);
          st7789.ClearScreen;
          st7789.drawText('temperature:'+strValue,2,2);
          //st7789.drawText('Red',2,2);
          st7789.drawRect(0,0,st7789.ScreenWidth,st7789.ScreenHeight);
          st7789.drawCircle(st7789.ScreenWidth div 2,st7789.ScreenHeight div 2,25);
          busy_wait_us_32(1500000);
      
          gpio_put(TPicoPin.LED,false);
          st7789.ForegroundColor := clWhite;
          st7789.BackgroundColor := clLime;
          st7789.SetRotation(TDisplayRotation.Right);
          st7789.ClearScreen;
          st7789.drawText('Lime',2,2);
          st7789.drawRect(0,0,st7789.ScreenWidth,st7789.ScreenHeight);
          st7789.FillCircle(st7789.ScreenWidth div 2,st7789.ScreenHeight div 2,25);
          busy_wait_us_32(1500000);
      
          gpio_put(TPicoPin.LED,true);
          st7789.ForegroundColor := clWhite;
          st7789.BackgroundColor := clBlue;
          st7789.SetRotation(TDisplayRotation.UpsideDown);
          st7789.ClearScreen;
          st7789.drawText('Blue',5,5);
          st7789.drawRoundRect(0,0,st7789.ScreenWidth,st7789.ScreenHeight,15);
          st7789.drawLine(25,25,st7789.ScreenWidth-25,st7789.ScreenHeight-25);
          st7789.drawLine(25,st7789.ScreenHeight-25,st7789.ScreenWidth-25,25);
          busy_wait_us_32(1500000);
      
          gpio_put(TPicoPin.LED,false);
          st7789.ForegroundColor := clBlack;
          st7789.BackgroundColor := clWhite;
          st7789.SetRotation(TDisplayRotation.Left);
          st7789.ClearScreen;
          st7789.drawText('Hello',2,2,clBlack);
          st7789.drawText('FreePascal',2,st7789.ScreenHeight-2-st7789.FontInfo.Height,clBlack);
          st7789.drawImage(st7789.ScreenWidth div 2 - 32, st7789.ScreenHeight div 2 - 32,paw64x64x4);
          busy_wait_us_32(1500000);
        until 1=0;
      end.

       

      posted on 2025-07-18 16:16  秋·風  閱讀(125)  評論(1)    收藏  舉報
      主站蜘蛛池模板: 加勒比无码人妻东京热| 福利一区二区在线视频| 亚洲国模精品一区二区| 国产亚洲精品VA片在线播放| 377P欧洲日本亚洲大胆| 久久精品国产福利一区二区| 亚洲av免费看一区二区| 91久久性奴调教国产免费| 天天看片视频免费观看| 性无码一区二区三区在线观看| 国产初高中生粉嫩无套第一次| 伊人精品成人久久综合| 麻豆麻豆麻豆麻豆麻豆麻豆 | 日韩69永久免费视频| 国产精品一区二区三区专区| 中文字幕国产在线精品| 免费一区二三区三区蜜桃| 忘忧草在线社区www中国中文| 亚洲欧美日韩愉拍自拍美利坚| 人妻换着玩又刺激又爽| 午夜激情福利一区二区| 亚洲一线二线三线品牌精华液久久久| 无码熟妇αⅴ人妻又粗又大| 久久日韩精品一区二区五区| 亚洲av成人一区在线| 亚洲精品日韩中文字幕| 欧洲精品码一区二区三区| 亚洲中文字幕第一页在线| 国产成人精品久久一区二区| 免费国产又色又爽又黄的网站| 国产日女人视频在线观看| 色偷偷www.8888在线观看| 亚洲综合精品第一页| 成人动漫综合网| 色噜噜狠狠色综合成人网| 国产精品天堂蜜av在线播放| 国产偷国产偷亚洲清高网站| 日韩高清在线亚洲专区国产| 亚洲精品日韩精品久久| 粗大挺进朋友人妻淑娟| 免费十八禁一区二区三区|