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
WifiConfiguration wifiConfig = new WifiConfiguration(); | |
wifiConfig.SSID = String.format("\"%s\"", ssid); | |
wifiConfig.preSharedKey = String.format("\"%s\"", key); | |
WifiManager wifiManager = (WifiManager)getSystemService(WIFI_SERVICE); | |
//remember id | |
int netId = wifiManager.addNetwork(wifiConfig); | |
wifiManager.disconnect(); | |
wifiManager.enableNetwork(netId, true); | |
wifiManager.reconnect(); |
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
import serial | |
# this port address is for the serial tx/rx pins on the GPIO header | |
SERIAL_PORT = '/dev/ttyAMA0' | |
# be sure to set this to the same rate used on the Arduino | |
SERIAL_RATE = 9600 | |
def main(): |