-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add gitignore * change pin names * gitignore add .vscode * adding server to echo system * modifying 14 code * ota feature * add schematics to extra * ota implementation and stop motor func * stop motor func * examples 14-updated * motor action corrections * example-14 websocket and dependencies * library.properties and ci update * aaded io3 and io4 * example:ultrasonic and some cleanup * example:line follower and some cleanup * web_page string to be passesd by referance * added support fro display * decouple two motors * ex 11 and 14 * html of buildybee 13 and 14 * 13_main code * working rgb control * cosmetics changes and library property updates * update beebot url * update version to v0.1.1
- Loading branch information
Showing
28 changed files
with
568 additions
and
1,215 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/.* | ||
.vscode/** |
14 changes: 10 additions & 4 deletions
14
...tance_measuring/08_distance_measuring.ino → ...ring/01_ultrasonic_distance_measuring.ino
This file contains 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
178 changes: 0 additions & 178 deletions
178
examples/01_wifi_controlled_bot/01_wifi_controlled_bot.ino
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
examples/02_single_ir_line_follower/02_single_ir_line_follower.ino
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//Connect a IR sensor or TCTR5000 module to IO1 and place the car on a black track with white background ground. | ||
//press the tactile button to start the line follower mode and press gain to stop line following mode. | ||
|
||
#include <blite.h> | ||
Blite myBot; | ||
int ir = myBot.getIO("io1"); | ||
bool lineFollowerMode = false; | ||
int cs; | ||
|
||
void setup() | ||
{ | ||
// Debug console | ||
Serial.begin(115200); | ||
myBot.setup(); | ||
myBot.reversePolarityM12(); | ||
myBot.smartConnectWiFi(); | ||
|
||
} | ||
|
||
void loop() | ||
{ | ||
myBot.otaLoop(); | ||
|
||
if(myBot.buttonPressed()) { | ||
lineFollowerMode = !lineFollowerMode; | ||
} | ||
if (lineFollowerMode){ | ||
cs=digitalRead(ir); | ||
|
||
if(cs==HIGH) | ||
{ | ||
myBot.moveForward(); | ||
} | ||
else if(cs==LOW) | ||
{ | ||
myBot.turnRight(); | ||
} | ||
if (myBot.buttonPressed()){ | ||
lineFollowerMode = false; | ||
myBot.stopMotor(); | ||
} | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#include <blite.h> | ||
#include "lighting.h" | ||
#include <WebSocketsServer.h> | ||
|
||
//install "Adafruit Neopixel" from arduino library manager | ||
#include <Adafruit_NeoPixel.h> | ||
|
||
//number of rgb leds present in the device | ||
#define NUM_LEDS 16 | ||
|
||
Blite myBot; | ||
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, myBot.getIO("io1"), NEO_RGB + NEO_KHZ800); | ||
WebSocketsServer webSocket = WebSocketsServer(81); | ||
|
||
void setup(){ | ||
myBot.setup(); | ||
myBot.reversePolarityM12(); | ||
Serial.begin(115200); | ||
delay(1000); | ||
if (myBot.buttonPressed()){ | ||
myBot.APServer(); | ||
} else { | ||
myBot.smartConnectWiFi(); | ||
} | ||
webSocket.begin(); | ||
webSocket.onEvent(webSocketEvent); | ||
strip.setBrightness(150); | ||
strip.begin(); | ||
} | ||
void loop(){ | ||
String html = HTML_LIGHT; | ||
myBot.smartRenderServer(html); | ||
webSocket.loop(); | ||
} | ||
|
||
void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length) { | ||
String command = String((char*)payload); | ||
Serial.print("command: "); | ||
Serial.println(command); | ||
// setting the color to the strip | ||
setNeoColor(command); | ||
} | ||
|
||
void setNeoColor(String value){ | ||
Serial.print("Setting Neopixel..."); | ||
// converting Hex to Int | ||
int number = (int) strtol( &value[1], NULL, 16); | ||
// splitting into three parts | ||
int r = number >> 16; | ||
int g = number >> 8 & 0xFF; | ||
int b = number & 0xFF; | ||
|
||
// DEBUG | ||
Serial.print("RGB: "); | ||
Serial.print(r, DEC); | ||
Serial.print(" "); | ||
Serial.print(g, DEC); | ||
Serial.print(" "); | ||
Serial.print(b, DEC); | ||
Serial.println(" "); | ||
|
||
// setting whole strip to the given color | ||
for(int i=0; i < NUM_LEDS; i++) { | ||
strip.setPixelColor(i, strip.Color( g, r, b ) ); | ||
} | ||
// init | ||
strip.show(); | ||
|
||
Serial.println("on."); | ||
} |
Oops, something went wrong.