GIGABYTE GA-B250M-DS3H LGA1151 Intel Micro ATX DDR4 Motherboard
https://www.amazon.in/gp/product/B01N2WG23X/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1
Intel G4560 7th Genenration Pentium Dual Core Processor
GIGABYTE GA-B250M-DS3H LGA1151 Intel Micro ATX DDR4 Motherboard
https://www.amazon.in/gp/product/B01N2WG23X/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1
Intel G4560 7th Genenration Pentium Dual Core Processor
| # parameters | |
| P = 10 | |
| A = 28 | |
| B = 8.0/3.0 | |
| dt = 0.01 | |
| # initial conditions | |
| x = 1.0 | |
| y = 1.0 | |
| z = 1.0 | |
| self.scale = 5 |
| void Conway64::update() | |
| { | |
| // From my book Python Playground | |
| // https://www.nostarch.com/pythonplayground | |
| // copy grid since we require 8 neighbors for calculation | |
| // and we go line by line | |
| BitBuf88 _newGrid = _grid; | |
| uint8_t N = 8; | |
| // compute 8-neighbour sum |
| void Conway64::signal() | |
| { | |
| osSignalSet (_conwayTaskHandle, 0x0001); | |
| } |
| // The Conway Task function | |
| void conwayTaskFunc(void const * arg) | |
| { | |
| // The Joy of C++ | |
| Conway64* conway = const_cast<Conway64*>(static_cast<const Conway64*>(arg)); | |
| // enable for testing only | |
| //conway->testInit(); | |
| // add a glider object |
| // initialize | |
| void Conway64::init() | |
| { | |
| // set up display | |
| _max7219->power(true); | |
| _max7219->setIntensity(5); | |
| _max7219->setScanLimit(7); | |
| _max7219->clear(); | |
| // create Conway task |
| class Conway64 { | |
| public: | |
| Conway64(SPI_HandleTypeDef* hSPI); | |
| virtual ~Conway64(); | |
| // initialize | |
| void init(); | |
| // add glider with top left cell at (i, j) | |
| void addGlider(int i, int j); |
| // send 16 bit data packet | |
| void MAX7219::sendPacket(MAX7129_REG reg, uint8_t data) | |
| { | |
| // CS | |
| HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_RESET); | |
| //uint16_t packet = (reg << 8) | data; | |
| uint8_t packet[2]; | |
| packet[0] = reg; | |
| packet[1] = data; |
| struct BitBuf88 | |
| { | |
| // constr | |
| BitBuf88() { | |
| clearAll(); | |
| } | |
| // destr | |
| virtual ~BitBuf88() {} | |
| // set (i, j) |
| /* StartDefaultTask function */ | |
| void StartDefaultTask(void const * argument) | |
| { | |
| /* USER CODE BEGIN 5 */ | |
| /* Infinite loop */ | |
| for(;;) | |
| { | |
| HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin); | |
| osDelay(250); | |
| HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin); |