JSFiddle - React, Tailwind, and code Playground
by XGundam05
HTML
<pre>
$npp_path = $env:programfiles + "\Notepad++\notepad++.exe"
$wsdl_path = $env:programfiles + "\Microsoft SDKs\Windows\v7.0a\Bin\wsdl.exe"
$svcutil_path = $env:programfiles + "\Microsoft SDKs\Windows\v7.0a\Bin\svcutil.exe"
$7z_path = $env:ProgramW6432 + "\7-Zip\7z.exe"
$nw_path = "C:\NodeWebkit\nw.exe";
New-Alias npp $npp_path
New-Alias wsdl $wsdl_path
New-Alias svcutil $svcutil_path
New-Alias 7z $7z_path
function zip([String] $inDir, [String] $outFile){
$currentLoc = Get-Location;
$outLoc = $currentLoc.toString() + $outFile;
& pushd $inDir;
[Array]$args = "a", "-tzip", "-mx9", "$outLoc", "./", "-r";
& 7z $args | out-null;
&popd;
return $outLoc;
}
function nwBuild([String] $dir){
$vars = $dir.split('\\');
$file = $vars[$vars.Length - 1] + ".nw";
$loc = zip $dir $file;
$final = "C:\NodeWebkit\apps\$file";
& Move-Item "$loc" "$final" -force;
& $nw_path "$final";
}
</pre>
<h1>Lab 2 - note playing</h1>
<pre>
// C:\ceg4330\tone.c
// This program produces a 4 KHz square wave.
// It also flashes LED1 at a frequency of 0.5 Hz (i.e.,
// on for one second and off for one second).
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
#pragma MESSAGE DISABLE C4000
/* disable the compiler warning message when a condition is always true */
void MCU_init(void); /* Device initialization function declaration */
unsigned int getNote(char* song, unsigned int* index);
void main(void) {
unsigned int count = 0;
unsigned int freqOffset = 3000;
char song[] = "";
char noteIndex = 0;
MCU_init();
TIOS |= 0x03; // use channel 1/2 for output compare
TSCR1 = 0x90; // enable timer and allow fast flag clear
TCTL2 |= 0x01; // select toggle as the action for output compare
TC1 = TCNT + freqOffset; // set up TC1 and clear C0F flag
DDRA = 0xff; // set port A as...