Skip to content

Instantly share code, notes, and snippets.

View sinbrive's full-sized avatar

sinbrive sinbrive

View GitHub Profile
@sinbrive
sinbrive / sprintf.ino
Created May 27, 2017 14:00 — forked from philippbosch/sprintf.ino
sprintf() in Arduino code
unsigned int i = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
char buffer[50];
sprintf(buffer, "the current value is %d", i++);
Serial.println(buffer);
// --------------------------------------------------------------------------- Motors
// These are the pins to the the motor drive chip for the left wheel
int motor_left[] = {12, 13};
// These are the pins to the the motor drive chip for the right wheel
int motor_right[] = {6, 7};
// --------------------------------------------------------------------------- Setup
void setup() {
Serial.begin(9600);
@sinbrive
sinbrive / codageBinaire
Last active August 30, 2017 10:12
Lab binary coding
lab for binary teaching
-arduino code (for test)
-processing (adaoed from fabacademy Fabio Paradiso)
-processing version (my version)
-python version with Tkinter
-p5js version
@sinbrive
sinbrive / PY0101EN-3-4-Classes.ipynb
Created April 23, 2020 09:30 — forked from rahulchinta97/PY0101EN-3-4-Classes.ipynb
Created on Skills Network Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sinbrive
sinbrive / python_simple_webserver.py
Created April 23, 2020 09:51 — forked from bgulla/python_simple_webserver.py
Python Webserver that serves up a flat HTML file.
#!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from time import gmtime, strftime
import sys,random,socket
PORT_NUMBER = 8000
HOSTNAME = socket.gethostname()
if len(sys.argv) > 1:
@sinbrive
sinbrive / split_strok_class.cpp
Last active April 26, 2020 11:19
Gist créé sur Android
#include <iostream>
#include <string.h>
class splitter {
private:
char *_del;
char *_str; //=new char[20];
bool _first;
char *_tok;
/*********************************************************************
sinbrive april 2020
File Decription: Finite State Machine general framework
*********************************************************************/
#include <iostream>
#include <vector>
using namespace std;
class transition {
#include "fsm.h"
Traffic traffic(2, 4, 5, 8, 10, 12); // no constraint about the digital outputs
void setup() {
Serial.begin(9600);
}
String str = "";
#include <iostream>
using namespace std;
void convertirDec();
void convertirBin();
void convertirHex();
int char2int (char);
char hexa_A [] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
@sinbrive
sinbrive / td2-ter.cpp
Created October 1, 2020 20:18
Td2 ter
#include <iostream>
#include <cmath>
//#include <string>
using namespace std;
char hexa [] = {'0','1','2','3','4','5','6', \
'7','8','9','A','B','C','D','E','F'};
unsigned char poids[] = {1,2,4,8,16,32,64,128};