327x Filetype PDF File size 2.01 MB Source: www.mouser.com
.NET C# for IoT and Robotics
.NET C# developers who code phones and PCs can as well code circuits
and robotics. This guide goes hand-in-hand with GHI Electronics’
SITCore Experimenter Kit as a step-by-step instructional tutorial.
Copyright © 2021 GHI Electronics, LLC
www.GHIElectronics.com
By: Gus Issa
IoT and Robotics for the C# Software Developer
TABLE OF CONTENTS
Introduction ................................................................................................................................................................... 5
Prerequisite ............................................................................................................................................................... 5
SITCore Experimenter Kit ............................................................................................................................................... 6
SITCore FEZ Bit ........................................................................................................................................................... 6
BrainBot ..................................................................................................................................................................... 8
BrainClip..................................................................................................................................................................... 9
TinyCLR OS ................................................................................................................................................................... 11
SITCore ......................................................................................................................................................................... 12
Getting Started ............................................................................................................................................................ 13
Firmware Update ..................................................................................................................................................... 13
Slow Clock Option .................................................................................................................................................... 13
Boot-up Options ...................................................................................................................................................... 14
Visual Studio Setup .................................................................................................................................................. 15
Blinky ....................................................................................................................................................................... 15
Top Level Statements .............................................................................................................................................. 17
Debugging ................................................................................................................................................................ 17
Digital Pins ................................................................................................................................................................... 18
Digital Outputs ......................................................................................................................................................... 18
Digital Inputs ............................................................................................................................................................ 20
Digital Input Events .................................................................................................................................................. 24
PWM ............................................................................................................................................................................ 27
Energy Levels ........................................................................................................................................................... 27
Sounds ..................................................................................................................................................................... 28
Software PWM ......................................................................................................................................................... 30
Servo Motors ........................................................................................................................................................... 30
Analog Input & Output ................................................................................................................................................ 33
Analog Inputs (ADC) ................................................................................................................................................. 33
Analog Outputs (DAC) .............................................................................................................................................. 37
Serial Interfaces ........................................................................................................................................................... 38
UART ........................................................................................................................................................................ 38
Events .................................................................................................................................................................. 39
RS232 & RS485 .................................................................................................................................................... 40
Terminal Software ............................................................................................................................................... 41
Page 2 of 103 Copyright © 2021 GHI Electronics, LLC
IoT and Robotics for the C# Software Developer
SPI ............................................................................................................................................................................ 42
I2C ............................................................................................................................................................................ 44
CAN .......................................................................................................................................................................... 46
Digital Signals ............................................................................................................................................................... 48
Addressable LEDs ..................................................................................................................................................... 48
Ultrasonic Sensor ..................................................................................................................................................... 51
IR Remote Control ................................................................................................................................................... 53
Loading Resources ....................................................................................................................................................... 56
Displays ........................................................................................................................................................................ 58
Basic Graphics .......................................................................................................................................................... 58
Native Graphics........................................................................................................................................................ 60
Images...................................................................................................................................................................... 61
Fonts ........................................................................................................................................................................ 62
Artificial Intelligence .................................................................................................................................................... 63
Networking .................................................................................................................................................................. 66
WiFi Setup ................................................................................................................................................................ 66
Sockets ..................................................................................................................................................................... 68
UDP ...................................................................................................................................................................... 68
TCP....................................................................................................................................................................... 70
HTTP ......................................................................................................................................................................... 71
Telnet ....................................................................................................................................................................... 74
TLS ............................................................................................................................................................................ 76
MQTT ....................................................................................................................................................................... 77
Cloud Services .............................................................................................................................................................. 78
Adafruit IO ............................................................................................................................................................... 78
Microsoft Azure ....................................................................................................................................................... 80
Other Cloud Services ............................................................................................................................................... 83
Cryptography ............................................................................................................................................................... 84
XTEA ......................................................................................................................................................................... 84
RSA ........................................................................................................................................................................... 84
File System ................................................................................................................................................................... 86
SD Cards ................................................................................................................................................................... 86
USB Mass Storage .................................................................................................................................................... 87
File System Considerations ...................................................................................................................................... 88
Time Services ............................................................................................................................................................... 89
Page 3 of 103 Copyright © 2021 GHI Electronics, LLC
IoT and Robotics for the C# Software Developer
Real Time Clock ........................................................................................................................................................ 89
Timers ...................................................................................................................................................................... 91
USB Client .................................................................................................................................................................... 92
USB Host ...................................................................................................................................................................... 94
Securing IoT ................................................................................................................................................................. 97
Secure Storage ......................................................................................................................................................... 97
IP Protection ............................................................................................................................................................ 98
Data Security ............................................................................................................................................................ 98
Thinking Small .............................................................................................................................................................. 99
Memory Utilization .................................................................................................................................................. 99
Object Allocation ..................................................................................................................................................... 99
FEZ Bit Reference ....................................................................................................................................................... 100
BrainBot Reference .................................................................................................................................................... 101
Assembly ................................................................................................................................................................ 101
Pinout .................................................................................................................................................................... 101
BrainClip Reference ................................................................................................................................................... 102
Digital Modules ...................................................................................................................................................... 102
Analog Modules ..................................................................................................................................................... 102
PWM Modules ....................................................................................................................................................... 102
Special Digital Signals ............................................................................................................................................. 102
What’s Next? ............................................................................................................................................................. 103
Page 4 of 103 Copyright © 2021 GHI Electronics, LLC
no reviews yet
Please Login to review.