This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygame, time, math | |
| # white background | |
| background_colour = (255,255,255) | |
| (width, height) = (1000, 500) | |
| screen = pygame.display.set_mode((width, height)) | |
| pygame.display.set_caption('Pendulum') | |
| screen.fill(background_colour) | |
| # rod length, meters | |
| L = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## reads the CSV files generated by the Zurich Instruments MLIA impedance analyser | |
| mag_index = 14 | |
| phase_index = 11 | |
| freq_index = 7 | |
| x_index = 20 | |
| y_index = 23 | |
| #### USER DEFINED VARIABLES #### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "stm32f4xx.h" // Device header | |
| // Constants | |
| const int hall_counts_per_rot = 23; // number of counts per one wheel rotation | |
| const float wheel_diameter = 0.4;// 0.662; //meters | |
| const float pi = 3.1412; // pi | |
| const float cir = pi * wheel_diameter; // circumfrenece of the wheel | |
| const float mps_mph = 2.23694; // m/s to m/h conversion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Initialise Some Addresses ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| pwm_out EQU P1.7 ;; PWM Output Set To MSB | |
| lcd_cmd EQU 0800h ;; Write COMMAND reg address 0800h | |
| lcd_st EQU 0801h ;; Read STATUS reg address 0801h | |
| lcd_wr EQU 0802h ;; Write DATA reg address 0802h | |
| lcd_rd EQU 0803h ;; Read DATA reg address 0803h | |
| DAC EQU 0600h ;; DAC mapped at address 0600h | |
| LEDs EQU P1 ;; Declare LEDs At P1 | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Define Some Origins ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # importing the required module | |
| from email.base64mime import header_length | |
| import matplotlib.pyplot as plt | |
| import cmath | |
| import sys | |
| import os | |
| import subprocess | |
| import uuid | |
| import subprocess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| `timescale 1ns / 1ps | |
| ////////////////////////////////////////////////////////////////////////////////// | |
| // Company: | |
| // Engineer: | |
| // | |
| // Create Date: 31.08.2022 08:57:26 | |
| // Design Name: | |
| // Module Name: set_point_generator | |
| // Project Name: | |
| // Target Devices: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| `timescale 1ns / 1ps | |
| ////////////////////////////////////////////////////////////////////////////////// | |
| // Company: | |
| // Engineer: | |
| // | |
| // Create Date: 29.08.2022 20:22:22 | |
| // Design Name: | |
| // Module Name: pwm | |
| // Project Name: | |
| // Target Devices: |