{"id":15480,"date":"2022-05-20T16:45:00","date_gmt":"2022-05-20T08:45:00","guid":{"rendered":"https:\/\/www.circuspi.com\/?p=15480"},"modified":"2022-05-31T17:15:12","modified_gmt":"2022-05-31T09:15:12","slug":"pixelbit-unit8","status":"publish","type":"post","link":"https:\/\/www.circuspi.com\/index.php\/2022\/05\/20\/pixelbit-unit8\/","title":{"rendered":"Pixel:Bit \u6559\u5b78(\u516b) &#8211; \u4e00\u8d77\u73a9 Dino Game \u5c0f\u6050\u9f8d\u904a\u6232"},"content":{"rendered":"\n<p><style>\n\/* ###\u5be6\u9a57\u4e0b\u4e00\u5217### *\/\n\na:link {color:#0695e4\n;}    \/* \u8a2d\u5b9a\u5c1a\u672a\u9ede\u95b1\u904e\u7684\u9023\u7d50\u6a23\u5f0f *\/\na:visited {color:#0695e4\n;} \/* \u8a2d\u5b9a\u904e\u53bb\u66fe\u7d93\u95b1\u904e\u7684\u9023\u7d50 *\/\na:hover {color:#0695e4\n;}   \/* \u8a2d\u5b9a\u6ed1\u9f20\u6e38\u6a19\u6307\u5728\u9023\u7d50\u4f4d\u7f6e\u4e0a\u7684\u6a23\u5f0f *\/\na:active {color:#0000BB;}  \/* \u8a2d\u5b9a\u4e0a\u9ede\u64ca\u904e\u7684\u9023\u7d50\u6a23\u5f0f *\/\n<\/style><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"526\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/1000x526_8.jpg\" alt=\"\" class=\"wp-image-16148\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u7c21\u4ecb<\/h2>\n\n\n\n<p>\u5f9e\u5f71\u50cf\u8b80\u53d6\u5230\u8fa8\u8b58\uff0c\u524d\u5e7e\u500b\u6559\u5b78\u55ae\u5143\u90fd\u662f\u570d\u7e5e\u5728\u651d\u5f71\u6a5f\u8207\u786c\u9ad4\u7684\u63a7\u5236\u6559\u5b78\u4e0a\u3002\u5176\u5be6\u5728\u4e0d\u85c9\u52a9\u5916\u63a5\u8a2d\u5099\u7684\u60c5\u6cc1\u4e0b\uff0c\u55ae\u9760\u986f\u793a\u87a2\u5e55\u8207\u6309\u9375\u5c31\u80fd\u88fd\u4f5c\u4e0d\u5c11\u5c0f\u5c08\u6848\uff0c\u50cf\u662f\u5229\u7528\u5169\u500b\u6309\u9375\u5373\u53ef\u9078\u5b57\u7684\u7559\u8a00\u677f\uff0c\u6216\u662f\u5275\u4f5c\u4e00\u4e9b\u7c21\u55ae\u7684\u5c0f\u904a\u6232\u3002<\/p>\n\n\n\n<p>\u9019\u500b\u55ae\u5143\u5c31\u8b93\u6211\u5011\u8df3\u812b AIoT \u7684\u61c9\u7528\uff0c\u4ee5\u88fd\u4f5c\u8da3\u5473\u5c0f\u73a9\u5177\u70ba\u76ee\u6a19\u5427\uff01<\/p>\n\n\n\n<p>\u8ac7\u5230\u7c21\u55ae\u53c8\u597d\u73a9\u7684\u5c0f\u904a\u6232\uff0c\u975e <a href=\"https:\/\/chromedino.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Chrome Dino Game<\/a> \u83ab\u5c6c\u4e86\uff0c\u9019\u662f <a href=\"https:\/\/www.google.com\/intl\/zh-TW\/chrome\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Chrome<\/a> \u700f\u89bd\u5668\u5728\u9023\u4e0d\u4e0a\u7db2\u969b\u7db2\u8def\u6642\uff0c\u81ea\u52d5\u89f8\u767c\u7684\u5c0f\u904a\u6232\uff0c\u53ea\u9700\u8981\u7c21\u55ae\u7684\u6309\u4e0b\u7a7a\u767d\u9375\u5c31\u80fd\u66a2\u73a9\uff0c\u904e\u7a0b\u4e2d\u6703\u6709\u4e0d\u5c11\u969c\u7919\uff0c\u901f\u5ea6\u8207\u984f\u8272\u4e5f\u6703\u96a8\u8457\u904a\u73a9\u7684\u5206\u6578\u6539\u8b8a\uff0c\u76f8\u7576\u6709\u8da3\uff0c\u4e0d\u77e5\u9053\u5404\u4f4d\u5925\u4f34\u5011\u6700\u9ad8\u5206\u6578\u7d00\u9304\u662f\u591a\u5c11\u5462\uff1f<\/p>\n\n\n\n<p class=\"has-text-align-center\"><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"167\" src=\"https:\/\/lh5.googleusercontent.com\/yrcfqFRIrl1SWCsJi6nndK-Z80Lv8GwJusxEJGhx6lNBpRuo0BMfm2CiEDfVu9i51tjOs85ECZNUUiqUHv5-u4qCvSct1oeFzRy4WFsS_IlsASpIqxfd3eBU_tKg3QtkHggjY5BfiUpVpWIqeA\"><\/p>\n\n\n\n<p>\u8981\u88fd\u4f5c\u9019\u6a23\u7684\u5c0f\u904a\u6232\u6709\u5e7e\u500b\u9700\u8981\u8003\u616e\u7684\u5143\u7d20\uff0c\u7b2c\u4e00\u500b\u662f\u6211\u5011\u7684\u4e3b\u89d2\u6050\u9f8d\uff0c\u7b2c\u4e8c\u662f\u969c\u7919\u7269\u4ed9\u4eba\u638c\uff0c\u63a5\u8457\u662f\u96a8\u6a5f\u751f\u6210\u7684\u904a\u6232\u80cc\u666f\uff0c\u4ee5\u53ca\u4e0d\u8b93\u756b\u9762\u904e\u65bc\u55ae\u8abf\u7684\u96f2\uff0c\u7e3d\u5171\u56db\u5927\u5143\u7d20\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/02.jpg\" alt=\"\" class=\"wp-image-15482\" width=\"536\" height=\"170\"\/><\/figure><\/div>\n\n\n\n<p>\u57fa\u672c\u4e0a\u9664\u4e86\u5c0f\u6050\u9f8d\u6211\u5011\u53ef\u4ee5\u63a7\u5236\u4e4b\u5916\uff0c\u5176\u4ed6\u5143\u7d20\u4e00\u5f8b\u7531\u7a0b\u5f0f\u81ea\u52d5\u7522\u751f\uff0c\u5c31\u8b93\u6211\u5011\u4f86\u770b\u770b\u5982\u4f55\u88fd\u4f5c\u9019\u500b\u5c0f\u904a\u6232\u5427\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u5716\u6a23\u7522\u751f<\/h2>\n\n\n\n<p>\u4e0d\u8ad6\u662f\u4ed9\u4eba\u638c\u9084\u662f\u6050\u9f8d\uff0c\u90fd\u662f\u7531\u4e00\u500b\u50cf\u7d20\u4e00\u500b\u50cf\u7d20\u62fc\u63a5\u800c\u6210\uff0c\u6211\u5011\u53ef\u4ee5\u7528\u4e00\u4e9b\u81ea\u5df1\u719f\u6089\u7684\u5de5\u5177\uff0c\u8a2d\u8a08\u51fa\u53ef\u4ee5\u653e\u9032\u756b\u9762\u5927\u5c0f\u5167\u7684\u5716\u6a23\u3002\u6700\u7c21\u55ae\u7684\u5c31\u662f Windows \u7684\u5c0f\u756b\u5bb6\uff0c\u900f\u904e\u925b\u7b46\u5de5\u5177\u7e6a\u88fd\u6050\u9f8d\u3001\u4ed9\u4eba\u638c&#8230;&#8230;\u7b49\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/Y7wXu3WFoV37bUVVBjAs_VCOiiuFsp3reJ95ZJjr1ZSfjC6T24RutzkTmR8IUuDolQpHoEQ2Cra2yxrKOFcYctlDz0f3N6fZA080Ejf-FhZ2nKNjKaOm60JamoBlaaKyP5jdE8IJtPJZjLb5EA\" alt=\"\" width=\"550\" height=\"360\"\/><figcaption>\u53ef\u611b\u7684\u5c0f\u6050\u9f8d<\/figcaption><\/figure><\/div>\n\n\n\n<p>\u6211\u5011\u7684\u986f\u793a\u87a2\u5e55\u7a0b\u5f0f\u5eab\u4e26\u6c92\u6709\u8fa6\u6cd5\u76f4\u63a5\u8b80\u53d6\u5716\u7247\u6a94\u6848\uff0c\u9700\u8981\u900f\u904e\u8f49\u63db\u683c\u5f0f\u7684\u5de5\u5177\u4f86\u5354\u52a9\u6211\u5011\u8f49\u63db\u70ba XBM \u6a94\u6848\uff0c\u5982\u4e0b\u5716\u6240\u793a\uff0c\u9019\u662f\u5c0f\u6050\u9f8d\u8f49\u63db\u5f8c\u7684\u5167\u5bb9\uff0c\u53ef\u8b93\u7a0b\u5f0f\u78bc\u76f4\u63a5\u8b80\u53d6\uff0c\u4e26\u986f\u793a\u5728\u87a2\u5e55\u4e0a\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/04.jpg\" alt=\"\" class=\"wp-image-15483\" width=\"678\" height=\"210\"\/><\/figure><\/div>\n\n\n\n<p>\u8f49\u63db\u65b9\u5f0f\u5f88\u7c21\u55ae\uff0c\u8acb\u9ede\u9078<a href=\"https:\/\/www.online-utility.org\/image\/convert\/to\/XBM\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>\u9023\u7d50<\/strong><\/a>\uff0c\u958b\u555f\u514d\u8cbb\u7684\u7dda\u4e0a\u8f49\u63db\u5de5\u5177\u300cConvert Image to XBM\u300d\u3002<a href=\"\"><\/a><\/p>\n\n\n\n<p>\u63a5\u8457\u9ede\u9078\u300c\u700f\u89bd\u300d\u958b\u555f\u525b\u525b\u7e6a\u88fd\u597d\u7684\u5716\u7247\uff0c\u4e26\u6309\u4e0b\u300cConvert and Download\u300d\u4e0b\u8f09\u8f49\u63db\u5f8c\u7684\u6a94\u6848\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"384\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/05-1.jpg\" alt=\"\" class=\"wp-image-15485\"\/><\/figure><\/div>\n\n\n\n<p>\u4f7f\u7528\u6587\u5b57\u7de8\u8f2f\u5668\u6253\u958b\u8f49\u63db\u5f8c\u7684\u6a94\u6848\uff0c\u5982\u4e0b\u5716\u6240\u793a\uff0c\u524d\u5169\u884c\u662f\u6211\u5011\u5716\u6a23\u7684\u9577\u5ea6\u8207\u5bec\u5ea6\u5927\u5c0f\uff0c\u5927\u62ec\u5f27\uff5b\uff5d\u5167\u7684\u8cc7\u6599\u5c31\u662f\u6211\u5011\u5c0f\u6050\u9f8d\u7684\u5716\u6a23\u8cc7\u6599\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"582\" height=\"391\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/06.jpg\" alt=\"\" class=\"wp-image-15486\"\/><\/figure><\/div>\n\n\n\n<p>\u5f8c\u9762\u6211\u5011\u5c07\u6703\u7528\u5230\u9019\u4e9b\u8cc7\u6599\uff0c\u4e26\u586b\u5165\u7a0b\u5f0f\u7576\u4e2d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u6240\u9700\u8a2d\u5099<\/h2>\n\n\n\n<p>1. <a href=\"https:\/\/www.icshop.com.tw\/product-page.php?28659=&amp;utm_source=icshop+front+page&amp;utm_medium=Pixel:Bit+&amp;utm_campaign=purchase_cpc\">pixel:bit<\/a> x1<\/p>\n\n\n\n<p>2. Micro USB to USB Type-A \u6578\u64da\u50b3\u8f38\u7dda x1<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u7bc4\u4f8b\u7a0b\u5f0f\u4e0b\u8f09<\/h2>\n\n\n\n<p>\u82e5\u60a8\u4e4b\u524d\u5df2\u4e0b\u8f09\u904e\u7bc4\u4f8b\u7a0b\u5f0f\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u4e4b\u524d\u4e0b\u8f09\u7684\u8cc7\u6599\u593e\u4e2d\u627e\u5230\u300c05_Dino_Game\u300d\u3002\u5982\u679c\u9084\u6c92\u4e0b\u8f09\uff0c\u8acb\u9ede\u9078<strong><a href=\"https:\/\/github.com\/CIRCUSPi\/PixelBit_Example\" target=\"_blank\" rel=\"noreferrer noopener\">\u9023\u7d50<\/a><\/strong>\uff0c\u9032\u5230\u7db2\u9801\u770b\u5230\u300cCode\u300d\u6309\u9215\uff0c\u9ede\u9078\u5f8c\u9078\u64c7\u300cDownload ZIP\u300d\u5c31\u80fd\u5c07\u6a94\u6848\u6574\u500b\u4e0b\u8f09\u4e0b\u4f86\u3002<\/p>\n\n\n\n<p>\u89e3\u58d3\u7e2e\u5f8c\uff0c\u9019\u500b\u55ae\u5143\u7684\u7bc4\u4f8b\u7a0b\u5f0f\uff0c\u5c31\u653e\u5728\u8cc7\u6599\u593e\u540d\u7a31\u70ba\u300c05_Dino_Game\u300d\u88e1\u9762\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u7a0b\u5f0f\u89e3\u6790<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u725b\u5200\u5c0f\u8a66<\/h3>\n\n\n\n<p>\u6211\u5011\u5148\u5f9e\u6700\u7c21\u55ae\u7684\u986f\u793a\u958b\u59cb\uff0c\u8acb\u958b\u555f\u540d\u7a31\u70ba\u300cPixelBit_Image_Show\u300d\u7684\u8cc7\u6599\u593e\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/UQ749VYQGeAFKA8nEkD2EyF_mirCeq9Tjv7BLLNdVAcc8pN3dQbyxFQgNFdm1n5MFB7NFMo3UcFa3A-zPXUa96VkvRanNPUDPV0Es-VZ-1WwTiUev15Bg__0h6EC7JyIxcYeE7CWMY-CG52ZYA\" alt=\"\" width=\"588\" height=\"215\"\/><\/figure><\/div>\n\n\n\n<p>\u6253\u958b\u88e1\u9762\u7684\u7a0b\u5f0f\uff0c\u5b8c\u6574\u7a0b\u5f0f\u5982\u4e0b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/08.jpg\" alt=\"\" class=\"wp-image-15487\" width=\"504\" height=\"671\"\/><\/figure><\/div>\n\n\n\n<p>\u8207\u4e4b\u524d\u7684\u986f\u793a\u7a0b\u5f0f\u6700\u5927\u7684\u4e0d\u540c\uff0c\u5c31\u662f\u65b0\u52a0\u5165\u4e86\u300cSprite\u300d\u529f\u80fd\uff0cSprite \u529f\u80fd\u5c31\u50cf\u662f\u4e00\u500b\u53ef\u4ee5\u81ea\u7531\u8a2d\u5b9a\u5927\u5c0f\u7684\u7368\u7acb\u756b\u5e03\uff0c\u60a8\u53ef\u4ee5\u628a\u5716\u5f62\u7e6a\u88fd\u5230\u9019\u500b\u7368\u7acb\u7684\u756b\u5e03\u4e0a\uff0c\u4e26\u4e14\u53ef\u4ee5\u540c\u6642\u64c1\u6709\u591a\u500b Sprite\uff0c\u65b9\u4fbf\u7ba1\u7406\u3002\u6700\u5927\u512a\u9ede\u662fSprite \u4e4b\u9593\u53ef\u4ee5\u91cd\u758a\uff0c\u4f8b\u5982\u5728\u80cc\u666f\u5b58\u5728\u7684\u60c5\u6cc1\u4e0b\uff0c\u6211\u5011\u53ef\u4ee5\u5efa\u7f6e\u6050\u9f8d\u7684 Sprite \u8207\u4ed9\u4eba\u638c\u7684 Sprite\uff0c\u4e26\u5c07\u5b83\u5011\u50cf\u8cbc\u8cbc\u7d19\u4e00\u6a23\u9ecf\u5728\u80cc\u666f\u4e0a\u3002<\/p>\n\n\n\n<p>\u7a0b\u5f0f\u78bc\u4e2d\u7684\u7b2c\u4e09\u884c\uff0c\u6211\u5011\u5efa\u7acb\u4e86\u4e00\u500b\u9810\u5099\u4f7f\u7528 Sprite \u7684\u7269\u4ef6\u300cimg\u300d\uff0c\u63a5\u8457\u6211\u5011\u5c07\u525b\u525b\u5716\u7247\u8f49\u63db\u6210\u7684\u8cc7\u6599\u653e\u5728\u300cPROGMEM unsigned char dino[]\u300d\u88e1\u9762\u3002<\/p>\n\n\n\n<p>\u5728\u300csetup()\u300d\u5340\u584a\u7684\u90e8\u4efd\uff0c\u900f\u904e\u300ccreateSprite(33, 35)\u300d\u5275\u5efa\u4e86\u4e00\u500b\u5927\u5c0f\u8207\u6050\u9f8d\u5716\u7247\u4e00\u6a23\u7684 Sprite\uff0c\u63a5\u8457\u7531\u300cdrawXBitmap(0, 0, dino, 33, 35, TFT_BLACK, TFT_WHITE)\u300d\u5c07\u6050\u9f8d\u7e6a\u88fd\u4e0a\u53bb\uff0c\u62ec\u5f27\u5167\u524d\u5169\u500b\u53c3\u6578\u8868\u793a\u7e6a\u88fd\u7684\u8d77\u59cb\u5ea7\u6a19\uff0c\u63a5\u8457\u662f\u5716\u6a94\u3001\u5716\u6a94\u5927\u5c0f\u3001\u8207\u986f\u793a\u8272\u5f69\u548c\u80cc\u666f\u8272\u5f69\u3002<\/p>\n\n\n\n<p>\u6700\u5f8c\u7531\u300cpushSprite(105, 104)\u300d\u8a2d\u5b9a\u597d\u8981\u986f\u793a\u5728\u87a2\u5e55\u7684\u5ea7\u6a19\u4f4d\u5b50\u5f8c\uff0c\u5716\u7247\u5c31\u6703\u51fa\u73fe\u5728\u87a2\u5e55\u4e0a\u4e86\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/09.jpg\" alt=\"\" class=\"wp-image-15488\" width=\"408\" height=\"373\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2. ATmega328p \u7684\u7a0b\u5f0f<\/h3>\n\n\n\n<p>\u904a\u6232\u57f7\u884c\u7684\u904e\u7a0b\u53ea\u6709\u55ae\u7d14\u7684\u6309\u9215\u8f38\u5165\u8207\u87a2\u5e55\u986f\u793a\uff0c\u87a2\u5e55\u7684\u90e8\u4efd\u6b78 ESP32 \u8ca0\u8cac\uff0cATmega328p \u53ea\u6709\u8ca0\u8cac\u6309\u9215\u7684\u90e8\u4efd\u3002\u8070\u660e\u7684\u5927\u5bb6\u61c9\u8a72\u731c\u7684\u5230\uff0c\u4e0d\u5c31\u662f\u55ae\u7d14\u8b80\u53d6\u6309\u9215\u662f\u5426\u6709\u6309\u4e0b\uff0c\u7136\u5f8c\u518d\u767c\u9001\u8a0a\u606f\u901a\u77e5 ESP32 \u9019\u9ebc\u7c21\u55ae\u55ce\uff1f\u6c92\u932f\uff01<\/p>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u4f9d\u7167\u300c<a href=\"https:\/\/www.circuspi.com\/index.php\/2022\/04\/27\/pixelbit-unit2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Pixel:Bit \u6559\u5b78(\u4e8c)<\/a>\u300d\u7684\u505a\u6cd5\u81ea\u5df1\u64b0\u5beb\u9019\u500b\u7a0b\u5f0f\uff0c\u60f3\u8981\u6311\u6230\u7684\u670b\u53cb\u53ef\u4ee5\u81ea\u5df1\u8a2d\u8a08\u770b\u770b\u3002\u70ba\u4e86\u80fd\u8207\u5f85\u6703\u7684 ESP32 \u7a0b\u5f0f\u6e9d\u901a\uff0c\u60a8\u9700\u8981\u8a2d\u8a08\u6309\u9215 A \u8207\u6309\u9215 B\uff0c\u5206\u5225\u6309\u4e0b\u8207\u653e\u958b\u7684\u6307\u4ee4\uff0c\u5982\u4e0b\u8868\u6240\u793a\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/10-1.jpg\" alt=\"\" class=\"wp-image-15489\" width=\"491\" height=\"166\"\/><\/figure><\/div>\n\n\n\n<p>\u53ea\u8981\u671d\u9019\u500b\u65b9\u5411\u8a2d\u8a08\uff0c\u5c31\u80fd\u76f4\u63a5\u63a5\u8ecc\u5f85\u6703\u7684 ESP32 \u7a0b\u5f0f\u3002\u7bc4\u4f8b\u7a0b\u5f0f\u9019\u908a\u7d66\u51fa\u4e0d\u4e00\u6a23\u7684\u601d\u8def\u7d66\u5927\u5bb6\u53c3\u8003\uff0c\u73fe\u5728\u8acb\u958b\u555f\u540d\u7a31\u70ba\u300cPixelBit_Dino_Game_328p\u300d\u7684\u8cc7\u6599\u593e\uff0c\u4e26\u6253\u958b\u7a0b\u5f0f\u3002<\/p>\n\n\n\n<p>\u7a0b\u5f0f\u6709\u4e3b\u7a0b\u5f0f\u300cPixelBit_Dino_Game_328p.ino\u300d\u8207\u526f\u7a0b\u5f0f\u300cconfig.h\u300d\uff0c\u526f\u7a0b\u5f0f config.h \u662f\u7528\u65bc\u8a2d\u5b9a\u53c3\u6578\u8207\u5c0d\u7167\u8868\uff0c\u985e\u4f3c\u5c07\u4e00\u4e9b\u8f03\u650f\u9577\u7684\u6307\u4ee4\u8207\u8b8a\u6578\u5b9a\u7fa9\u5168\u90e8\u96c6\u5408\u5728\u9019\u88e1\uff0c\u518d\u7531\u7a0b\u5f0f\u532f\u5165\u526f\u7a0b\u5f0f\u9019\u500b\u6a94\u6848\uff0c\u53d6\u7528\u88e1\u9762\u7684\u5167\u5bb9\u3002<\/p>\n\n\n\n<p>\u4e3b\u7a0b\u5f0f\u5247\u662f\u5c07\u4e00\u4e9b\u5e38\u7528\u7684\u529f\u80fd\u6216\u662f\u81ea\u5b9a\u7fa9\u7684\u529f\u80fd\u5168\u5beb\u5728\u88e1\u9762\uff0c\u9664\u4e86\u9019\u500b\u55ae\u5143\u6703\u7528\u4e0a\u7684\u6309\u9215 A\uff08\u5de6\u908a\u6309\u9215\uff09\u53ca\u6309\u9215 B\uff08\u53f3\u908a\u6309\u9215\uff09\u4e4b\u5916\uff0c\u4e5f\u5c07\u4e0a\u500b\u55ae\u5143\u7684\u9059\u63a7\u8eca\u63a7\u5236\u99ac\u9054\u7684\u529f\u80fd\uff0c\u4e00\u4f75\u653e\u5728\u9019\u88e1\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/11-1.jpg\" alt=\"\" class=\"wp-image-15490\" width=\"595\" height=\"379\"\/><\/figure><\/div>\n\n\n\n<p>\u4e3b\u7a0b\u5f0f\u770b\u4f3c\u8907\u96dc\uff0c\u4f46\u4ed4\u7d30\u7814\u8b80\u6703\u767c\u73fe\uff0c\u9019\u6a23\u7cfb\u7d71\u5316\u7684\u505a\u6cd5\u53ef\u8b93\u5f80\u5f8c\u64f4\u5145\u66f4\u4fbf\u5229\uff0c\u7a0b\u5f0f\u78bc\u4e5f\u8f03\u6574\u9f4a\u3002<\/p>\n\n\n\n<p>\u4e0a\u8ff0\u7d66\u5927\u5bb6\u505a\u53c3\u8003\uff0c\u540c\u6642\u9f13\u52f5\u5927\u5bb6\u53ef\u4ee5\u7528\u81ea\u5df1\u7406\u89e3\u7684\u65b9\u5f0f\u5beb\u5beb\u770b\u3002\u4e0d\u8ad6\u60a8\u662f\u81ea\u5df1\u64b0\u5beb\uff0c\u9084\u662f\u76f4\u63a5\u53d6\u7528\u7bc4\u4f8b\u7a0b\u5f0f\uff0c\u90fd\u4e0d\u8981\u5fd8\u8a18\u5c07\u7a0b\u5f0f\u5148\u71d2\u9304\u5230 ATmega328p \u5167\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. ESP32 \u7684\u7a0b\u5f0f<\/h3>\n\n\n\n<p>\u6bd4\u8d77 ATmega328p\uff0cESP32 \u9019\u908a\u7684\u7a0b\u5f0f\u5c31\u8907\u96dc\u8a31\u591a\uff0c\u96d6\u8aaa\u662f\u986f\u793a\u800c\u5df2\uff0c\u4f46\u986f\u793a\u904a\u6232\u5167\u5bb9\u9084\u662f\u6bd4\u55ae\u7d14\u7684\u6587\u5b57\u548c\u5716\u5f62\u8907\u96dc\u7684\u591a\u3002\u8acb\u958b\u555f\u540d\u7a31\u70ba\u300cPixelBit_Dino_Game_esp32.ino\u300d\u7684\u8cc7\u6599\u593e\uff0c\u4e26\u6253\u958b\u7a0b\u5f0f\u3002<\/p>\n\n\n\n<p>\u7a0b\u5f0f\u7531\u4e94\u500b\u90e8\u4efd\u7d44\u6210\uff0c\u5206\u5225\u662f\u4e3b\u7a0b\u5f0f\u8207\u5176\u4ed6\u56db\u500b\u526f\u7a0b\u5f0f\uff0c\u300cconfig.h\u300d\u9019\u500b\u526f\u7a0b\u5f0f\u8207 ATmega328p \u90a3\u908a\u7684\u529f\u7528\u76f8\u540c\uff0c\u90fd\u662f\u7528\u4f86\u5b58\u653e\u4e00\u4e9b\u8a2d\u5b9a\u7684\u53c3\u6578\u8207\u5c0d\u61c9\u7684\u8b8a\u6578\u3002\u5176\u9918\u4e09\u500b\u526f\u7a0b\u5f0f\u90fd\u662f\u7528\u4f86\u5b58\u653e\u5716\u6a94\uff0c\u300cnoInternet.h\u300d\u5b58\u653e\u7684\u662f\u904a\u6232\u958b\u59cb\u756b\u9762\uff0c\u5b8c\u7f8e\u5448\u73fe\u6c92\u6709\u7db2\u8def\u7684\u7121\u5948\u756b\u9762\u3002\u300cgameover.h\u300d\u5b58\u653e\u7684\u662f\u5c0f\u6050\u9f8d\u649e\u5230\u969c\u7919\u7269\u6642\uff0c\u7d50\u675f\u904a\u6232\u7684\u756b\u9762\u3002<\/p>\n\n\n\n<p>\u300cimgData.h\u300d\u5247\u5206\u5225\u5b58\u653e\u5c0f\u6050\u9f8d\uff08\u4e09\u500b\u756b\u9762\uff09\u3001\u96f2\u6735\uff08\u4e00\u500b\u756b\u9762\uff09\u3001\u8def\u9762\u51f8\u8d77\u5c0f\u571f\u4e18\uff08\u5169\u500b\u756b\u9762\uff09\u8207\u969c\u7919\u7269\uff08\u5169\u500b\u756b\u9762\uff09\u3002\u6709\u4e9b\u9805\u76ee\u6703\u6709\u591a\u500b\u756b\u9762\u662f\u70ba\u4e86\u589e\u52a0\u8c50\u5bcc\u6027\uff0c\u4f8b\u5982\u6050\u9f8d\u5728\u79fb\u52d5\u6642\u6703\u9700\u8981\u591a\u500b\u756b\u9762\u4ea4\u53c9\u986f\u793a\uff0c\u9019\u6a23\u770b\u8d77\u4f86\u624d\u6703\u50cf\u8dd1\u52d5\u7684\u6a23\u5b50\u3002<\/p>\n\n\n\n<p>\u4e86\u89e3\u5176\u9918\u526f\u7a0b\u5f0f\u7684\u529f\u80fd\u5f8c\uff0c\u8b93\u6211\u5011\u56de\u4f86\u770b\u4e3b\u7a0b\u5f0f\uff0c\u9996\u5148\u8207\u525b\u525b\u725b\u5200\u5c0f\u8a66\u88e1\u4ecb\u7d39\u7684\u4e00\u6a23\uff0c\u6211\u5011\u9700\u8981\u5275\u9020\u5e7e\u500b\u300cSprite\u300d\u4f86\u653e\u7f6e\u5716\u5f62\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/34ehUlspvZ6nIbgZXj31_wYSNKqgUMhHjhKGicAu1zIdGeJFwud8PRG9_oZOvfalr3uttIhueTZf07vh_wdktX7UtWsvonhgMjvZnYkXVFLPQ6zJaEnglvGbnz9ckUZRJOcoteZLv8JuNOJrpw\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u300cimg\u300d\u7528\u4f86\u653e\u7f6e\u80cc\u666f\u7684\u5143\u7d20\uff0c\u300cimg2\u300d\u5c08\u9580\u653e\u7f6e\u5c0f\u6050\u9f8d\uff0c\u300ce\u300d\u3001\u300ce2\u300d\u5247\u662f\u5206\u5225\u653e\u7f6e\u5169\u7a2e\u4e0d\u540c\u9020\u578b\u7684\u969c\u7919\u7269\u3002<\/p>\n\n\n\n<p>\u8b80\u53d6\u5f9e ATmega328p \u9001\u904e\u4f86\u7684\u6309\u9215\u8cc7\u8a0a\u90e8\u4efd\u5c31\u4e0d\u89e3\u91cb\u4e86\uff0c\u638c\u7ba1\u5716\u5f62\u986f\u793a\u8207\u8b8a\u5316\u6700\u95dc\u9375\u7684\u7a0b\u5f0f\u662f\u5716\u4e2d\u7684\u300cdrawS()\u300d\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/6qnBLKu2P8xynQY-ZrVtPS4H33BGIUFl3g_rQUEDOrpzniVPo9BvxU24C8P38Ql2f9EklfwZaL5i-I0xMYLf7pLbpjtF_rV5KMgPBKJQ_qWHbHkCdh3pz3_Vc3vc_SAT0W52tt4Vrmte226Ftw\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u300cdrawS()\u300d\u8ca0\u8cac\u8655\u7406\u80cc\u666f\u7684\u7dda\u689d\u8207\u96a8\u6a5f\u653e\u7f6e\u5c0f\u571f\u4e18\u3001\u96f2\u6735\u548c\u969c\u7919\u7269\uff0c\u5c0f\u6050\u9f8d\u6703\u4f9d\u7167\u6309\u4e0b\u6309\u9215\u800c\u6709\u8df3\u8d77\u548c\u843d\u4e0b\u7684\u52d5\u756b\uff0c\u6c92\u6309\u6309\u9215\u6642\u6703\u6709\u8dd1\u52d5\u7684\u52d5\u756b\u3002<\/p>\n\n\n\n<p>\u53e6\u4e00\u500b\u91cd\u8981\u7684\u7a0b\u5f0f\u662f\u300ccheckColision()\u300d\uff0c\u7528\u4f86\u78ba\u8a8d\u5c0f\u6050\u9f8d\u6709\u6c92\u6709\u649e\u4e0a\u969c\u7919\u7269\uff0c\u6709\u7684\u8a71\u6703\u505c\u6b62\u904a\u6232\u4e26\u986f\u793a\u300c\u904a\u6232\u7d50\u675f\u756b\u9762\u300d\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/31NL_u0SPrCPWeRUZ1BlDg3qc75x9GxSFnft8rYy2QYGz2FHVkk300b-N4nGw5RvKf-gmOMHb7qm-mBWjixWSHGmktfzVwlbshOcRRhxesq0ZfFhizvIpdsUdSN_x2ATVt7AzWqnJtGvNXsiwQ\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u5728\u300cloop()\u300d\u88e1\u904b\u884c\u7684\u5b8c\u6574\u6d41\u7a0b\uff0c\u7b2c\u4e00\u6b65\u5148\u78ba\u8a8d\u662f\u5426\u6709\u6536\u5230\u5f9e ATmega328p \u50b3\u9001\u904e\u4f86\u7684\u6309\u9215\u8a0a\u606f\uff0c\u7b2c\u4e8c\u6b65\u5247\u662f\u4f9d\u7167\u6309\u9215\u72c0\u614b\u8abf\u6574\u5c0f\u6050\u9f8d\u7684\u52d5\u4f5c\uff0c\u770b\u662f\u8981\u7e7c\u7e8c\u8dd1\u52d5\u9084\u662f\u8df3\u8d77\u8207\u843d\u4e0b\u3002\u63a5\u8457\u7d71\u4e00\u986f\u793a\u6240\u6709\u5716\u50cf\uff0c\u96f2\u6735\u3001\u969c\u7919\u7269\u548c\u80cc\u666f&#8230;&#8230;\u7b49\uff0c\u6700\u5f8c\u78ba\u8a8d\u5c0f\u6050\u9f8d\u6709\u6c92\u6709\u649e\u4e0a\u969c\u7919\u7269\u3002\u8b93\u6211\u5011\u5c07\u7a0b\u5f0f\u71d2\u9304\u5230 ESP32 \u88e1\u9762\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u5be6\u969b\u64cd\u4f5c\u5c55\u793a<\/h3>\n\n\n\n<p>\u73fe\u5728\u5c31\u8b93\u6211\u5011\u958b\u59cb\u73a9\u904a\u6232\u5427\uff01<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"403\" height=\"251\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/2-3.gif\" alt=\"\" class=\"wp-image-15491\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u7d50\u8ad6<\/h2>\n\n\n\n<p>\u9019\u500b\u55ae\u5143\u6559\u4e86\u5927\u5bb6\u9664\u4e86\u5f71\u50cf\u8fa8\u8b58\u5916\u7684\u8da3\u5473\u5c08\u6848\uff0c\u6211\u5011\u5b8c\u6210\u4e86\u5728 <a href=\"https:\/\/www.icshop.com.tw\/product-page.php?28659=&amp;utm_source=icshop+front+page&amp;utm_medium=Pixel:Bit+&amp;utm_campaign=purchase_cpc\" target=\"_blank\" rel=\"noreferrer noopener\">Pixel:bit<\/a> \u904b\u884c Chrome Dino Game\u3002\u50cf\u9019\u6a23\u7c21\u55ae\u7684\u5c0f\u904a\u6232\uff0c\u5176\u5be6\u9084\u6709\u5f88\u591a\u7a2e\uff0c\u53ea\u8981\u662f\u80fd\u55ae\u9760\u5169\u9846\u6309\u9215\u64cd\u4f5c\u7684\u904a\u6232\uff0c\u60a8\u90fd\u80fd\u900f\u904e\u81ea\u5df1\u7684\u60f3\u50cf\u529b\u8207\u7a0b\u5f0f\u78bc\u5c07\u9019\u4e9b\u904a\u6232\u79fb\u5230 <a href=\"https:\/\/www.icshop.com.tw\/product-page.php?28659=&amp;utm_source=icshop+front+page&amp;utm_medium=Pixel:Bit+&amp;utm_campaign=purchase_cpc\" target=\"_blank\" rel=\"noreferrer noopener\">Pixel:bit<\/a> \u4e0a\u9762\uff0c\u9084\u4e0d\u8d95\u7dca\u88fd\u4f5c\u5c6c\u65bc\u81ea\u5df1\u7684\u904a\u6232\u8ddf\u670b\u53cb\u5011\u5206\u4eab\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pixel:Bit \u6559\u5b78(\u516b) \u8981\u6559\u5927\u5bb6\u4f7f\u7528 Pixel:Bit \u88fd\u4f5c Chrome Dino Game \u5c0f\u6050\u9f8d\u904a\u6232\uff0c\u5f9e\u5716\u6a23\u7e6a\u88fd\u5230 ESP32 \u8207 ATmega 328P \u7684\u8a73\u7d30\u7a0b\u5f0f\u78bc\u89e3\u6790\uff0c\u5c07\u4e00\u6b65\u6b65\u5e36\u5404\u4f4d\u4e00\u8d77\u64cd\u4f5c\u3002<\/p>\n","protected":false},"author":1,"featured_media":16149,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[274,238],"tags":[42,36,27,33],"table_tags":[],"_links":{"self":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/15480"}],"collection":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/comments?post=15480"}],"version-history":[{"count":9,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/15480\/revisions"}],"predecessor-version":[{"id":16150,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/15480\/revisions\/16150"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/media\/16149"}],"wp:attachment":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/media?parent=15480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/categories?post=15480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/tags?post=15480"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/table_tags?post=15480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}