首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 简单的代码,使用MSP430 LaunchPad随机数显示2553

简单的代码,使用MSP430 LaunchPad随机数显示2553

  • 资源大小:4.84 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: 代码 简单 使用 显示 随机数

资 源 简 介

I am an EECS Major at the University of California - Davis, this is my first attempt at a randomizing circuit. It is not very pretty with all the wires going everywhere, but it gets the job done. Pressing the reset button restarts the program, begins the "spinning" of the lights. Pressing the button (P1.3) Interrupts the spinning and pulls out a random number that is then displayed on the board. The method I decided to use to choose a "random" number is a little weak. The main loop that spins the lights counts the number of rotations 1-50, I used a bitwise modulus function to look at the last digit in the counter for the result of the "random" behavior. for example, if you interrupt the spinning 36th loop, your number will be 6. This could have been done more accurately using 2 timers, 1 timer as an input to another timer.. this is talked about in one of the tech documents. for the scope of this project, however, I chose not to delve tha
VIP VIP
0.176900s