Skip to content

Instantly share code, notes, and snippets.

View VincentK16's full-sized avatar
:octocat:
Connect with me

Vincent Kok VincentK16

:octocat:
Connect with me
View GitHub Profile
import json
from ibm_watson import AssistantV2
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
authenticator = IAMAuthenticator(
'<replace with your own IBM Watson Assistant API Key>')
assistant = AssistantV2(
version='2020-09-24',
authenticator=authenticator
)
@VincentK16
VincentK16 / speech_recognize_actions_demo.py
Last active December 22, 2021 06:16
Alpha Mini with IBM Watson Assistant + Robot Actions
# To run this code, make sure:
# 1. Have installed "alphamini" and "ibm-watson" Python modules
# 2. Changes to your IBM Watson Assistant parameters:
# a. API key
# b. Assistant URL
# c. Assistant ID
# 3. Alpha Mini serial number
# Follow through the code below to see where are the changes needed.
@VincentK16
VincentK16 / speech_recognize_demo.py
Last active March 14, 2023 13:26
IBM Watson Assistant integration with the Alpha Mini speech recognizer and text to speech system using the Alpha Mini Python SDK from the available demo code.
# To run this code, make sure:
# 1. Have installed "alphamini" and "ibm-watson" Python modules
# 2. Changes to your IBM Watson Assistant parameters:
# a. API key
# b. Assistant URL
# c. Assistant ID
# 3. Alpha Mini serial number
# Follow through the code below to see where are the changes needed.
@VincentK16
VincentK16 / NodeMCU_receive_from_Arduino_NANO.ino
Created July 11, 2021 12:24 — forked from ariffinzulkifli/NodeMCU_receive_from_Arduino_NANO.ino
Arduino sketch for NodeMCU to receive incoming data from Arduino NANO using SoftwareSerial library
#include <SoftwareSerial.h>
SoftwareSerial softSerial(D2, D3); // (RX, TX)
SimpleDHT11 dht11(5);
void setup() {
softSerial.begin(9600);
}
int motorPin1 = 7;
int motorPin2 = 8;
int enablePin_1 = 6;
int motorPin4 = 2;
int motorPin3 = 4;
int enablePin_2 =3 ;
int buzzer = 11;
int f_b_light = 12 ;
int state;
int flag=0; //makes sure that the serial only prints once the state
@VincentK16
VincentK16 / gist:7716910
Created November 30, 2013 09:15
Electric Car
[quote]
[color=#CC6600]int[/color] motorPin1 = 7;
[color=#CC6600]int[/color] motorPin2 = 8;
[color=#CC6600]int[/color] enablePin_1 = 6;
[color=#CC6600]int[/color] motorPin4 = 2;
[color=#CC6600]int[/color] motorPin3 = 4;
[color=#CC6600]int[/color] enablePin_2 =3 ;
[color=#CC6600]int[/color] buzzer = 11;
[color=#CC6600]int[/color] f_b_light = 12 ;
[color=#CC6600]int[/color] state;
@VincentK16
VincentK16 / Mini Piano V1.0
Created September 15, 2013 16:17
Mini Piano V1.0 - Using arduino to generate melody !
int led = A0;
int speaker = 13;
int button_1 = 0;
int button_2 = 1;
int button_3=2;
int button_4 = 3;
int button_5 = 4;
int button_6=5;
int button_7=6;
int button_8=7;
@VincentK16
VincentK16 / Mini Piano V1.0(Arduino)
Last active December 22, 2015 00:38
Mini Piano V1.0
int speaker = 13;
int button_1 = 0;
int button_2 = 1;
int button_3=2;
int button_4 = 3;
int button_5 = 4;
int button_6=5;
int button_7=6;
int button_8=7;
int button_9=8;
@VincentK16
VincentK16 / Temperature-Controlled DC Fan
Last active December 19, 2015 21:19
This is a very simple coding to make an temperature-controlled automatic fan. It will display the temperature at the 16 X 2 LCD screen. When the temperature is more than 35 degree celcius, it will trigger the relay and get the DC fan to ON.
#include <LiquidCrystal.h>
int reading = 0;
int sensorPin = A0;
int relay =7;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
@VincentK16
VincentK16 / Active-HIGH button
Created July 11, 2013 08:52
This is the code for Active-HIGH button which we turn on an LED when the switch is pressed
const int buttonPin = 3; // the number of the pushbutton pin
const int ledPin = 2; // the number of the LED pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input: