ESP8266 part of the f105-motor-demo project (see f105-motor-demo_stm32)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
26 KiB

<?php $page = 'waveform';
include "_start.php"; ?>
<h1>Waveform</h1>
<div class="Box">Blah blah blah</div>
<div class="Box medium">
<div id="chart" class="ct-chart ct-wide"></div>
</div>
<script>
var resp = {
"samples": [1878, 1883, 1887, 1897, 1906, 1915, 1926, 1940, 1955, 1970, 1982, 1996, 2012, 2026, 2038, 2049, 2058, 2068, 2076, 2082, 2091, 2097, 2102, 2102, 2108, 2114, 2124, 2134, 2143, 2149, 2156, 2158, 2161, 2165, 2173, 2183, 2186, 2189, 2194, 2195, 2196, 2191, 2183, 2177, 2169, 2157, 2147, 2135, 2122, 2111, 2093, 2078, 2065, 2052, 2036, 2022, 2012, 2006, 1999, 1988, 1980, 1973, 1970, 1966, 1959, 1953, 1946, 1940, 1928, 1915, 1907, 1899, 1892, 1885, 1879, 1876, 1875, 1873, 1870, 1870, 1873, 1877, 1883, 1888, 1898, 1904, 1914, 1922, 1934, 1949, 1963, 1974, 1989, 2005, 2019, 2032, 2043, 2055, 2067, 2075, 2082, 2089, 2097, 2104, 2106, 2110, 2115, 2124, 2131, 2139, 2149, 2158, 2163, 2164, 2165, 2173, 2183, 2188, 2192, 2196, 2201, 2203, 2200, 2195, 2189, 2185, 2176, 2166, 2154, 2143, 2129, 2116, 2100, 2085, 2071, 2057, 2041, 2028, 2017, 2009, 1999, 1988, 1980, 1976, 1971, 1964, 1961, 1956, 1949, 1941, 1928, 1917, 1908, 1900, 1891, 1885, 1882, 1879, 1876, 1873, 1873, 1872, 1874, 1879, 1884, 1892, 1899, 1905, 1913, 1924, 1937, 1950, 1961, 1975, 1991, 2007, 2020, 2033, 2045, 2059, 2069, 2075, 2083, 2093, 2100, 2104, 2106, 2112, 2117, 2124, 2131, 2141, 2152, 2161, 2164, 2164, 2168, 2176, 2184, 2189, 2193, 2200, 2205, 2203, 2200, 2196, 2193, 2185, 2176, 2166, 2156, 2145, 2130, 2115, 2100, 2088, 2072, 2057, 2042, 2029, 2019, 2008, 1998, 1989, 1984, 1977, 1969, 1966, 1962, 1956, 1950, 1941, 1930, 1919, 1907, 1899, 1891, 1888, 1882, 1879, 1876, 1875, 1874, 1874, 1875, 1878, 1886, 1893, 1899, 1905, 1916, 1928, 1938, 1951, 1963, 1978, 1994, 2007, 2022, 2035, 2050, 2059, 2067, 2075, 2085, 2095, 2099, 2103, 2108, 2115, 2119, 2125, 2131, 2144, 2154, 2160, 2164, 2166, 2170, 2177, 2184, 2189, 2195, 2201, 2204, 2204, 2202, 2198, 2193, 2185, 2176, 2167, 2157, 2144, 2130, 2116, 2103, 2086, 2071, 2056, 2043, 2030, 2019, 2007, 1999, 1991, 1983, 1976, 1970, 1967, 1962, 1956, 1948, 1942, 1931, 1919, 1908, 1899, 1893, 1889, 1883, 1878, 1877, 1876, 1875, 1873, 1874, 1881, 1887, 1893, 1900, 1907, 1918, 1927, 1937, 1950, 1965, 1979, 1993, 2006, 2022, 2038, 2050, 2061, 2068, 2077, 2087, 2094, 2100, 2106, 2110, 2114, 2119, 2125, 2134, 2145, 2154, 2160, 2164, 2167, 2170, 2177, 2183, 2191, 2196, 2202, 2203, 2205, 2203, 2200, 2192, 2185, 2176, 2169, 2156, 2143, 2129, 2118, 2103, 2086, 2072, 2058, 2043, 2030, 2017, 2007, 2001, 1992, 1983, 1975, 1971, 1968, 1962, 1955, 1948, 1943, 1930, 1917, 1907, 1900, 1893, 1888, 1882, 1879, 1878, 1875, 1872, 1872, 1876, 1881, 1886, 1891, 1899, 1909, 1917, 1926, 1938, 1952, 1967, 1979, 1992, 2008, 2022, 2037, 2050, 2060, 2070, 2077, 2086, 2091, 2100, 2106, 2110, 2112, 2117, 2125, 2134, 2144, 2151, 2160, 2166, 2167, 2169, 2176, 2184, 2192, 2195, 2199, 2203, 2205, 2202, 2197, 2191, 2184, 2178, 2167, 2155, 2143, 2131, 2116, 2099, 2084, 2070, 2058, 2041, 2027, 2015, 2008, 1999, 1989, 1981, 1975, 1971, 1965, 1959, 1954, 1950, 1940, 1927, 1915, 1907, 1898, 1891, 1883, 1882, 1879, 1876, 1874, 1872, 1872, 1876, 1879, 1885, 1892, 1899, 1908, 1916, 1925, 1938, 1951, 1964, 1977, 1993, 2009, 2023, 2034, 2046, 2059, 2069, 2076, 2084, 2092, 2100, 2105, 2108, 2110, 2118, 2125, 2131, 2142, 2150, 2160, 2164, 2164, 2167, 2176, 2184, 2190, 2193, 2200, 2203, 2203, 2201, 2195, 2190, 2185, 2175, 2163, 2153, 2142, 2127, 2112, 2098, 2083, 2070, 2053, 2038, 2028, 2018, 2006, 1995, 1988, 1980, 1973, 1968, 1963, 1958, 1954, 1947, 1937, 1925, 1915, 1905, 1896, 1888, 1885, 1880, 1878, 1874, 1871, 1871, 1872, 1874, 1877, 1883, 1890, 1898, 1904, 1913, 1925, 1937, 1951, 1962, 1976, 1994, 2007, 2019, 2031, 2046, 2058, 2067, 2074, 2083, 2091, 2098, 2102, 2105, 2111, 2117, 2123, 2129, 2140, 2152, 2159, 2159, 2161, 2167, 2175, 2182, 2187, 2192, 2199, 2200, 2200, 2197, 2195, 2189, 2181, 2170, 2162, 2151, 2140, 2125, 2110, 2096, 2083, 2066, 2050, 2037, 2026, 2015, 2003, 1993, 1986, 1979, 1970, 1965, 1962, 1958, 1952, 1943, 1935, 1924, 1913, 1903, 1895, 1886, 1883, 1879, 1874, 1872, 1871, 1870, 1870, 1871, 1877, 1883, 1889, 1895, 1903, 1914, 1924, 1936, 1950, 1962, 1978, 1991, 2006, 2019, 2033, 2046, 2056, 2065, 2074, 2082, 2091, 2095, 2101, 2107, 2111, 2
"success": true
};
$().ready(function () {
var data = [];
resp.samples.forEach(function (a, i) {
if (i > 500) return;
data.push({x: i, y: a});
});
// Build the chart
var chartData = {
series: [
{
name: 'series-1',
data: data
},
]
};
var plugins = [];
var mql = window.matchMedia('screen and (min-width: 544px)');
var isPhone = !mql.matches;
if (!isPhone) {
// larger than phone
plugins.push(
Chartist.plugins.ctAxisTitle({
axisX: {
axisTitle: 'Sample Nr.',
offset: {
x: 0,
y: 55
}
},
axisY: {
axisTitle: 'ADC value',
flipText: true,
offset: {
x: 0,
y: 15
}
}
})
);
}
var chartSettings = {
showPoint: false,
showArea: true,
fullWidth: true,
chartPadding: (isPhone ? {
right: 20,
bottom: 5,
left: 0
} : {
right: 25,
bottom: 30,
left: 25
}),
series: {
'series-1': {
lineSmooth: Chartist.Interpolation.none()
}
},
axisX: {
type: Chartist.AutoScaleAxis,
onlyInteger: true
},
axisY: {
type: Chartist.AutoScaleAxis,
//onlyInteger: true
},
plugins: plugins
};
new Chartist.Line('#chart', chartData, chartSettings);
});
</script>
<?php include "_end.php"; ?>