Jump to content
Electronics-Lab.com Community

MENG XI

Members
  • Content Count

    51
  • Joined

  • Last visited

1 Follower

About MENG XI

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Have you wondered how many WiFi are there in your surroundings? What are they? Any free network I might connect to? Using MicroPython on Realtek Ameba RTL8722DM, you can do it in just 1 line of Python code, here is how, Materials Ameba x 1 Steps WiFi Scan function can help us quickly discover what WiFi networks are available in our surrounding. This example does not require any additional hardware, thus simply copy, and paste the following code into REPL to see its effect. #The long version from wireless import WLAN
  2. For an IoT development board, the tricky part is connecting to other wireless devices, for example wifi router or bluetooth sensor, now with MicroPython, you can connect to any wifi device with only few line of code typed in real time, no compilation is needed! Check out how ameba RTL8722DM does that as follows, Materials Ameba x 1 Steps Ameba can connect to WiFi access point with open security or WPA2 security type, which is the most common security type used in household wireless routers. Here we are going to connect to a WiFi access point using code bel
  3. Take a look of UART communication with Ameba RTL8722 which runs MicroPython Materials Ameba x 1, TTL USB to Serial module x 1 Steps UART is a very versatile communication protocol and almost an essential part of a microcontroller. A TTL USB to Serial module is an IC that helps to translate UART signal to USB signal so that we can see uart log printed on our PC. This module is often found
  4. Time is very useful when come to medium size project that requires periodical triggering of certain task over time, here we are going to show you how ot program Ameba RTL8722 dual-band wifi and BLE microcontrollers, Materials Ameba x 1 Steps There are 3 sets of general timers available to user, each at 32KHz, they are timer 1/2/3. Here we use timer 1 as example to demonstrate how a periodical timer works. Copy and paste the first 3 lines of code into REPL to see its effect. from machine import Timer t = Timer(1) # Use Ti
  5. SPI is a highly important peripheral for microcontroller as it allows for high speed communication over short range, here is how we use python to send msg to another microcontroller over SPI 材料准备 Ameba x 1, Arduino UNO x 1 范例说明 SPI是一种快速且强大的通讯协议,并通常在微处理器中被用来接受传感器的数据或输出图像讯号。在这个示例中将示范ameba如何透过MicroPython以从属模式接收数据。 在通讯连接建立之前,需要先将以下代码烧录到Arduino UNO。 rtc = RTC() /////////////////////// // SPI Master Write // /////////////////////// #include
  6. RTC helps to reveal the real time to the machine thus it's critical to some applications. Using MicroPython on Ameba RTL8722, we can get RTC time in just 2 lines, here is how, Materials Ameba x 1 Steps RTC module help microcontroller to keep track of time and is essential to our time module. Here we an example to demonstrate how to get local time and update the time. Copy and paste the following code line by line into REPL to see its effect. rtc = RTC() rtc.datetime() # get date and time
  7. PWM is one of the crucial peripheral of an MCU, with MicroPython, you can control RTL8722DM to output PWM signal to fade and brighten an LED with ease, here is how, Materials Ameba x 1, LED x 1, Resistor(220ohm) x 1 Steps PWM use pulse width modulation to control output duty cycle and is widely used to control LED brightness and motor. Here we are using an LED to demonstrate how PWM works. Let us connect pin PA_26 to the anode leg of an LED which in series with a current limiting resistor and GND to cathode of the LED as shown below, Then,
  8. Today is the Chinese Lantern Festival, which is a big festival in Chinese speaking community and also it marks the end of the month-long Chinese New Year celebration, let's see a short clip of Ameba driving e-ink display and playing music https://youtu.be/0uOHViIgqj8
  9. Sometimes we need to exchange some data with another microconrtoller in close range, then we can use I2C for this job, even better, with MicroPython, we can do it in less than 5 lines of code, here is how it's done on ameba RTL8722 from Realtek, Materials Ameba x 1, Arduino UNO x 1 Steps I2C is a very common module on microcontrollers, it only takes 2 wire and able to achieve data rate at up t
  10. Controlling LED has never been easier with MicroPython on Ameba RTL8722 WiFi and BLE microcontroller, today I am gonna show you just how to blink an LED in 3 different ways! Materials Ameba x 1, LED x 1, Resistor(220ohm) x 1 Steps Blink is one of the best examples to get started with MicroPython. Let us connect pin PB_22 to the anode leg of an LED which in series with a current limiting resistor and GND to cathode of the LED as shown below, Then, copy the following code and press Ctrl + e in REPL to enter the paste mode (for more informatio
  11. Introduction Arduino IDE is a convenient tool to write your code and upload to microcontrollers. However, it doesn’t come with debugger function, which means the only way to debug our program is through using debug message through standard output, in this case, Serial Monitor. Debug message is handy and it helps to print out the information the registers holds at a specific time, but once you have done debugging and your program is ready to go, we often have to delete/comment out those debug message code manually, in a big project, this could be problematic as there are just too manny
  12. With a BLE5.0 & Dual-band WiFi microcontroller, you will never have to worry about re-compiling the code just to change the WiFi ssid and password. Ameba RTL8722 is a BLE5.0 and dual-band WiFi (2.4G & 5G) Iinternet-of-Things (IoT) developing platform that suit the need for many IoT application scenarios. Taking advantge of its BLE + WiFi combination, we can easily change Ameba's WiFi setting and save us great deal of time. Take a look at the short video below to learn more https://youtu.be/TA4A-VXbImo
  13. RTL8722 from Realtek supports MicroPython and reading ADC values using Python script in 3 lines, here is an example ADC read potentiometer: • Materials: Ameba x 1, potentiomete x 1 • Steps: Here we connect ameba to a potentiometer to measure its analogue value, the connection is as follows. Copy and paste the following code into REPL. from machine import ADC a = ADC(0) a.read()
  14. What if you wanna measure something yet you don't have a handy tool, worry not, we can build a super handy measuring tool that can measure up to 4 meters in 10 mins! Follow the vidoe tutorial below and start making your own futuristic ruler in 10 mins! Ruler 2077 Tutorial Video
×
  • Create New...