1763 views|4 replies

1w

Posts

25

Resources
The OP
 

[SAMR21 New Gameplay] 4. The First Graphical Programming Example [Copy link]

 
This post was last edited by dcexpert on 2019-10-3 12:56

Traditionally, people learn coding languages by printing hello world, and the development board programs all start with flashing lights, so our graphical programming will also start with flashing lights.

First check the schematic diagram of the SAM R21 development board and find out that the pin corresponding to the LED is PA19.

And PA19 in feather-m0-express corresponds to D12.


First, find the digital write pin module in the PINS category of the MakeCode graphical interface, and drag and drop it into the programming interface. Then find the pause module in the LOOPS category.

Then drag and drop these two modules into the forever module, and they will change from gray to red and green, indicating that the modules can run.

Click A0 in the digital write pin module and select D12 from the drop-down interface.

Right-click the digital write pin module and select the first option Duplicate to copy the existing module.

Change the output of the second digital write pin module to HIGH. This completes the flashing light program.


This content is originally created by dcexpert, a user of EEWORLD forum. If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source

Latest reply

nmg
  Details Published on 2019-10-4 09:19
 
 

1w

Posts

25

Resources
2
 

Click the Download button in the lower left corner and a file with the suffix UF2 will be downloaded.

Copy this file to the FEATHERBOOT disk, and the program will run automatically after the copy is complete.

 
 
 

1w

Posts

25

Resources
3
 

If you modify the program, you can click the Download button again to download the new program.

After the program is downloaded (copied) to SAM R21, it will automatically start running and enter the running mode, and the FEATHERBOOT disk will disappear. If you need to enter the download mode again, you can press the RESET button of the development board, the development board will re-enter the download mode, and the FEATHERBOOT disk will be displayed again.

 
 
 

5217

Posts

239

Resources
4
 

Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
 
 
 

1w

Posts

25

Resources
5
 

Graphical programming, different uses

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list