ESP8266 开发环境搭建(二)NONOS

安信可 SDK 一体化开发环境(IDE1.5)+ESP8266 NONOS SDK V3.0

按官方指导文章搭建 https://blog.csdn.net/Boantong_/article/details/106229281

IDE

安信可 SDK 一体化开发环境(IDE1.5) 下载地址:https://docs.ai-thinker.com/%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B72

SDK

无操作系统开发(简称 NONOS SDK) https://gitee.com/xuhongv/ESP8266_NONOS_SDK

git clone https://gitee.com/xuhongv/ESP8266_NONOS_SDK

配置环境

手动删除SDK根目录下的driver_lib和 third_party这2个文件夹

import –>C/C++ ,选择 Existing Code as MakeFile Project 工程;
选择SDK文件夹路径;去掉对应的 C++ 勾勾;选择Cross Gcc分支;

编译的工程放在SDK路径下;在 Properties –> C/C++ Build –> Build directory 选择该工程;

编译

Properties –> C/C++ Build –> Build commandmake添加编译规则,例如:

COMPILE=gcc BOOT=new APP=1 SPI_SPEED=40 SPI_MODE=DIO SPI_SIZE_MAP=6

clean Project

Build Project

烧录

使用官方烧录工具,安信可出的 nodemcu 模块

《智能硬件项目教程——基于ESP32》学习

全国青少年机器人技术等级考试五、六级指定教材

第1章 初识ESP32 11.09完成

第2章 数码管计时器 11.15完成

第3章 点阵动画 11.23完成

第4章 串行通信——UART 11.25完成

第5章 串行通信——I²C和SPI 11.26完成

第6章 WiFi联网和Web服务器 11.27完成

第7章 步进电机

第8章 蓝牙迷宫智能小车

器件实验:舵机

Arduino例程,环境: Arduino学习平台搭建配置方式(一)

Micro Servo 9g舵机 SG90

#include <Servo.h>
int potPin = A0;
int motorPin = 12;
int val;
Servo myServo;

void setup() {
  // put your setup code here, to run once:

  myServo.attach(motorPin);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  val = analogRead(potPin);
  val = map(val, 0, 1023, 180, 0);
  myServo.write(val);
  Serial.println(val);
  delay(20);
}

Arduino实践:呼吸灯

Arduino例程,环境: Arduino学习平台搭建配置方式(一)

