- Install Termux from F-Droid. This part is important, not from Google Play Store. GPlay restricts some functionality of Termux.
- Upgrade dependencies:
pkg update && pkg upgrade
- To access device storage, run this command. It's needed to access created LaTeX and PDF files:
termux-setup-storage
- cd into local storage:
cd ~/storage/shared
- Create LaTeX project folder. We'll save our files here and access them from this folder from our device:
mkdir LaTeX
- Install TeX Live installer:
pkg install texlive-installer
- Install TeX Live. Important note, do not change any option here:
termux-install-tl
- Create bash config file with these configurations:
nvim ~/.bashrc
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
-- barbarbar338 | |
library ieee; | |
use ieee.std_logic_1164.all; | |
entity jk_flip_flop is | |
port ( | |
clk : in std_logic; | |
j : in std_logic; | |
k : in std_logic; | |
q : out std_logic; |
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
## https://github.com/Digilent/digilent-xdc/blob/master/Basys-3-Master.xdc | |
## Clock signal | |
set_property -dict { PACKAGE_PIN W5 IOSTANDARD LVCMOS33 } [get_ports clk_in] | |
create_clock -add -name sys_clk_pin -period 10.00 -waveform {0 5} [get_ports clk_in] | |
## LEDs | |
set_property -dict { PACKAGE_PIN U16 IOSTANDARD LVCMOS33 } [get_ports {count[0]}] | |
set_property -dict { PACKAGE_PIN E19 IOSTANDARD LVCMOS33 } [get_ports {count[1]}] | |
set_property -dict { PACKAGE_PIN U19 IOSTANDARD LVCMOS33 } [get_ports {count[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
-- barbarbar338 | |
library IEEE; | |
use IEEE.STD_LOGIC_1164.ALL; | |
entity main_counter is | |
Port ( | |
clk_in : in std_logic; -- Basys3 100MHz clock | |
reset : in std_logic; | |
clk_out : out std_logic; | |
count : out std_logic_vector(2 downto 0) -- 3-bit counter |
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
-- barbarbar338 | |
library IEEE; | |
use IEEE.STD_LOGIC_1164.ALL; | |
entity dff is | |
Port ( | |
clk : in std_logic; | |
reset : in std_logic; | |
d : in std_logic; | |
q : out std_logic |
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
-- barbarbar338 | |
library IEEE; | |
use IEEE.STD_LOGIC_1164.ALL; | |
use IEEE.NUMERIC_STD.ALL; | |
entity freq_divider is | |
Port ( | |
clk_in : in std_logic; -- 100MHz clock input | |
reset : in std_logic; | |
clk_out : out std_logic -- 2Hz clock output |
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 <iostream> | |
#include <cmath> | |
using namespace std; | |
const double pi = acos(0) * 2; | |
class Pendulum { | |
private: | |
double length; |
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 <iostream> | |
#include <vector> | |
#include <fstream> | |
#include <sstream> | |
#include <map> | |
#include <algorithm> | |
using namespace std; | |
// Using pointers to pass the vector by reference |
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 <iostream> | |
/* | |
used vectors instead of arrays. | |
It's easier to work with vectors | |
because of their dynamic size. | |
~ barbarbar338 | |
*/ | |
#include <vector> |
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
/* | |
You might need to change the plotter | |
history size to see everything cleaner. | |
Here is a good tutorial for this: | |
https://youtu.be/qrfpPuw2W3A | |
*/ | |
const int analogPin = A0; // Clock output pin | |
const int threshold = 512; // Midpoint (~2.5V for a 5V signal) |
NewerOlder