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
#include <Wire.h> | |
void setup() { | |
Wire.begin(); | |
Serial.begin(115200); | |
Serial.println("\nI2C Scanner"); | |
} | |
void loop() { | |
byte error, address; |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Fri Dec 6 23:27:32 2019 | |
@author: jaordonez | |
""" | |
numeros = 1 + 2 * 3/ 4 |
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
#include "ThingSpeak.h" | |
#include <ESP8266WiFi.h> | |
//---------------- Fill in your credentails --------------------- | |
char ssid[] = "xxx"; // your network SSID (name), tên wifi | |
char pass[] = "xxxxx"; // your network password, password | |
unsigned long myChannelNumber = 1; // Replace the 0 with your channel number, channel của bạn | |
const char * myWriteAPIKey = "xxxxx"; // Paste your ThingSpeak Write API Key between the quotes, write API key | |
//------------------------------------------------------------------ |
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
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
const char* ssid = "wifi_name"; | |
const char* password = "pass"; | |
const char* mqttServer = "m12.cloudmqtt.com"; | |
const int mqttPort = 10769; | |
const char* mqttUser = "your_username"; | |
const char* mqttPassword = "your_password"; |
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
int LED = 2; | |
void setup() { | |
pinMode(LED, OUTPUT); | |
} | |
void loop() { | |
delay(200); | |
digitalWrite(LED, LOW); | |
delay(200); |
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
/**The MIT License (MIT) | |
Copyright (c) 2016 by Rene-Martin Tudyka | |
Based on the SSD1306 OLED library Copyright (c) 2015 by Daniel Eichhorn (http://blog.squix.ch), | |
available at https://github.com/squix78/esp8266-oled-ssd1306 | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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
#include "tm4c123ge6pm.h" | |
unsigned long In; // input from PF4 | |
unsigned long Out; // output to PF2 (blue LED) | |
// Function Prototypes | |
void PortF_Init(void); | |
// 3. Subroutines Section |
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
// 0.Documentation Section | |
// main.c | |
// Runs on LM4F120 or TM4C123 | |
// C6_InputOutput, Input from PF4, output to PF2 (blue LED) | |
// Authors: Daniel Valvano, Jonathan Valvano and Ramesh Yerraballi | |
// Date: July 8, 2013 | |
// LaunchPad built-in hardware | |
// SW1 left switch is negative logic PF4 on the Launchpad | |
// SW2 right switch is negative logic PF0 on the Launchpad |
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
while(side != 0){ | |
printf("Give room side(zero to quit):"); | |
scanf("%ld", &side); | |
area = Calc_Area(side); | |
if(area != 0){ | |
printf("\nArea with side of %ld m is %ld sqr m\n",side,area); | |
} else { | |
printf("\n Size cannot exceed 25 meters\n"); | |
} | |
} |
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
int main(void) { | |
unsigned long side; // Chiều dài của phòng đơn vị mét | |
unsigned long area; // Diện tích phòng đơn vị mét vuông | |
UART_Init(); // gọi subroutine để init uart | |
printf("This program calculates areas of square-shaped rooms\n"); | |
for(side = 1; side < 50; side = side+1){ | |
area = Calc_Area(side); | |
printf("\nArea of the room with side of %ld m is %ld sqr m\n",side,area); | |
} | |
} |
NewerOlder