const int potPin = A0;
const int LEDpin = 10;
int potValue = 0;
int brightness = 0;
int fadeAmount = 5;
void setup() {
  // put your setup code here, to run once:
  pinMode(potPin, INPUT);
  pinMode(LEDpin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  potValue = analogRead(potPin);
  Serial.println(potValue);
  potValue = potValue / 10;
  //第一种呼吸灯
  //  for (int i = 0; i <= 200; i += fadeAmount) {
  //    analogWrite(LEDpin, i);
  //    delay(potValue);
  //  }
  //  for (int i = 200; i >= 0; i -= fadeAmount) {
  //    analogWrite(LEDpin, i);
  //    delay(potValue);
  //  }
  //第二种呼吸灯
  analogWrite(LEDpin, brightness);
  delay(potValue);
  brightness += fadeAmount;
  if (brightness >= 200 || brightness <= 0) {
    fadeAmount = -fadeAmount;
  }
}

Arduino实践:人行横道按键控制红绿灯

Arduino例程,环境: Arduino学习平台搭建配置方式(一)

//模拟路口按键控制人行横道红绿灯
int redLEDPin = 6;
int greenLEDPin = 9;
int redLED2Pin = 10;
int greenLED2Pin = 13;
int buzzerPin = 15;//外接无源蜂鸣器
int switchPin = 2;
int switchValue = 1;

void setup() {
  // put your setup code here, to run once:
  pinMode(redLEDPin, OUTPUT);
  pinMode(greenLEDPin, OUTPUT);
  pinMode(redLED2Pin, OUTPUT);
  pinMode(greenLED2Pin, OUTPUT);
  pinMode(buzzerPin, OUTPUT);
  pinMode(switchPin, INPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  switchValue = digitalRead(switchPin);
  //Serial.print("switchValue=");
  //Serial.println(switchValue);
  if (switchValue == LOW) {
    digitalWrite(greenLEDPin, HIGH);
    digitalWrite(redLEDPin, LOW);
    digitalWrite(redLED2Pin, HIGH);
    digitalWrite(greenLED2Pin, LOW);
  }
  else {
    //按下按键,主道红绿灯变黄变红,人行横道红绿灯变绿
    digitalWrite(greenLEDPin, HIGH);
    digitalWrite(redLEDPin, HIGH);
    delay(1000);
    digitalWrite(greenLEDPin, LOW);
    digitalWrite(redLED2Pin, LOW);
    digitalWrite(greenLED2Pin, HIGH);
    delay(5000);
    //人行横道红绿灯提示尽快通过
    for (int i = 0; i < 10; i++) {
      digitalWrite(greenLED2Pin, HIGH);
      alarm();
      digitalWrite(greenLED2Pin, LOW);
      alarm();
    }
  }
}
//蜂鸣器
void alarm() {
  for (int i = 0; i < 50; i++) {
    digitalWrite(buzzerPin, HIGH);
    delay(1);
    digitalWrite(buzzerPin, LOW);
    delay(1);
  }
}

Arduino实践:LED Blinking 流水灯

Arduino例程,环境: Arduino学习平台搭建配置方式(一)

  const int blueLED = 5;
  const int redLED = 6;
  const int greenLED = 9;
  int delayTime = 1000;
  int lightTime = 500;
  int brightness = 30;

void setup() {
  // put your setup code here, to run once:

  pinMode(redLED, OUTPUT);
  pinMode(blueLED, OUTPUT);
  pinMode(greenLED, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:

  //蓝色LED 亮灭
  digitalWrite(blueLED, HIGH);
  delay(lightTime);
  digitalWrite(blueLED, LOW);
  delay(delayTime);

  //红色LED 亮灭
  digitalWrite(redLED, HIGH);
  delay(lightTime);
  digitalWrite(redLED, LOW);
  delay(delayTime);

  //绿色LED 亮灭
  digitalWrite(greenLED, HIGH);
  delay(lightTime);
  digitalWrite(greenLED, LOW);
  delay(delayTime);

  //蓝色LED 亮灭
  analogWrite(blueLED, brightness);
  delay(lightTime);
  analogWrite(blueLED, LOW);
  delay(delayTime);


  //红色LED 亮灭
  analogWrite(redLED, brightness);
  delay(lightTime);
  analogWrite(redLED, LOW);
  delay(delayTime);

  //绿色LED 亮灭
  analogWrite(greenLED, brightness);
  delay(lightTime);
  analogWrite(greenLED, LOW);
  delay(delayTime);
  
}

《智能硬件项目教程——基于Arduino(第二版)》学习

全国青少年机器人技术等级考试三四级指定教材

第1章 走进智能殿堂 10.24完成

第2章 炫彩流水灯 10.25完成 Arduino实践:LED Blinking 流水灯

第3章 智能红绿灯 10.25完成 Arduino实践:人行横道按键控制红绿灯

第4章 呼吸灯 10.26完成 Arduino实践:呼吸灯

第5章 迎宾机器人

第6章 红外遥控调速小风扇

课中项目设计

第7章 搭建智能小车

第8章 红外遥控智能小车

第9章 反馈型智能跟随小车

第10章 利用差分技术的智能小车

结业项目设计——疯狂迷宫

青少年机器人技术等级考试

考试标准等下载 http://www.kpcb.org.cn/h-col-127.html

  1. 一级、二级
    1.1 教材
    1.2 要求
  2. 三级、四级
    2.1 教材
    2.2 软件及编程语言

1. 一级、二级

1.1 教材

《机器人基础技术教学》

1.2 要求

使用符合要求的器材即可。

2. 三级、四级

2.1 教材

《智能硬件项目教程 ——基于Arduino (第二版)》

2.2 软件及编程语言

青少年机器人等级考试3-4级软件及编程语言说明

2.2.1 系统平台:Windows7 以上操作系统

2.2.2 三级、四级编程语言、软件及考试所需库

(一)编程语言

三级:图形化编程,建议采用 Mixly 软件,推荐采用 Mixly0.999。

四级:统一采用 Arduino C 代码编程,编程软件推荐采用 1.8.9 版本。建议采用 Mixly 软件内所配备的 Arduino IDE 版本即可,不需另行下载。考试过程中,考生不得参考或拷贝图形化软件生成的代码,一经发现,实操考试成绩为 0 分。

(二)考试所用软件库

三级:对编程模块的使用不做具体要求。

四级:如采用 Mixly 软件所配备的 Ardunio IDE,版本内的库已经满足考试需要。如采用其它方式安装 Arduino IDE,相关的库可从中国电子学会科普网站下载。实操编程时,直流电机驱动、超声波传感器的代码采用 Arduino C 代码编写,不得使用库调用,如采用,该部分对应的得分为 0 分。

(三)软件下载

中国电子学会科普网站链接:
http://www.kpcb.org.cn/h-nd-288.html

MakeCode | micro:bit 教程学习记录

来自 https://makecode.microbit.org/

Tutorials

Flashing Heart

Name Tag

Smiley Buttons

Dice

Love Meter

Micro Chat

Tutorials for the new micro:bit (V2)

Pet Hamster

Countdown

Morse Chat

Clap Lights

Blow Away

Cat Napping

Games

Rock Paper Scissors

Rock Paper Scissors V2

Coin Flipper

7 seconds

Hot Potato

Heads Guess!

Reaction Time

Tug-Of-LED

Magic Button Trick

Snap the dot

Salute!

Karel the LED

Crashy bird

Radio Games

Multi Editors

Multi Dice

Mood Radio

Tele-potato

Fireflies

Hot or Cold

Red Light Green Light

Voting Machine

Rock Paper Scissors Teams

Micro:Coin

Infection

Best Friends

Fashion

Duct Tape Wallet

Watch

Step counter

Duct Tape Watch

Name badge

Music

Hack Your Headphones

Banana Keyboard

Guitar

Jonny’s Bird

Electric Guitar

Toys

Inchworm

Milk Carton Robot

Robot Unicorn

Ticklebot

Octobot

Two Player Maze

Milky Monster

Railway Crossing

Kitronik RC Car Hack

Rotary Dial Radio

Science

Timing Gates

Soil Moisture

Plant Watering

States of Matter

Tools

Stopwatch

Level

Compass

Plot Acceleration

Light Level Meter

Analog Pin Tester

Servo Calibrator

Radio Bridge

Turtle

Square

Spiral

Scanner

Blocks to JavaScript

Hello JavaScript

Starter Blocks

Writing Code

Complex Conditionals

Conditional Loops

Command Responder

Writing Functions

Courses

Intro to CS Online

Intro to CS Classroom

Science Experiments

Cyber Arcade: Programming and Making with micro:bit

Learn All About micro:bit

Coding and Innovation

First Steps

Make it: code it

Networking with the micro:bit

SparkFun Videos

Logic Lab

CodeJoy Remote Robotics

Blocks to JavaScript

SparkFun Inventor’s Kit

Kitronik Inventor Kit

micro:bit of Things

A-Z Robotics

Jacdac

Getting started

Button smasher

Slider Sound Bender

Light Sound Bender

Rotary Sound Bender

Sound LED

Magnetic Sound Bender

Coding Cards

Make a Digital Balance

Make a Digital Dice

Make a Trundle Wheel

Nervous

Reaction

Shake the Bottle

Sprite Based Games

Zen