diff --git a/nodemcu_firmware/flashing_notes.txt b/nodemcu_firmware/flashing_notes.txt deleted file mode 100644 index c6efdad..0000000 --- a/nodemcu_firmware/flashing_notes.txt +++ /dev/null @@ -1,2 +0,0 @@ -esptool.py --port /dev/ttyUSB0 write_flash -fm qio 0x00000 nodemcu-master-9-modules-2019-04-08-19-43-38-float.bin - diff --git a/nodemcu_firmware/init.lua b/nodemcu_firmware/init.lua deleted file mode 100644 index 4a685dd..0000000 --- a/nodemcu_firmware/init.lua +++ /dev/null @@ -1,46 +0,0 @@ -dofile('motor.lua') - -cfg={} -cfg.ssid="robot-1" -cfg.pwd="roborally" -wifi.ap.config(cfg) - -sv = net.createServer() - -Peer = {} -function Peer:create(sck) - local peer = {} - setmetatable(peer, Peer) - peer.buffer = {} - return peer -end -function Peer:receive(sck, data) - self.buffer = self.buffer .. data - if #self.buffer >= 4 then - dir = string.byte(self.buffer,1) - if dir > 127 then dir = -256+dir end - motor_dir(1, dir) - - dir = string.byte(self.buffer,2) - if dir > 127 then dir = -256+dir end - motor_dir(2, dir) - - delay = string.byte(self.buffer,3) * 256 + string.byte(self.buffer, 4) - tmr.delay(delay) - - motor_dir(1, 0) - motor_dir(2, 0) - self.buffer = {} - sck:close() - end -end - -if sv then --- listen to port 80 and call callback function if data is received - sv:listen(80, -function(conn) - peer = Peer:create(conn) - conn:on("receive", peer:receive(conn)) - conn:send("robot-1 at your service") - end) -end diff --git a/nodemcu_firmware/motor.lua b/nodemcu_firmware/motor.lua deleted file mode 100644 index 18fcc22..0000000 --- a/nodemcu_firmware/motor.lua +++ /dev/null @@ -1,28 +0,0 @@ -motor = {} -motor[1] = {} -motor[1][1] = 0 -motor[1][2] = 1 -motor[1][3] = 2 - -motor[2] = {} -motor[2][1] = 3 -motor[2][2] = 4 -motor[2][3] = 5 - -for i,m in ipairs(motor) do - for i,g in ipairs(m) do - gpio.mode(g, gpio.OUTPUT) - gpio.write(g, 1) - end -end - -function motor_dir(m, dir) - if dir ~= 0 then - gpio.write(motor[m][3], 1) - gpio.write(motor[m][1], (1-dir)/2) - gpio.write(motor[m][2], (1+dir)/2) - else - gpio.write(motor[m][3], 0) - end -end - diff --git a/nodemcu_firmware/motor.lua.1 b/nodemcu_firmware/motor.lua.1 deleted file mode 100644 index 18fcc22..0000000 --- a/nodemcu_firmware/motor.lua.1 +++ /dev/null @@ -1,28 +0,0 @@ -motor = {} -motor[1] = {} -motor[1][1] = 0 -motor[1][2] = 1 -motor[1][3] = 2 - -motor[2] = {} -motor[2][1] = 3 -motor[2][2] = 4 -motor[2][3] = 5 - -for i,m in ipairs(motor) do - for i,g in ipairs(m) do - gpio.mode(g, gpio.OUTPUT) - gpio.write(g, 1) - end -end - -function motor_dir(m, dir) - if dir ~= 0 then - gpio.write(motor[m][3], 1) - gpio.write(motor[m][1], (1-dir)/2) - gpio.write(motor[m][2], (1+dir)/2) - else - gpio.write(motor[m][3], 0) - end -end - diff --git a/nodemcu_firmware/motor.lua.2 b/nodemcu_firmware/motor.lua.2 deleted file mode 100644 index 3f51483..0000000 --- a/nodemcu_firmware/motor.lua.2 +++ /dev/null @@ -1,47 +0,0 @@ -motor = {} -motor[1] = {} -motor[1][1] = 0 -motor[1][2] = 1 -motor[1][3] = 2 - -motor[2] = {} -motor[2][1] = 3 -motor[2][2] = 4 -motor[2][3] = 5 - -for i,m in ipairs(motor) do - for i,g in ipairs(m) do - gpio.mode(g, gpio.OUTPUT) - gpio.write(g, 1) - end -end - -function motor_dir(m, dir) - if dir ~= 0 then - gpio.write(motor[m][3], 1) - gpio.write(motor[m][1], (1-dir)/2) - gpio.write(motor[m][2], (1+dir)/2) - else - gpio.write(motor[m][3], 0) - end -end - -Peer = {} -function Peer:create(sck) - local peer = {} - setmetatable(peer, Peer) - peer.buffer = {} - return peer -end -function Peer:receive(sck, data) - self.buffer = self.buffer .. data - if #self.buffer >= 4 then - - sck:close() - end -end - -function(conn) - peer = Peer:create(conn) - conn:on("receive", peer:receive) -end diff --git a/nodemcu_firmware/nodemcu-master-9-modules-2019-04-08-19-43-38-float.bin b/nodemcu_firmware/nodemcu-master-9-modules-2019-04-08-19-43-38-float.bin deleted file mode 100644 index 95b1536..0000000 Binary files a/nodemcu_firmware/nodemcu-master-9-modules-2019-04-08-19-43-38-float.bin and /dev/null differ diff --git a/nodemcu_firmware/nodemcu-master-9-modules-2019-04-08-19-43-38-integer.bin b/nodemcu_firmware/nodemcu-master-9-modules-2019-04-08-19-43-38-integer.bin deleted file mode 100644 index 01a09b4..0000000 Binary files a/nodemcu_firmware/nodemcu-master-9-modules-2019-04-08-19-43-38-integer.bin and /dev/null differ diff --git a/nodemcu_firmware/notes.txt b/nodemcu_firmware/notes.txt deleted file mode 100644 index 24fcd9a..0000000 --- a/nodemcu_firmware/notes.txt +++ /dev/null @@ -1,12 +0,0 @@ -# flashing firmware onto NodeMCU -esptool.py --port /dev/ttyUSB0 write_flash -fm qio 0x00000 nodemcu-master-9-modules-2019-04-08-19-43-38-float.bin - -# connecting to NodeMCU via serial terminal -cu -l /dev/ttyUSB0 -s 115200 dir - -# uploading code to NodeMCU -nodemcu-uploader upload motor.lua -nodemcu-uploader upload init.lua - -# sending data over wifi via socket -nc 192.168.4.1 80 diff --git a/nodemcu_firmware/serial_terminal.txt b/nodemcu_firmware/serial_terminal.txt deleted file mode 100644 index 1a39c01..0000000 --- a/nodemcu_firmware/serial_terminal.txt +++ /dev/null @@ -1 +0,0 @@ -cu -l /dev/ttyUSB0 -s 115200 dir diff --git a/nodemcu_firmware/upload_notes.txt b/nodemcu_firmware/upload_notes.txt deleted file mode 100644 index 2e569eb..0000000 --- a/nodemcu_firmware/upload_notes.txt +++ /dev/null @@ -1,2 +0,0 @@ -nodemcu-uploader upload motor.lua -nodemcu-uploader upload init.lua diff --git a/notes.txt b/notes.txt deleted file mode 100644 index e33b0e9..0000000 --- a/notes.txt +++ /dev/null @@ -1,9 +0,0 @@ -https://hackaday.com/2016/06/14/hackaday-prize-entry-micro-robots-for-education/ - -https://www.adafruit.com/product/3216 - -https://www.exp-tech.de/plattformen/robotik/roboterfahrzeuge/7673/adafruit-mini-round-robot-chassis-kit-2wd-with-dc-motors?gclid=EAIaIQobChMIrpHIq4Ke4QIVSeAYCh0LTgdWEAQYCCABEgIQcfD_BwE - -https://www.exp-tech.de/plattformen/robotik/roboterfahrzeuge/7898/adafruit-mini-3-layer-round-robot-chassis-kit-2wd-with-dc-motors?gclid=EAIaIQobChMIrpHIq4Ke4QIVSeAYCh0LTgdWEAQYCyABEgI76vD_BwE - -