diff --git a/Sketch1.sln b/Sketch1.sln new file mode 100644 index 0000000..f69df0f --- /dev/null +++ b/Sketch1.sln @@ -0,0 +1,51 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33403.182 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sketch1", "Sketch1\Sketch1.vcxproj", "{0F671470-CEDB-40C1-B964-A0B3FFEEDADB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|ARM.ActiveCfg = Debug|ARM + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|ARM.Build.0 = Debug|ARM + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|ARM.Deploy.0 = Debug|ARM + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|ARM64.Build.0 = Debug|ARM64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|x64.ActiveCfg = Debug|x64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|x64.Build.0 = Debug|x64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|x64.Deploy.0 = Debug|x64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|x86.ActiveCfg = Debug|x86 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|x86.Build.0 = Debug|x86 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Debug|x86.Deploy.0 = Debug|x86 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|ARM.ActiveCfg = Release|ARM + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|ARM.Build.0 = Release|ARM + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|ARM.Deploy.0 = Release|ARM + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|ARM64.ActiveCfg = Release|ARM64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|ARM64.Build.0 = Release|ARM64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|ARM64.Deploy.0 = Release|ARM64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|x64.ActiveCfg = Release|x64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|x64.Build.0 = Release|x64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|x64.Deploy.0 = Release|x64 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|x86.ActiveCfg = Release|x86 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|x86.Build.0 = Release|x86 + {0F671470-CEDB-40C1-B964-A0B3FFEEDADB}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {CB5D74CF-5CF6-4388-B197-0876E3D10979} + EndGlobalSection +EndGlobal diff --git a/Sketch1/Sketch1.ino b/Sketch1/Sketch1.ino new file mode 100644 index 0000000..716038c --- /dev/null +++ b/Sketch1/Sketch1.ino @@ -0,0 +1,69 @@ +/* + Name: Sketch1.ino + Created: 2023/4/24 23:27:55 + Author: qw200 +*/ + +// the setup function runs once when you press reset or power the board +#include +#include +#include +#include +#include +#include + + +Adafruit_SH1106G display = Adafruit_SH1106G(128, 64, &Wire); + +Adafruit_AHTX0 aht; + +void setup() { + Serial.begin(115200); + //while (!Serial); + + Serial.println("128x64 OLED FeatherWing test"); + display.begin(0x3C, true); // Address 0x3C default + + Serial.println("OLED begun"); + + // Show image buffer on the display hardware. + // Since the buffer is intialized with an Adafruit splashscreen + // internally, this will display the splashscreen. + display.display(); + delay(3000); + + // Clear the buffer. + display.clearDisplay(); + display.display(); + + display.setRotation(0); + display.setFont(&FreeSans9pt7b); + if (aht.begin()) { + Serial.println("Found AHT20"); + } + else { + Serial.println("Didn't find AHT20"); + } + + display.setTextSize(1); + display.setTextColor(SH110X_WHITE); +} + +void loop() { + display.clearDisplay(); + sensors_event_t humidity, temp; + + aht.getEvent(&humidity, &temp);// populate temp and humidity objects with fresh data + display.setCursor(0, 20); + display.print("AHT20 Demo"); + display.setCursor(0, 40); + display.print("Temp: "); display.print(temp.temperature); display.println(" C"); + display.setCursor(0, 60); + display.print("Hum: "); display.print(humidity.relative_humidity); display.println(" %"); + Serial.print("Temperature: "); Serial.print(temp.temperature); Serial.println(" degrees C"); + Serial.print("Pressure: "); Serial.print(humidity.relative_humidity); Serial.println(" RH %"); + + yield(); + display.display(); + delay(100); +} \ No newline at end of file diff --git a/Sketch1/Sketch1.vcxproj b/Sketch1/Sketch1.vcxproj new file mode 100644 index 0000000..678e3b9 --- /dev/null +++ b/Sketch1/Sketch1.vcxproj @@ -0,0 +1,128 @@ + + + + + Debug + ARM + + + Release + ARM + + + Debug + ARM64 + + + Release + ARM64 + + + Debug + x86 + + + Release + x86 + + + Debug + x64 + + + Release + x64 + + + + {0f671470-cedb-40c1-b964-a0b3ffeedadb} + Linux + Sketch1 + YANG-SSD + 15.0 + Linux + 1.0 + Generic + {D51BCBC9-82E9-4017-911E-C93873C4EA2B} + + + + + true + + + false + + + true + + + false + + + true + + + false + + + false + + + true + + + + + + c:\visualmicro\ignore + c:\visualmicro\pi-ignore + Arduino + + + + CppCode + true + + + + + + + + + + + + + + VisualMicroDebugger + + + $(ProjectDir)..\..\..\..\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\SPI;$(ProjectDir)..\..\..\..\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\Wire;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_GFX_Library;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_BusIO;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_SH110X;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_AHTX0;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_Unified_Sensor;$(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.6.3\tools\sdk\include;$(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.6.3\tools\sdk\lwip2\include;$(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.6.3\tools\sdk\libc\xtensa-lx106-elf\include;$(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.6.3\\cores\\esp8266;$(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.6.3\\variants\\nodemcu;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include\c++\4.8.2;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include\c++\4.8.2\xtensa-lx106-elf;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include\c++\4.8.2\backward;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\lib\gcc\xtensa-lx106-elf\4.8.2\include;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\lib\gcc\xtensa-lx106-elf\4.8.2\include-fixed;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include;$(ProjectDir)..\..\..\..\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\SPI;$(ProjectDir)..\..\..\..\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\Wire;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_GFX_Library;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_SH110X;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_AHTX0 + $(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\2.5.0-4-b40a506\bin\xtensa-lx106-elf-g++ + $(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\2.5.0-4-b40a506\bin\xtensa-lx106-elf-g++ + false + + + + $(ProjectDir)..\..\..\..\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\SPI;$(ProjectDir)..\..\..\..\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\Wire;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_GFX_Library;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_BusIO;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_SH110X;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_AHTX0;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_Unified_Sensor;$(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.6.3\tools\sdk\include;$(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.6.3\tools\sdk\lwip2\include;$(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.6.3\tools\sdk\libc\xtensa-lx106-elf\include;$(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.6.3\\cores\\esp8266;$(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.6.3\\variants\\nodemcu;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include\c++\4.8.2;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include\c++\4.8.2\xtensa-lx106-elf;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include\c++\4.8.2\backward;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\lib\gcc\xtensa-lx106-elf\4.8.2\include;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\lib\gcc\xtensa-lx106-elf\4.8.2\include-fixed;$(ProjectDir)..\..\..\..\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506\xtensa-lx106-elf\include;$(ProjectDir)..\..\..\..\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\SPI;$(ProjectDir)..\..\..\..\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\Wire;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_GFX_Library;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_SH110X;$(ProjectDir)..\..\..\Arduino\libraries\Adafruit_AHTX0;%(AdditionalIncludeDirectories) + $(ProjectDir)..\..\..\..\..\..\\Users\\qw200\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\2.5.0-4-b40a506\bin\xtensa-lx106-elf-g++ + gnu++11 + gnu99 + + + $(ProjectDir)..\..\..\..\..\..\program files\microsoft visual studio\2022\community\common7\ide\extensions\0axxbbxm.vxj\Micro Platforms\default\vm-intelli-pre.h;$(ProjectDir)..\..\..\..\AppData\Local\Temp\VMBuilds\Sketch1\esp8266_nodemcuv2\Debug\.vmintelli\b91c0b48da4ef9e80fe045021dc04f36\vm-intelli-gcc-defines.h;$(ProjectDir)..\..\..\..\..\..\program files\microsoft visual studio\2022\community\common7\ide\extensions\0axxbbxm.vxj\Micro Platforms\default\vm-intelli-post.h;$(ProjectDir)__vm\.Sketch1.vsarduino.h;%(ForcedIncludeFiles) + true + true + _VMICRO_INTELLISENSE;__ESP8266_esp8266__;__ESP8266_ESP8266__;_VMDEBUG=1;__ets__;ICACHE_FLASH;NONOSDK22x_190703=1;F_CPU=80000000L;LWIP_OPEN_SRC;TCP_MSS=536;LWIP_FEATURES=1;LWIP_IPV6=0;ARDUINO=108010;ARDUINO_ESP8266_NODEMCU;ARDUINO_ARCH_ESP8266;ARDUINO_BOARD=ESP8266_NODEMCU;LED_BUILTIN=2;FLASHMODE_DIO;ESP8266;%(PreprocessorDefinitions) + + + + + + + + + + \ No newline at end of file diff --git a/Sketch1/Sketch1.vcxproj.filters b/Sketch1/Sketch1.vcxproj.filters new file mode 100644 index 0000000..5802a89 --- /dev/null +++ b/Sketch1/Sketch1.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + xml;json;txt;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Misc Files + + + + + + + + Header Files + + + \ No newline at end of file diff --git a/Sketch1/__vm/.Sketch1.vsarduino.h b/Sketch1/__vm/.Sketch1.vsarduino.h new file mode 100644 index 0000000..e024f07 --- /dev/null +++ b/Sketch1/__vm/.Sketch1.vsarduino.h @@ -0,0 +1,20 @@ +/* + Editor: https://www.visualmicro.com/ + This file is for intellisense purpose only. + Visual micro (and the arduino ide) ignore this code during compilation. This code is automatically maintained by visualmicro, manual changes to this file will be overwritten + The contents of the _vm sub folder can be deleted prior to publishing a project + All non-arduino files created by visual micro and all visual studio project or solution files can be freely deleted and are not required to compile a sketch (do not delete your own code!). + Note: debugger breakpoints are stored in '.sln' or '.asln' files, knowledge of last uploaded breakpoints is stored in the upload.vmps.xml file. Both files are required to continue a previous debug session without needing to compile and upload again + + Hardware: NodeMCU 1.0 (ESP-12E Module) (esp8266_nodemcuv2), Platform=esp8266, Package=esp8266 +*/ + +#if defined(_VMICRO_INTELLISENSE) + +#ifndef _VSARDUINO_H_ +#define _VSARDUINO_H_ +#include +#include +#include "..\Sketch1.ino" +#endif +#endif diff --git a/Sketch1/__vm/Compile.vmps.xml b/Sketch1/__vm/Compile.vmps.xml new file mode 100644 index 0000000..143eb51 --- /dev/null +++ b/Sketch1/__vm/Compile.vmps.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + 45 Serial.println("Didn't find AHT20"); +46 } +47 +48 display.setTextSize(1); +49 display.setTextColor(SH110X_WHITE); +50 } +51 +-->52 void loop() { +53 display.clearDisplay(); +54 sensors_event_t humidity, temp; +55 +56 aht.getEvent(&humidity, &temp);// populate temp and humidity objects with fresh data +57 display.setCursor(0, 20); +58 display.print("AHT20 Demo"); +59 display.setCursor(0, 40); +60 display.print("Temp: "); display.print(temp.temperature); display.println(" C"); +61 display.setCursor(0, 60); + + + + + + + + \ No newline at end of file diff --git a/Sketch1/__vm/Configuration.Debug.vmps.xml b/Sketch1/__vm/Configuration.Debug.vmps.xml new file mode 100644 index 0000000..46d21ef --- /dev/null +++ b/Sketch1/__vm/Configuration.Debug.vmps.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Sketch1/src/arduino folders read me.txt b/Sketch1/src/arduino folders read me.txt new file mode 100644 index 0000000..71714e3 --- /dev/null +++ b/Sketch1/src/arduino folders read me.txt @@ -0,0 +1,14 @@ +##################################################### + Arduino How To: Use sub folders for source code + http://www.visualmicro.com/ +##################################################### + +* .INO code can exist in the project folder and '\src' folder. +* .Cpp/.c/.S/.h etc. can exist in the project folder, the '\src' folder and in any folder(s) below the '\src' folder. +* .Cpp/.c/.S/.h sources in shared code projects should follow the same folder rules (because they are merged with the project sources into a temporary build folder prior to compile). + +* Use the 'Show All Files' icon above the 'Solution Explorer' to switch between 'included project files' and 'physical files/folders'. +* Source code in the project folder will always be compiled regardless of inclusion in the project. This functionality can be disabled in Global Options. + + +